From 480cddab9c5830cd5ce30356229a9dd315ef2e75 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 24 Nov 2020 02:24:27 +0000 Subject: [PATCH] CodeGen from PR 11593 in Azure/azure-rest-api-specs Fix s360 kpis for 2020-03-01. (#11593) * Fix s360 kpis for 2020-03-01. * Delete Caches_Delete.json.bak Remove backup file that was accidentally pushed. * Delete Caches_Flush.json.bak Remove backup file that was accidentally pushed. * Delete Caches_Start.json.bak Remove backup file that was accidentally pushed. * Delete Caches_Stop.json.bak Remove backup file that was accidentally pushed. * Delete Caches_UpgradeFirmware.json.bak Remove backup file that was accidentally pushed. * Delete StorageTargets_Delete.json.bak Remove backup file that was accidentally pushed. --- sdk/storagecache/arm-storagecache/README.md | 9 +- .../arm-storagecache/rollup.config.js | 4 +- .../src/models/ascOperationsMappers.ts | 14 + .../src/models/cachesMappers.ts | 5 +- .../arm-storagecache/src/models/index.ts | 256 ++++++++++++-- .../arm-storagecache/src/models/mappers.ts | 316 ++++++++++++++++-- .../src/models/operationsMappers.ts | 9 +- .../arm-storagecache/src/models/parameters.ts | 25 +- .../src/models/skusMappers.ts | 4 +- .../src/models/storageTargetsMappers.ts | 5 +- .../src/models/usageModelsMappers.ts | 4 +- .../src/operations/ascOperations.ts | 86 +++++ .../arm-storagecache/src/operations/caches.ts | 14 +- .../arm-storagecache/src/operations/index.ts | 6 +- .../src/operations/operations.ts | 8 +- .../arm-storagecache/src/operations/skus.ts | 8 +- .../src/operations/storageTargets.ts | 11 +- .../src/operations/usageModels.ts | 8 +- .../src/storageCacheManagementClient.ts | 7 +- .../storageCacheManagementClientContext.ts | 5 +- 20 files changed, 704 insertions(+), 100 deletions(-) create mode 100644 sdk/storagecache/arm-storagecache/src/models/ascOperationsMappers.ts create mode 100644 sdk/storagecache/arm-storagecache/src/operations/ascOperations.ts diff --git a/sdk/storagecache/arm-storagecache/README.md b/sdk/storagecache/arm-storagecache/README.md index 2595ce41138f..d42f43290e2c 100644 --- a/sdk/storagecache/arm-storagecache/README.md +++ b/sdk/storagecache/arm-storagecache/README.md @@ -15,7 +15,7 @@ npm install @azure/arm-storagecache ### How to use -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +#### nodejs - client creation and list operations as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth @@ -26,11 +26,10 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0" ##### Sample code +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package ```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { StorageCacheManagementClient, StorageCacheManagementModels, StorageCacheManagementMappers } from "@azure/arm-storagecache"; +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { StorageCacheManagementClient } = require("@azure/arm-storagecache"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { diff --git a/sdk/storagecache/arm-storagecache/rollup.config.js b/sdk/storagecache/arm-storagecache/rollup.config.js index 921b4319977d..8e109d293547 100644 --- a/sdk/storagecache/arm-storagecache/rollup.config.js +++ b/sdk/storagecache/arm-storagecache/rollup.config.js @@ -21,8 +21,8 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/storagecache/arm-storagecache/src/models/ascOperationsMappers.ts b/sdk/storagecache/arm-storagecache/src/models/ascOperationsMappers.ts new file mode 100644 index 000000000000..07ca4ca0a14b --- /dev/null +++ b/sdk/storagecache/arm-storagecache/src/models/ascOperationsMappers.ts @@ -0,0 +1,14 @@ +/* + * 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 { + discriminators, + AscOperation, + CloudError, + ErrorResponse +} from "../models/mappers"; diff --git a/sdk/storagecache/arm-storagecache/src/models/cachesMappers.ts b/sdk/storagecache/arm-storagecache/src/models/cachesMappers.ts index 1947d5dd68fb..6af9fbc7333a 100644 --- a/sdk/storagecache/arm-storagecache/src/models/cachesMappers.ts +++ b/sdk/storagecache/arm-storagecache/src/models/cachesMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -26,5 +26,6 @@ export { Nfs3Target, StorageTarget, StorageTargetResource, + SystemData, UnknownTarget } from "../models/mappers"; diff --git a/sdk/storagecache/arm-storagecache/src/models/index.ts b/sdk/storagecache/arm-storagecache/src/models/index.ts index 8c58bd4783db..3d2241e95ffe 100644 --- a/sdk/storagecache/arm-storagecache/src/models/index.ts +++ b/sdk/storagecache/arm-storagecache/src/models/index.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -27,6 +27,80 @@ export interface ApiOperationDisplay { * Resource on which the operation is performed: Cache, etc. */ resource?: string; + /** + * The description of the operation + */ + description?: string; +} + +/** + * Specifications of the Dimension of metrics. + */ +export interface MetricDimension { + /** + * Name of the dimension + */ + name?: string; + /** + * Localized friendly display name of the dimension + */ + displayName?: string; + /** + * Internal name of the dimension. + */ + internalName?: string; + /** + * To be exported to shoe box. + */ + toBeExportedForShoebox?: boolean; +} + +/** + * Details about operation related to metrics. + */ +export interface MetricSpecification { + /** + * The name of the metric. + */ + name?: string; + /** + * Localized display name of the metric. + */ + displayName?: string; + /** + * The description of the metric. + */ + displayDescription?: string; + /** + * The unit that the metric is measured in. + */ + unit?: string; + /** + * The type of metric aggregation. + */ + aggregationType?: string; + /** + * Support metric aggregation type. + */ + supportedAggregationTypes?: MetricAggregationType[]; + /** + * Type of metrics. + */ + metricClass?: string; + /** + * Dimensions of the metric + */ + dimensions?: MetricDimension[]; +} + +/** + * Specification of the all the metrics provided for a resource type. + */ +export interface ApiOperationPropertiesServiceSpecification { + /** + * Details about operations related to metrics. + */ + metricSpecifications?: MetricSpecification[]; } /** @@ -38,10 +112,22 @@ export interface ApiOperation { * The object that represents the operation. */ display?: ApiOperationDisplay; + /** + * Origin of the operation. + */ + origin?: string; + /** + * The flag that indicates whether the operation applies to data plane. + */ + isDataAction?: boolean; /** * Operation name: {provider}/{resource}/{operation} */ name?: string; + /** + * Specification of the all the metrics provided for a resource type. + */ + serviceSpecification?: ApiOperationPropertiesServiceSpecification; } /** @@ -67,6 +153,50 @@ export interface CloudErrorBody { target?: string; } +/** + * Describes the format of Error response. + */ +export interface ErrorResponse { + /** + * Error code + */ + code?: string; + /** + * Error message indicating why the operation failed. + */ + message?: string; +} + +/** + * The status of operation. + */ +export interface AscOperation { + /** + * The operation Id. + */ + id?: string; + /** + * The operation name. + */ + name?: string; + /** + * The start time of the operation. + */ + startTime?: string; + /** + * The end time of the operation. + */ + endTime?: string; + /** + * The status of the operation. + */ + status?: string; + /** + * The error detail of the operation if any. + */ + error?: ErrorResponse; +} + /** * Cache identity properties. */ @@ -87,6 +217,38 @@ export interface CacheIdentity { type?: CacheIdentityType; } +/** + * Metadata pertaining to creation and last modification of the resource. + */ +export interface SystemData { + /** + * The identity that created the resource. + */ + createdBy?: string; + /** + * The type of identity that created the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + createdByType?: CreatedByType; + /** + * The timestamp of resource creation (UTC). + */ + createdAt?: Date; + /** + * The identity that last modified the resource. + */ + lastModifiedBy?: string; + /** + * The type of identity that last modified the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + lastModifiedByType?: CreatedByType; + /** + * The type of identity that last modified the resource. + */ + lastModifiedAt?: Date; +} + /** * An indication of Cache health. Gives more information about health than just that related to * provisioning. @@ -237,6 +399,11 @@ export interface Cache extends BaseResource { * The identity of the cache, if configured. */ identity?: CacheIdentity; + /** + * The system meta data relating to this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; /** * The size of this Cache, in GB. */ @@ -349,15 +516,11 @@ export interface StorageTargetProperties { /** * Polymorphic Discriminator */ - targetBaseType: "StorageTargetProperties"; + targetType: "StorageTargetProperties"; /** * List of Cache namespace junctions to target for namespace associations. */ junctions?: NamespaceJunction[]; - /** - * Type of the Storage Target. - */ - targetType?: string; /** * ARM provisioning state, see * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. @@ -398,6 +561,16 @@ export interface StorageTargetResource extends BaseResource { * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; + /** + * Region name string. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly location?: string; + /** + * The system meta data relating to this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; } /** @@ -408,10 +581,6 @@ export interface StorageTarget extends StorageTargetResource { * List of Cache namespace junctions to target for namespace associations. */ junctions?: NamespaceJunction[]; - /** - * Type of the Storage Target. - */ - targetType?: string; /** * ARM provisioning state, see * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. @@ -434,7 +603,7 @@ export interface StorageTarget extends StorageTargetResource { /** * Polymorphic Discriminator */ - targetBaseType: string; + targetType: string; } /** @@ -444,15 +613,11 @@ export interface Nfs3TargetProperties { /** * Polymorphic Discriminator */ - targetBaseType: "nfs3"; + targetType: "nfs3"; /** * List of Cache namespace junctions to target for namespace associations. */ junctions?: NamespaceJunction[]; - /** - * Type of the Storage Target. - */ - targetType?: string; /** * ARM provisioning state, see * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. @@ -481,15 +646,11 @@ export interface ClfsTargetProperties { /** * Polymorphic Discriminator */ - targetBaseType: "clfs"; + targetType: "clfs"; /** * List of Cache namespace junctions to target for namespace associations. */ junctions?: NamespaceJunction[]; - /** - * Type of the Storage Target. - */ - targetType?: string; /** * ARM provisioning state, see * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. @@ -518,15 +679,11 @@ export interface UnknownTargetProperties { /** * Polymorphic Discriminator */ - targetBaseType: "unknown"; + targetType: "unknown"; /** * List of Cache namespace junctions to target for namespace associations. */ junctions?: NamespaceJunction[]; - /** - * Type of the Storage Target. - */ - targetType?: string; /** * ARM provisioning state, see * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. @@ -784,6 +941,15 @@ export interface StorageTargetsResult extends Array { nextLink?: string; } +/** + * Defines values for MetricAggregationType. + * Possible values include: 'NotSpecified', 'None', 'Average', 'Minimum', 'Maximum', 'Total', + * 'Count' + * @readonly + * @enum {string} + */ +export type MetricAggregationType = 'NotSpecified' | 'None' | 'Average' | 'Minimum' | 'Maximum' | 'Total' | 'Count'; + /** * Defines values for CacheIdentityType. * Possible values include: 'SystemAssigned', 'None' @@ -792,6 +958,14 @@ export interface StorageTargetsResult extends Array { */ export type CacheIdentityType = 'SystemAssigned' | 'None'; +/** + * Defines values for CreatedByType. + * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + * @readonly + * @enum {string} + */ +export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; + /** * Defines values for HealthStateType. * Possible values include: 'Unknown', 'Healthy', 'Degraded', 'Down', 'Transitioning', 'Stopping', @@ -817,14 +991,6 @@ export type ProvisioningStateType = 'Succeeded' | 'Failed' | 'Cancelled' | 'Crea */ export type FirmwareStatusType = 'available' | 'unavailable'; -/** - * Defines values for StorageTargetType. - * Possible values include: 'nfs3', 'clfs', 'unknown' - * @readonly - * @enum {string} - */ -export type StorageTargetType = 'nfs3' | 'clfs' | 'unknown'; - /** * Defines values for ReasonCode. * Possible values include: 'QuotaId', 'NotAvailableForSubscription' @@ -953,6 +1119,26 @@ export type UsageModelsListNextResponse = UsageModelsResult & { }; }; +/** + * Contains response data for the get operation. + */ +export type AscOperationsGetResponse = AscOperation & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AscOperation; + }; +}; + /** * Contains response data for the list operation. */ diff --git a/sdk/storagecache/arm-storagecache/src/models/mappers.ts b/sdk/storagecache/arm-storagecache/src/models/mappers.ts index 672eb04f432f..eebe9070a934 100644 --- a/sdk/storagecache/arm-storagecache/src/models/mappers.ts +++ b/sdk/storagecache/arm-storagecache/src/models/mappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -35,6 +35,137 @@ export const ApiOperationDisplay: msRest.CompositeMapper = { type: { name: "String" } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const MetricDimension: msRest.CompositeMapper = { + serializedName: "MetricDimension", + type: { + name: "Composite", + className: "MetricDimension", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + internalName: { + serializedName: "internalName", + type: { + name: "String" + } + }, + toBeExportedForShoebox: { + serializedName: "toBeExportedForShoebox", + type: { + name: "Boolean" + } + } + } + } +}; + +export const MetricSpecification: msRest.CompositeMapper = { + serializedName: "MetricSpecification", + type: { + name: "Composite", + className: "MetricSpecification", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + displayDescription: { + serializedName: "displayDescription", + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + aggregationType: { + serializedName: "aggregationType", + type: { + name: "String" + } + }, + supportedAggregationTypes: { + serializedName: "supportedAggregationTypes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + metricClass: { + serializedName: "metricClass", + type: { + name: "String" + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricDimension" + } + } + } + } + } + } +}; + +export const ApiOperationPropertiesServiceSpecification: msRest.CompositeMapper = { + serializedName: "ApiOperation_properties_serviceSpecification", + type: { + name: "Composite", + className: "ApiOperationPropertiesServiceSpecification", + modelProperties: { + metricSpecifications: { + serializedName: "metricSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricSpecification" + } + } + } } } } @@ -53,11 +184,30 @@ export const ApiOperation: msRest.CompositeMapper = { className: "ApiOperationDisplay" } }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, name: { serializedName: "name", type: { name: "String" } + }, + serviceSpecification: { + serializedName: "properties.serviceSpecification", + type: { + name: "Composite", + className: "ApiOperationPropertiesServiceSpecification" + } } } } @@ -103,6 +253,75 @@ export const CloudErrorBody: msRest.CompositeMapper = { } }; +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const AscOperation: msRest.CompositeMapper = { + serializedName: "AscOperation", + type: { + name: "Composite", + className: "AscOperation", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + type: { + name: "String" + } + }, + endTime: { + serializedName: "endTime", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponse" + } + } + } + } +}; + export const CacheIdentity: msRest.CompositeMapper = { serializedName: "CacheIdentity", type: { @@ -137,6 +356,52 @@ export const CacheIdentity: msRest.CompositeMapper = { } }; +export const SystemData: msRest.CompositeMapper = { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + export const CacheHealth: msRest.CompositeMapper = { serializedName: "CacheHealth", type: { @@ -373,6 +638,14 @@ export const Cache: msRest.CompositeMapper = { className: "CacheIdentity" } }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, cacheSizeGB: { serializedName: "properties.cacheSizeGB", type: { @@ -545,8 +818,8 @@ export const StorageTargetProperties: msRest.CompositeMapper = { type: { name: "Composite", polymorphicDiscriminator: { - serializedName: "targetBaseType", - clientName: "targetBaseType" + serializedName: "targetType", + clientName: "targetType" }, uberParent: "StorageTargetProperties", className: "StorageTargetProperties", @@ -563,12 +836,6 @@ export const StorageTargetProperties: msRest.CompositeMapper = { } } }, - targetType: { - serializedName: "targetType", - type: { - name: "String" - } - }, provisioningState: { serializedName: "provisioningState", type: { @@ -596,9 +863,9 @@ export const StorageTargetProperties: msRest.CompositeMapper = { className: "UnknownTarget" } }, - targetBaseType: { + targetType: { required: true, - serializedName: "targetBaseType", + serializedName: "targetType", type: { name: "String" } @@ -633,6 +900,21 @@ export const StorageTargetResource: msRest.CompositeMapper = { type: { name: "String" } + }, + location: { + readOnly: true, + serializedName: "location", + type: { + name: "String" + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } } } } @@ -657,12 +939,6 @@ export const StorageTarget: msRest.CompositeMapper = { } } }, - targetType: { - serializedName: "properties.targetType", - type: { - name: "String" - } - }, provisioningState: { serializedName: "properties.provisioningState", type: { @@ -690,9 +966,9 @@ export const StorageTarget: msRest.CompositeMapper = { className: "UnknownTarget" } }, - targetBaseType: { + targetType: { required: true, - serializedName: "properties.targetBaseType", + serializedName: "properties.targetType", type: { name: "String" } diff --git a/sdk/storagecache/arm-storagecache/src/models/operationsMappers.ts b/sdk/storagecache/arm-storagecache/src/models/operationsMappers.ts index 69e93ca3e812..61c27747da6d 100644 --- a/sdk/storagecache/arm-storagecache/src/models/operationsMappers.ts +++ b/sdk/storagecache/arm-storagecache/src/models/operationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -11,5 +11,8 @@ export { ApiOperation, ApiOperationDisplay, ApiOperationListResult, - CloudError + ApiOperationPropertiesServiceSpecification, + CloudError, + MetricDimension, + MetricSpecification } from "../models/mappers"; diff --git a/sdk/storagecache/arm-storagecache/src/models/parameters.ts b/sdk/storagecache/arm-storagecache/src/models/parameters.ts index dd3394f6db81..f59cdb795e2c 100644 --- a/sdk/storagecache/arm-storagecache/src/models/parameters.ts +++ b/sdk/storagecache/arm-storagecache/src/models/parameters.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -43,6 +42,16 @@ export const cacheName: msRest.OperationURLParameter = { } } }; +export const location: msRest.OperationURLParameter = { + parameterPath: "location", + mapper: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } +}; export const nextPageLink: msRest.OperationURLParameter = { parameterPath: "nextPageLink", mapper: { @@ -54,6 +63,16 @@ export const nextPageLink: msRest.OperationURLParameter = { }, skipEncoding: true }; +export const operationId: msRest.OperationURLParameter = { + parameterPath: "operationId", + mapper: { + required: true, + serializedName: "operationId", + type: { + name: "String" + } + } +}; export const resourceGroupName: msRest.OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { diff --git a/sdk/storagecache/arm-storagecache/src/models/skusMappers.ts b/sdk/storagecache/arm-storagecache/src/models/skusMappers.ts index 25ba85daa733..bfe35722d81e 100644 --- a/sdk/storagecache/arm-storagecache/src/models/skusMappers.ts +++ b/sdk/storagecache/arm-storagecache/src/models/skusMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/storagecache/arm-storagecache/src/models/storageTargetsMappers.ts b/sdk/storagecache/arm-storagecache/src/models/storageTargetsMappers.ts index f7f8b3402e86..8d64485ce935 100644 --- a/sdk/storagecache/arm-storagecache/src/models/storageTargetsMappers.ts +++ b/sdk/storagecache/arm-storagecache/src/models/storageTargetsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -26,5 +26,6 @@ export { StorageTarget, StorageTargetResource, StorageTargetsResult, + SystemData, UnknownTarget } from "../models/mappers"; diff --git a/sdk/storagecache/arm-storagecache/src/models/usageModelsMappers.ts b/sdk/storagecache/arm-storagecache/src/models/usageModelsMappers.ts index 5fed08aa0dc5..f1668446ae6b 100644 --- a/sdk/storagecache/arm-storagecache/src/models/usageModelsMappers.ts +++ b/sdk/storagecache/arm-storagecache/src/models/usageModelsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/storagecache/arm-storagecache/src/operations/ascOperations.ts b/sdk/storagecache/arm-storagecache/src/operations/ascOperations.ts new file mode 100644 index 000000000000..3c12a8783b55 --- /dev/null +++ b/sdk/storagecache/arm-storagecache/src/operations/ascOperations.ts @@ -0,0 +1,86 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/ascOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { StorageCacheManagementClientContext } from "../storageCacheManagementClientContext"; + +/** Class representing a AscOperations. */ +export class AscOperations { + private readonly client: StorageCacheManagementClientContext; + + /** + * Create a AscOperations. + * @param {StorageCacheManagementClientContext} client Reference to the service client. + */ + constructor(client: StorageCacheManagementClientContext) { + this.client = client; + } + + /** + * Gets the status of an asynchronous operation for the Azure HPC cache + * @param location The region name which the operation will lookup into. + * @param operationId The operation id which uniquely identifies the asynchronous operation. + * @param [options] The optional parameters + * @returns Promise + */ + get(location: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param location The region name which the operation will lookup into. + * @param operationId The operation id which uniquely identifies the asynchronous operation. + * @param callback The callback + */ + get(location: string, operationId: string, callback: msRest.ServiceCallback): void; + /** + * @param location The region name which the operation will lookup into. + * @param operationId The operation id which uniquely identifies the asynchronous operation. + * @param options The optional parameters + * @param callback The callback + */ + get(location: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(location: string, operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + location, + operationId, + options + }, + getOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/locations/{location}/ascOperations/{operationId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.location, + Parameters.operationId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AscOperation + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/storagecache/arm-storagecache/src/operations/caches.ts b/sdk/storagecache/arm-storagecache/src/operations/caches.ts index e296ec434609..57d9229d235f 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/caches.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/caches.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -582,6 +581,9 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.Cache }, + 202: { + bodyMapper: Mappers.Cache + }, default: { bodyMapper: Mappers.CloudError } @@ -780,6 +782,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -801,6 +806,9 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/storagecache/arm-storagecache/src/operations/index.ts b/sdk/storagecache/arm-storagecache/src/operations/index.ts index 461ea1b1d1b5..e855b3e0869e 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/index.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/index.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -11,5 +10,6 @@ export * from "./operations"; export * from "./skus"; export * from "./usageModels"; +export * from "./ascOperations"; export * from "./caches"; export * from "./storageTargets"; diff --git a/sdk/storagecache/arm-storagecache/src/operations/operations.ts b/sdk/storagecache/arm-storagecache/src/operations/operations.ts index d930c78bb3a9..5310858388ae 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/operations.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/operations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -108,6 +107,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/storagecache/arm-storagecache/src/operations/skus.ts b/sdk/storagecache/arm-storagecache/src/operations/skus.ts index 583f12cce083..1a932a055c28 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/skus.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/skus.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -111,6 +110,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/storagecache/arm-storagecache/src/operations/storageTargets.ts b/sdk/storagecache/arm-storagecache/src/operations/storageTargets.ts index a29771da8d90..d66719cde985 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/storageTargets.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/storageTargets.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -344,6 +343,9 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.StorageTarget }, + 202: { + bodyMapper: Mappers.StorageTarget + }, default: { bodyMapper: Mappers.CloudError } @@ -358,6 +360,9 @@ const listByCacheNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/storagecache/arm-storagecache/src/operations/usageModels.ts b/sdk/storagecache/arm-storagecache/src/operations/usageModels.ts index e5d55b99d6f6..17029293a4bd 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/usageModels.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/usageModels.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -111,6 +110,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts b/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts index 6380df6d5691..cb15178503bf 100644 --- a/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts +++ b/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -20,6 +19,7 @@ class StorageCacheManagementClient extends StorageCacheManagementClientContext { operations: operations.Operations; skus: operations.Skus; usageModels: operations.UsageModels; + ascOperations: operations.AscOperations; caches: operations.Caches; storageTargets: operations.StorageTargets; @@ -35,6 +35,7 @@ class StorageCacheManagementClient extends StorageCacheManagementClientContext { this.operations = new operations.Operations(this); this.skus = new operations.Skus(this); this.usageModels = new operations.UsageModels(this); + this.ascOperations = new operations.AscOperations(this); this.caches = new operations.Caches(this); this.storageTargets = new operations.StorageTargets(this); } diff --git a/sdk/storagecache/arm-storagecache/src/storageCacheManagementClientContext.ts b/sdk/storagecache/arm-storagecache/src/storageCacheManagementClientContext.ts index 366823e7d24a..e3df764025eb 100644 --- a/sdk/storagecache/arm-storagecache/src/storageCacheManagementClientContext.ts +++ b/sdk/storagecache/arm-storagecache/src/storageCacheManagementClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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