Skip to content

Commit

Permalink
CodeGen from PR 14545 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 0625e805651826884d17127001ac6e2d53a2d5bc into 45080747a094f6a64968b6f93aa1f9a7233a63ae
  • Loading branch information
SDKAuto committed Jul 23, 2021
1 parent af8126a commit 18928c7
Show file tree
Hide file tree
Showing 13 changed files with 369 additions and 26 deletions.
9 changes: 3 additions & 6 deletions sdk/storagecache/arm-storagecache/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## Azure StorageCacheManagementClient SDK for JavaScript

This package contains an isomorphic SDK (runs both in Node.js and in browsers) for StorageCacheManagementClient.
This package contains an isomorphic SDK (runs both in node.js and in browsers) for StorageCacheManagementClient.

### Currently supported environments

- [LTS versions of Node.js](https://nodejs.org/about/releases/)
- Latest versions of Safari, Chrome, Edge, and Firefox.
- Latest versions of Safari, Chrome, Edge and Firefox.

### Prerequisites

Expand All @@ -21,7 +21,6 @@ Install both packages using the below command:
```bash
npm install --save @azure/arm-storagecache @azure/identity
```

> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features.
If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options.

Expand All @@ -37,7 +36,6 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/

In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started.

#### nodejs - Authentication, client creation, and list operations as an example written in JavaScript.

##### Sample code
Expand All @@ -51,7 +49,6 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead.
const creds = new DefaultAzureCredential();
const client = new StorageCacheManagementClient(creds, subscriptionId);

client.operations.list().then((result) => {
console.log("The result is:");
console.log(result);
Expand Down Expand Up @@ -86,7 +83,7 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t
const credential = new InteractiveBrowserCredential(
{
clientId: "<client id for your Azure AD app>",
tenantId: "<optional tenant for your organization>"
tenant: "<optional tenant for your organization>"
});
const client = new Azure.ArmStoragecache.StorageCacheManagementClient(creds, subscriptionId);
client.operations.list().then((result) => {
Expand Down
2 changes: 1 addition & 1 deletion sdk/storagecache/arm-storagecache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"uglify-js": "^3.6.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storagecache/arm-storagecache",
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/storagecache/arm-storagecache",
"repository": {
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export {
CacheEncryptionSettings,
CacheHealth,
CacheIdentity,
CacheIdentityUserAssignedIdentitiesValue,
CacheNetworkSettings,
CacheSecuritySettings,
CacheSku,
Expand Down
74 changes: 64 additions & 10 deletions sdk/storagecache/arm-storagecache/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,24 +201,46 @@ export interface AscOperation {
output?: { [propertyName: string]: any };
}

/**
* An interface representing CacheIdentityUserAssignedIdentitiesValue.
*/
export interface CacheIdentityUserAssignedIdentitiesValue {
/**
* The principal ID of the user-assigned identity.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly principalId?: string;
/**
* The client ID of the user-assigned identity.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly clientId?: string;
}

/**
* Cache identity properties.
*/
export interface CacheIdentity {
/**
* The principal id of the cache.
* The principal ID for the system-assigned identity of the cache.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly principalId?: string;
/**
* The tenant id associated with the cache.
* The tenant ID associated with the cache.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly tenantId?: string;
/**
* The type of identity used for the cache. Possible values include: 'SystemAssigned', 'None'
* The type of identity used for the cache. Possible values include: 'SystemAssigned',
* 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
*/
type?: CacheIdentityType;
/**
* A dictionary where each key is a user assigned identity resource ID, and each key's value is
* an empty dictionary.
*/
userAssignedIdentities?: { [propertyName: string]: CacheIdentityUserAssignedIdentitiesValue };
}

/**
Expand Down Expand Up @@ -346,7 +368,8 @@ export interface CacheNetworkSettings {
*/
dnsSearchDomain?: string;
/**
* NTP server IP Address or FQDN for the cache to use. The default is time.windows.com.
* NTP server IP Address or FQDN for the cache to use. The default is time.windows.com. Default
* value: 'time.windows.com'.
*/
ntpServer?: string;
}
Expand Down Expand Up @@ -383,6 +406,11 @@ export interface CacheEncryptionSettings {
* Specifies the location of the key encryption key in Key Vault.
*/
keyEncryptionKey?: KeyVaultKeyReference;
/**
* Specifies whether the service will automatically rotate to the newest version of the key in
* the Key Vault.
*/
rotationToLatestKeyVersionEnabled?: boolean;
}

/**
Expand Down Expand Up @@ -669,16 +697,18 @@ export interface Cache extends BaseResource {
* https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property.
* Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting',
* 'Updating'
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
provisioningState?: ProvisioningStateType;
readonly provisioningState?: ProvisioningStateType;
/**
* Subnet used for the Cache.
*/
subnet?: string;
/**
* Upgrade status of the Cache.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
upgradeStatus?: CacheUpgradeStatus;
readonly upgradeStatus?: CacheUpgradeStatus;
/**
* Specifies network settings of the cache.
*/
Expand Down Expand Up @@ -718,7 +748,7 @@ export interface NamespaceJunction {
*/
nfsExport?: string;
/**
* Name of the access policy applied to this junction.
* Name of the access policy applied to this junction. Default value: 'default'.
*/
nfsAccessPolicy?: string;
}
Expand Down Expand Up @@ -819,8 +849,9 @@ export interface StorageTarget extends StorageTargetResource {
* https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property.
* Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting',
* 'Updating'
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
provisioningState?: ProvisioningStateType;
readonly provisioningState?: ProvisioningStateType;
/**
* Properties when targetType is nfs3.
*/
Expand Down Expand Up @@ -986,6 +1017,17 @@ export interface CachesBeginCreateOrUpdateOptionalParams extends msRest.RequestO
cache?: Cache;
}

/**
* Optional Parameters.
*/
export interface StorageTargetsDeleteMethodOptionalParams extends msRest.RequestOptionsBase {
/**
* Boolean value requesting the force delete operation for a storage target. Force delete
* discards unwritten-data in the cache instead of flushing it to back-end storage.
*/
force?: string;
}

/**
* Optional Parameters.
*/
Expand All @@ -996,6 +1038,17 @@ export interface StorageTargetsCreateOrUpdateOptionalParams extends msRest.Reque
storagetarget?: StorageTarget;
}

/**
* Optional Parameters.
*/
export interface StorageTargetsBeginDeleteMethodOptionalParams extends msRest.RequestOptionsBase {
/**
* Boolean value requesting the force delete operation for a storage target. Force delete
* discards unwritten-data in the cache instead of flushing it to back-end storage.
*/
force?: string;
}

/**
* Optional Parameters.
*/
Expand Down Expand Up @@ -1086,11 +1139,12 @@ export type MetricAggregationType = 'NotSpecified' | 'None' | 'Average' | 'Minim

/**
* Defines values for CacheIdentityType.
* Possible values include: 'SystemAssigned', 'None'
* Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned',
* 'None'
* @readonly
* @enum {string}
*/
export type CacheIdentityType = 'SystemAssigned' | 'None';
export type CacheIdentityType = 'SystemAssigned' | 'UserAssigned' | 'SystemAssigned, UserAssigned' | 'None';

/**
* Defines values for CreatedByType.
Expand Down
51 changes: 50 additions & 1 deletion sdk/storagecache/arm-storagecache/src/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,30 @@ export const AscOperation: msRest.CompositeMapper = {
}
};

export const CacheIdentityUserAssignedIdentitiesValue: msRest.CompositeMapper = {
serializedName: "CacheIdentity_userAssignedIdentitiesValue",
type: {
name: "Composite",
className: "CacheIdentityUserAssignedIdentitiesValue",
modelProperties: {
principalId: {
readOnly: true,
serializedName: "principalId",
type: {
name: "String"
}
},
clientId: {
readOnly: true,
serializedName: "clientId",
type: {
name: "String"
}
}
}
}
};

export const CacheIdentity: msRest.CompositeMapper = {
serializedName: "CacheIdentity",
type: {
Expand All @@ -359,9 +383,23 @@ export const CacheIdentity: msRest.CompositeMapper = {
name: "Enum",
allowedValues: [
"SystemAssigned",
"UserAssigned",
"SystemAssigned, UserAssigned",
"None"
]
}
},
userAssignedIdentities: {
serializedName: "userAssignedIdentities",
type: {
name: "Dictionary",
value: {
type: {
name: "Composite",
className: "CacheIdentityUserAssignedIdentitiesValue"
}
}
}
}
}
}
Expand Down Expand Up @@ -565,6 +603,7 @@ export const CacheNetworkSettings: msRest.CompositeMapper = {
},
ntpServer: {
serializedName: "ntpServer",
defaultValue: 'time.windows.com',
type: {
name: "String"
}
Expand Down Expand Up @@ -626,6 +665,12 @@ export const CacheEncryptionSettings: msRest.CompositeMapper = {
name: "Composite",
className: "KeyVaultKeyReference"
}
},
rotationToLatestKeyVersionEnabled: {
serializedName: "rotationToLatestKeyVersionEnabled",
type: {
name: "Boolean"
}
}
}
}
Expand Down Expand Up @@ -1061,6 +1106,7 @@ export const Cache: msRest.CompositeMapper = {
}
},
provisioningState: {
readOnly: true,
serializedName: "properties.provisioningState",
type: {
name: "String"
Expand All @@ -1073,6 +1119,7 @@ export const Cache: msRest.CompositeMapper = {
}
},
upgradeStatus: {
readOnly: true,
serializedName: "properties.upgradeStatus",
type: {
name: "Composite",
Expand Down Expand Up @@ -1144,6 +1191,7 @@ export const NamespaceJunction: msRest.CompositeMapper = {
},
nfsAccessPolicy: {
serializedName: "nfsAccessPolicy",
defaultValue: 'default',
type: {
name: "String"
}
Expand All @@ -1161,7 +1209,7 @@ export const Nfs3Target: msRest.CompositeMapper = {
target: {
serializedName: "target",
constraints: {
Pattern: /^[-.0-9a-zA-Z]+$/
Pattern: /^[-.,0-9a-zA-Z]+$/
},
type: {
name: "String"
Expand Down Expand Up @@ -1309,6 +1357,7 @@ export const StorageTarget: msRest.CompositeMapper = {
}
},
provisioningState: {
readOnly: true,
serializedName: "properties.provisioningState",
type: {
name: "String"
Expand Down
12 changes: 12 additions & 0 deletions sdk/storagecache/arm-storagecache/src/models/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ export const cacheName: msRest.OperationURLParameter = {
}
}
};
export const force: msRest.OperationQueryParameter = {
parameterPath: [
"options",
"force"
],
mapper: {
serializedName: "force",
type: {
name: "String"
}
}
};
export const location: msRest.OperationURLParameter = {
parameterPath: "location",
mapper: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

export {
CloudError
} from "../models/mappers";
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export {
CacheEncryptionSettings,
CacheHealth,
CacheIdentity,
CacheIdentityUserAssignedIdentitiesValue,
CacheNetworkSettings,
CacheSecuritySettings,
CacheSku,
Expand Down
1 change: 1 addition & 0 deletions sdk/storagecache/arm-storagecache/src/operations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ export * from "./usageModels";
export * from "./ascOperations";
export * from "./caches";
export * from "./storageTargets";
export * from "./storageTargetOperations";
Loading

0 comments on commit 18928c7

Please sign in to comment.