diff --git a/sdk/storagecache/arm-storagecache/CHANGELOG.md b/sdk/storagecache/arm-storagecache/CHANGELOG.md index 108ab27582dd..dad5fb84c340 100644 --- a/sdk/storagecache/arm-storagecache/CHANGELOG.md +++ b/sdk/storagecache/arm-storagecache/CHANGELOG.md @@ -1,5 +1,24 @@ # Release History +## 5.1.0 (2022-03-10) + +**Features** + + - Added operation group AscUsages + - Added operation StorageTargetOperations.beginInvalidate + - Added operation StorageTargetOperations.beginInvalidateAndWait + - Added Interface AscUsagesListNextOptionalParams + - Added Interface AscUsagesListOptionalParams + - Added Interface ResourceUsage + - Added Interface ResourceUsageName + - Added Interface ResourceUsagesListResult + - Added Interface StorageTargetInvalidateOptionalParams + - Added Type Alias AscUsagesListNextResponse + - Added Type Alias AscUsagesListResponse + - Interface Cache_2 has a new optional parameter zones + - Class StorageCacheManagementClient has a new parameter ascUsages + + ## 5.0.0 (2022-01-21) The package of @azure/arm-storagecache is using our next generation design principles since version 5.0.0, which contains breaking changes. diff --git a/sdk/storagecache/arm-storagecache/_meta.json b/sdk/storagecache/arm-storagecache/_meta.json index 79f661492560..e6a42ee4a08f 100644 --- a/sdk/storagecache/arm-storagecache/_meta.json +++ b/sdk/storagecache/arm-storagecache/_meta.json @@ -1,7 +1,8 @@ { - "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", + "commit": "7c2b7fac26af92ebe41cc7a437b52e64d8b93448", "readme": "specification/storagecache/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/storagecache/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1 --generate-sample=true", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/storagecache/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20220114.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.1.1", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/storagecache/arm-storagecache/api-extractor.json b/sdk/storagecache/arm-storagecache/api-extractor.json index a11923871dda..a3b96b9bb088 100644 --- a/sdk/storagecache/arm-storagecache/api-extractor.json +++ b/sdk/storagecache/arm-storagecache/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-storagecache.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/storagecache/arm-storagecache/package.json b/sdk/storagecache/arm-storagecache/package.json index 8d71d22ea862..17dd42e1765e 100644 --- a/sdk/storagecache/arm-storagecache/package.json +++ b/sdk/storagecache/arm-storagecache/package.json @@ -3,8 +3,10 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for StorageCacheManagementClient.", - "version": "5.0.0", - "engines": { "node": ">=12.0.0" }, + "version": "5.1.0", + "engines": { + "node": ">=12.0.0" + }, "dependencies": { "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", @@ -14,7 +16,13 @@ "@azure/core-rest-pipeline": "^1.1.0", "tslib": "^2.2.0" }, - "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], "license": "MIT", "main": "./dist/index.js", "module": "./dist-esm/src/index.js", @@ -41,7 +49,9 @@ "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, "files": [ "dist/**/*.js", "dist/**/*.js.map", @@ -88,19 +98,5 @@ "docs": "echo skipped" }, "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/StorageCacheManagementClient.ts", - "prefix": "packageDetails" - } - ] - }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": ["azure"], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-storagecache?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/storagecache/arm-storagecache/review/arm-storagecache.api.md b/sdk/storagecache/arm-storagecache/review/arm-storagecache.api.md index 9a67a8583646..efb2f0bd17f0 100644 --- a/sdk/storagecache/arm-storagecache/review/arm-storagecache.api.md +++ b/sdk/storagecache/arm-storagecache/review/arm-storagecache.api.md @@ -63,6 +63,25 @@ export interface AscOperationsGetOptionalParams extends coreClient.OperationOpti // @public export type AscOperationsGetResponse = AscOperation; +// @public +export interface AscUsages { + list(location: string, options?: AscUsagesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AscUsagesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AscUsagesListNextResponse = ResourceUsagesListResult; + +// @public +export interface AscUsagesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AscUsagesListResponse = ResourceUsagesListResult; + // @public export interface BlobNfsTarget { target?: string; @@ -91,6 +110,7 @@ interface Cache_2 { }; readonly type?: string; readonly upgradeStatus?: CacheUpgradeStatus; + zones?: string[]; } export { Cache_2 as Cache } @@ -640,6 +660,26 @@ export interface ResourceSkusResult { readonly value?: ResourceSku[]; } +// @public +export interface ResourceUsage { + readonly currentValue?: number; + readonly limit?: number; + readonly name?: ResourceUsageName; + readonly unit?: string; +} + +// @public +export interface ResourceUsageName { + localizedValue?: string; + value?: string; +} + +// @public +export interface ResourceUsagesListResult { + readonly nextLink?: string; + readonly value?: ResourceUsage[]; +} + // @public export interface Restriction { reasonCode?: ReasonCode; @@ -676,6 +716,8 @@ export class StorageCacheManagementClient extends coreClient.ServiceClient { // (undocumented) ascOperations: AscOperations; // (undocumented) + ascUsages: AscUsages; + // (undocumented) caches: Caches; // (undocumented) operations: Operations; @@ -716,10 +758,18 @@ export interface StorageTargetFlushOptionalParams extends coreClient.OperationOp updateIntervalInMs?: number; } +// @public +export interface StorageTargetInvalidateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + // @public export interface StorageTargetOperations { beginFlush(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: StorageTargetFlushOptionalParams): Promise, void>>; beginFlushAndWait(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: StorageTargetFlushOptionalParams): Promise; + beginInvalidate(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: StorageTargetInvalidateOptionalParams): Promise, void>>; + beginInvalidateAndWait(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: StorageTargetInvalidateOptionalParams): Promise; beginResume(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: StorageTargetResumeOptionalParams): Promise, void>>; beginResumeAndWait(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: StorageTargetResumeOptionalParams): Promise; beginSuspend(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: StorageTargetSuspendOptionalParams): Promise, void>>; diff --git a/sdk/storagecache/arm-storagecache/src/models/index.ts b/sdk/storagecache/arm-storagecache/src/models/index.ts index 786f92054972..0fcdc874b8d5 100644 --- a/sdk/storagecache/arm-storagecache/src/models/index.ts +++ b/sdk/storagecache/arm-storagecache/src/models/index.ts @@ -213,6 +213,52 @@ export interface ErrorResponse { message?: string; } +/** Result of the request to list resource usages. It contains a list of resource usages & limits and a URL link to get the next set of results. */ +export interface ResourceUsagesListResult { + /** + * URL to get the next set of resource usage list results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; + /** + * List of usages and limits for resources controlled by the Microsoft.StorageCache resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: ResourceUsage[]; +} + +/** The usage and limit (quota) for a resource. */ +export interface ResourceUsage { + /** + * The limit (quota) for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly limit?: number; + /** + * Unit that the limit and usages are expressed in, such as 'Count'. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly unit?: string; + /** + * The current usage of this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly currentValue?: number; + /** + * Naming information for this resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: ResourceUsageName; +} + +/** Naming information for this resource type. */ +export interface ResourceUsageName { + /** Canonical name for this resource type. */ + value?: string; + /** Localized name for this resource type. */ + localizedValue?: string; +} + /** Result of the request to list Caches. It contains a list of Caches and a URL link to get the next set of results. */ export interface CachesListResult { /** URL to get the next set of Cache list results, if there are any. */ @@ -283,6 +329,8 @@ export interface Cache { securitySettings?: CacheSecuritySettings; /** Specifies Directory Services settings of the cache. */ directoryServicesSettings?: CacheDirectorySettings; + /** Availability zones for resources. This field should only contain a single element in the array. */ + zones?: string[]; } /** Cache identity properties. */ @@ -963,6 +1011,20 @@ export interface AscOperationsGetOptionalParams /** Contains response data for the get operation. */ export type AscOperationsGetResponse = AscOperation; +/** Optional parameters. */ +export interface AscUsagesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type AscUsagesListResponse = ResourceUsagesListResult; + +/** Optional parameters. */ +export interface AscUsagesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type AscUsagesListNextResponse = ResourceUsagesListResult; + /** Optional parameters. */ export interface CachesListOptionalParams extends coreClient.OperationOptions {} @@ -1153,6 +1215,15 @@ export interface StorageTargetResumeOptionalParams resumeFrom?: string; } +/** Optional parameters. */ +export interface StorageTargetInvalidateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + /** Optional parameters. */ export interface StorageCacheManagementClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/storagecache/arm-storagecache/src/models/mappers.ts b/sdk/storagecache/arm-storagecache/src/models/mappers.ts index c2e91f63c472..15ad4994eef8 100644 --- a/sdk/storagecache/arm-storagecache/src/models/mappers.ts +++ b/sdk/storagecache/arm-storagecache/src/models/mappers.ts @@ -611,6 +611,99 @@ export const ErrorResponse: coreClient.CompositeMapper = { } }; +export const ResourceUsagesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceUsagesListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceUsage" + } + } + } + } + } + } +}; + +export const ResourceUsage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceUsage", + modelProperties: { + limit: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "limit", + readOnly: true, + type: { + name: "Number" + } + }, + unit: { + serializedName: "unit", + readOnly: true, + type: { + name: "String" + } + }, + currentValue: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "currentValue", + readOnly: true, + type: { + name: "Number" + } + }, + name: { + serializedName: "name", + type: { + name: "Composite", + className: "ResourceUsageName" + } + } + } + } +}; + +export const ResourceUsageName: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceUsageName", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "String" + } + }, + localizedValue: { + serializedName: "localizedValue", + type: { + name: "String" + } + } + } + } +}; + export const CachesListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -773,6 +866,17 @@ export const Cache: coreClient.CompositeMapper = { name: "Composite", className: "CacheDirectorySettings" } + }, + zones: { + serializedName: "properties.zones", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } diff --git a/sdk/storagecache/arm-storagecache/src/models/parameters.ts b/sdk/storagecache/arm-storagecache/src/models/parameters.ts index a56894dd8ca0..4754e14e32fc 100644 --- a/sdk/storagecache/arm-storagecache/src/models/parameters.ts +++ b/sdk/storagecache/arm-storagecache/src/models/parameters.ts @@ -43,7 +43,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-09-01", + defaultValue: "2022-01-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/storagecache/arm-storagecache/src/operations/ascUsages.ts b/sdk/storagecache/arm-storagecache/src/operations/ascUsages.ts new file mode 100644 index 000000000000..b3be708d71f6 --- /dev/null +++ b/sdk/storagecache/arm-storagecache/src/operations/ascUsages.ts @@ -0,0 +1,158 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AscUsages } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { StorageCacheManagementClient } from "../storageCacheManagementClient"; +import { + ResourceUsage, + AscUsagesListNextOptionalParams, + AscUsagesListOptionalParams, + AscUsagesListResponse, + AscUsagesListNextResponse +} from "../models"; + +/// +/** Class containing AscUsages operations. */ +export class AscUsagesImpl implements AscUsages { + private readonly client: StorageCacheManagementClient; + + /** + * Initialize a new instance of the class AscUsages class. + * @param client Reference to the service client + */ + constructor(client: StorageCacheManagementClient) { + this.client = client; + } + + /** + * Gets the quantity used and quota limit for resources + * @param location The name of the region to query for usage information. + * @param options The options parameters. + */ + public list( + location: string, + options?: AscUsagesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(location, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(location, options); + } + }; + } + + private async *listPagingPage( + location: string, + options?: AscUsagesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(location, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(location, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + location: string, + options?: AscUsagesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(location, options)) { + yield* page; + } + } + + /** + * Gets the quantity used and quota limit for resources + * @param location The name of the region to query for usage information. + * @param options The options parameters. + */ + private _list( + location: string, + options?: AscUsagesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param location The name of the region to query for usage information. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + location: string, + nextLink: string, + options?: AscUsagesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/locations/{location}/usages", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourceUsagesListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourceUsagesListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.location + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/storagecache/arm-storagecache/src/operations/index.ts b/sdk/storagecache/arm-storagecache/src/operations/index.ts index b254cecd4236..cf99b666ad1e 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/index.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/index.ts @@ -10,6 +10,7 @@ export * from "./operations"; export * from "./skus"; export * from "./usageModels"; export * from "./ascOperations"; +export * from "./ascUsages"; export * from "./caches"; export * from "./storageTargets"; export * from "./storageTargetOperations"; diff --git a/sdk/storagecache/arm-storagecache/src/operations/storageTargetOperations.ts b/sdk/storagecache/arm-storagecache/src/operations/storageTargetOperations.ts index 2e9efd27c3d5..a2bd1f3e72ff 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/storageTargetOperations.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/storageTargetOperations.ts @@ -16,7 +16,8 @@ import { LroImpl } from "../lroImpl"; import { StorageTargetFlushOptionalParams, StorageTargetSuspendOptionalParams, - StorageTargetResumeOptionalParams + StorageTargetResumeOptionalParams, + StorageTargetInvalidateOptionalParams } from "../models"; /** Class containing StorageTargetOperations operations. */ @@ -296,6 +297,96 @@ export class StorageTargetOperationsImpl implements StorageTargetOperations { ); return poller.pollUntilDone(); } + + /** + * Invalidate all cached data for a storage target. Cached files are discarded and fetched from the + * back end on the next request. + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from + * the [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage Target. + * @param options The options parameters. + */ + async beginInvalidate( + resourceGroupName: string, + cacheName: string, + storageTargetName: string, + options?: StorageTargetInvalidateOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, cacheName, storageTargetName, options }, + invalidateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Invalidate all cached data for a storage target. Cached files are discarded and fetched from the + * back end on the next request. + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from + * the [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage Target. + * @param options The options parameters. + */ + async beginInvalidateAndWait( + resourceGroupName: string, + cacheName: string, + storageTargetName: string, + options?: StorageTargetInvalidateOptionalParams + ): Promise { + const poller = await this.beginInvalidate( + resourceGroupName, + cacheName, + storageTargetName, + options + ); + return poller.pollUntilDone(); + } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); @@ -372,3 +463,27 @@ const resumeOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const invalidateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}/invalidate", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cacheName, + Parameters.storageTargetName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/ascUsages.ts b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/ascUsages.ts new file mode 100644 index 000000000000..96e9c74d9668 --- /dev/null +++ b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/ascUsages.ts @@ -0,0 +1,24 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ResourceUsage, AscUsagesListOptionalParams } from "../models"; + +/// +/** Interface representing a AscUsages. */ +export interface AscUsages { + /** + * Gets the quantity used and quota limit for resources + * @param location The name of the region to query for usage information. + * @param options The options parameters. + */ + list( + location: string, + options?: AscUsagesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/index.ts b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/index.ts index b254cecd4236..cf99b666ad1e 100644 --- a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/index.ts +++ b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/index.ts @@ -10,6 +10,7 @@ export * from "./operations"; export * from "./skus"; export * from "./usageModels"; export * from "./ascOperations"; +export * from "./ascUsages"; export * from "./caches"; export * from "./storageTargets"; export * from "./storageTargetOperations"; diff --git a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/storageTargetOperations.ts b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/storageTargetOperations.ts index df99bf74a0c9..051b2c455f09 100644 --- a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/storageTargetOperations.ts +++ b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/storageTargetOperations.ts @@ -10,7 +10,8 @@ import { PollerLike, PollOperationState } from "@azure/core-lro"; import { StorageTargetFlushOptionalParams, StorageTargetSuspendOptionalParams, - StorageTargetResumeOptionalParams + StorageTargetResumeOptionalParams, + StorageTargetInvalidateOptionalParams } from "../models"; /** Interface representing a StorageTargetOperations. */ @@ -101,4 +102,34 @@ export interface StorageTargetOperations { storageTargetName: string, options?: StorageTargetResumeOptionalParams ): Promise; + /** + * Invalidate all cached data for a storage target. Cached files are discarded and fetched from the + * back end on the next request. + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from + * the [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage Target. + * @param options The options parameters. + */ + beginInvalidate( + resourceGroupName: string, + cacheName: string, + storageTargetName: string, + options?: StorageTargetInvalidateOptionalParams + ): Promise, void>>; + /** + * Invalidate all cached data for a storage target. Cached files are discarded and fetched from the + * back end on the next request. + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from + * the [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage Target. + * @param options The options parameters. + */ + beginInvalidateAndWait( + resourceGroupName: string, + cacheName: string, + storageTargetName: string, + options?: StorageTargetInvalidateOptionalParams + ): Promise; } diff --git a/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts b/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts index 6b15255992f5..d339bbedb26f 100644 --- a/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts +++ b/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts @@ -13,6 +13,7 @@ import { SkusImpl, UsageModelsImpl, AscOperationsImpl, + AscUsagesImpl, CachesImpl, StorageTargetsImpl, StorageTargetOperationsImpl @@ -22,6 +23,7 @@ import { Skus, UsageModels, AscOperations, + AscUsages, Caches, StorageTargets, StorageTargetOperations @@ -61,7 +63,7 @@ export class StorageCacheManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-storagecache/5.0.0`; + const packageDetails = `azsdk-js-arm-storagecache/5.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -84,11 +86,12 @@ export class StorageCacheManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-09-01"; + this.apiVersion = options.apiVersion || "2022-01-01"; this.operations = new OperationsImpl(this); this.skus = new SkusImpl(this); this.usageModels = new UsageModelsImpl(this); this.ascOperations = new AscOperationsImpl(this); + this.ascUsages = new AscUsagesImpl(this); this.caches = new CachesImpl(this); this.storageTargets = new StorageTargetsImpl(this); this.storageTargetOperations = new StorageTargetOperationsImpl(this); @@ -98,6 +101,7 @@ export class StorageCacheManagementClient extends coreClient.ServiceClient { skus: Skus; usageModels: UsageModels; ascOperations: AscOperations; + ascUsages: AscUsages; caches: Caches; storageTargets: StorageTargets; storageTargetOperations: StorageTargetOperations; diff --git a/sdk/storagecache/arm-storagecache/tsconfig.json b/sdk/storagecache/arm-storagecache/tsconfig.json index c2eb8c5f77ff..3e6ae96443f3 100644 --- a/sdk/storagecache/arm-storagecache/tsconfig.json +++ b/sdk/storagecache/arm-storagecache/tsconfig.json @@ -9,12 +9,19 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { "@azure/arm-storagecache": ["./src/index"] } + "importHelpers": true }, - "include": ["./src/**/*.ts", "./test/**/*.ts", "samples-dev/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/storagecache/ci.mgmt.yml b/sdk/storagecache/ci.mgmt.yml index f1e6732f9176..aebc818d8fd5 100644 --- a/sdk/storagecache/ci.mgmt.yml +++ b/sdk/storagecache/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -10,6 +10,7 @@ trigger: include: - sdk/storagecache/ci.mgmt.yml - sdk/storagecache/arm-storagecache/ + - sdk/storagecache/arm-storagecache pr: branches: include: @@ -23,11 +24,11 @@ pr: include: - sdk/storagecache/ci.mgmt.yml - sdk/storagecache/arm-storagecache/ - + - sdk/storagecache/arm-storagecache extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: storagecache Artifacts: - name: azure-arm-storagecache - safeName: azurearmstoragecache \ No newline at end of file + safeName: azurearmstoragecache