From 9d0c3ab0e4eff9c2351d38d92b88b578cc29de16 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 10 May 2021 10:14:31 +0000 Subject: [PATCH] CodeGen from PR 13814 in Azure/azure-rest-api-specs Merge d72c9fff3ad979a09f78709e449ce251710fee4e into a9bba35673e7a6e9d3f9331f9e8856830a071d3b --- .../src/azureNetAppFilesManagementClient.ts | 6 +- ...azureNetAppFilesManagementClientContext.ts | 8 +- .../arm-netapp/src/models/backupsMappers.ts | 1 + sdk/netapp/arm-netapp/src/models/index.ts | 126 ++++++++++-------- sdk/netapp/arm-netapp/src/models/mappers.ts | 21 +++ .../arm-netapp/src/models/parameters.ts | 2 +- .../src/models/volumeBackupStatusMappers.ts | 12 -- .../src/operations/accountBackups.ts | 6 +- .../src/operations/backupPolicies.ts | 73 +++++----- .../arm-netapp/src/operations/backups.ts | 104 +++++++++++---- sdk/netapp/arm-netapp/src/operations/index.ts | 3 +- .../src/operations/volumeBackupStatus.ts | 97 -------------- 12 files changed, 218 insertions(+), 241 deletions(-) delete mode 100644 sdk/netapp/arm-netapp/src/models/volumeBackupStatusMappers.ts delete mode 100644 sdk/netapp/arm-netapp/src/operations/volumeBackupStatus.ts diff --git a/sdk/netapp/arm-netapp/src/azureNetAppFilesManagementClient.ts b/sdk/netapp/arm-netapp/src/azureNetAppFilesManagementClient.ts index df1278d47200..3ef6dd954b72 100644 --- a/sdk/netapp/arm-netapp/src/azureNetAppFilesManagementClient.ts +++ b/sdk/netapp/arm-netapp/src/azureNetAppFilesManagementClient.ts @@ -23,9 +23,8 @@ class AzureNetAppFilesManagementClient extends AzureNetAppFilesManagementClientC volumes: operations.Volumes; snapshots: operations.Snapshots; snapshotPolicies: operations.SnapshotPolicies; - volumeBackupStatus: operations.VolumeBackupStatus; - accountBackups: operations.AccountBackups; backups: operations.Backups; + accountBackups: operations.AccountBackups; backupPolicies: operations.BackupPolicies; vaults: operations.Vaults; @@ -45,9 +44,8 @@ class AzureNetAppFilesManagementClient extends AzureNetAppFilesManagementClientC this.volumes = new operations.Volumes(this); this.snapshots = new operations.Snapshots(this); this.snapshotPolicies = new operations.SnapshotPolicies(this); - this.volumeBackupStatus = new operations.VolumeBackupStatus(this); - this.accountBackups = new operations.AccountBackups(this); this.backups = new operations.Backups(this); + this.accountBackups = new operations.AccountBackups(this); this.backupPolicies = new operations.BackupPolicies(this); this.vaults = new operations.Vaults(this); } diff --git a/sdk/netapp/arm-netapp/src/azureNetAppFilesManagementClientContext.ts b/sdk/netapp/arm-netapp/src/azureNetAppFilesManagementClientContext.ts index 88482c4f75bd..f31bbfe867da 100644 --- a/sdk/netapp/arm-netapp/src/azureNetAppFilesManagementClientContext.ts +++ b/sdk/netapp/arm-netapp/src/azureNetAppFilesManagementClientContext.ts @@ -37,14 +37,14 @@ export class AzureNetAppFilesManagementClientContext extends msRestAzure.AzureSe if (!options) { options = {}; } - if (!options.userAgent) { + if(!options.userAgent) { const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; } super(credentials, options); - this.apiVersion = '2020-12-01'; + this.apiVersion = '2021-02-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; @@ -52,10 +52,10 @@ export class AzureNetAppFilesManagementClientContext extends msRestAzure.AzureSe this.credentials = credentials; this.subscriptionId = subscriptionId; - if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; } } diff --git a/sdk/netapp/arm-netapp/src/models/backupsMappers.ts b/sdk/netapp/arm-netapp/src/models/backupsMappers.ts index de742c81ab8d..91a943e21f2c 100644 --- a/sdk/netapp/arm-netapp/src/models/backupsMappers.ts +++ b/sdk/netapp/arm-netapp/src/models/backupsMappers.ts @@ -15,6 +15,7 @@ export { BackupPolicyDetails, BackupPolicyPatch, BackupsList, + BackupStatus, BaseResource, CapacityPool, CapacityPoolPatch, diff --git a/sdk/netapp/arm-netapp/src/models/index.ts b/sdk/netapp/arm-netapp/src/models/index.ts index 223629296175..7de4259da576 100644 --- a/sdk/netapp/arm-netapp/src/models/index.ts +++ b/sdk/netapp/arm-netapp/src/models/index.ts @@ -750,7 +750,7 @@ export interface Volume extends BaseResource { */ exportPolicy?: VolumePropertiesExportPolicy; /** - * protocolTypes. Set of protocol types, default NFSv3, CIFS fro SMB protocol + * protocolTypes. Set of protocol types, default NFSv3, CIFS for SMB protocol */ protocolTypes?: string[]; /** @@ -834,7 +834,7 @@ export interface Volume extends BaseResource { } /** - * An interface representing ResourceIdentity. + * Identity for the resource. */ export interface ResourceIdentity { /** @@ -899,6 +899,10 @@ export interface VolumePatchPropertiesDataProtection { * Backup. Backup Properties */ backup?: VolumeBackupProperties; + /** + * Snapshot. Snapshot properties. + */ + snapshot?: VolumeSnapshotProperties; } /** @@ -1395,10 +1399,10 @@ export interface Backup extends BaseResource { */ label?: string; /** - * Type of backup adhoc or scheduled + * backupType. Type of backup Manual or Scheduled. Possible values include: 'Manual', 'Scheduled' * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly backupType?: string; + readonly backupType?: BackupType; /** * Failure reason * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -1409,6 +1413,11 @@ export interface Backup extends BaseResource { * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly volumeName?: string; + /** + * Manual backup an already existing snapshot. This will always be false for scheduled backups + * and true/false for manual backups. Default value: false. + */ + useExistingSnapshot?: boolean; } /** @@ -1444,10 +1453,10 @@ export interface BackupPatch extends BaseResource { */ label?: string; /** - * Type of backup adhoc or scheduled + * backupType. Type of backup Manual or Scheduled. Possible values include: 'Manual', 'Scheduled' * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly backupType?: string; + readonly backupType?: BackupType; /** * Failure reason * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -1458,6 +1467,11 @@ export interface BackupPatch extends BaseResource { * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly volumeName?: string; + /** + * Manual backup an already existing snapshot. This will always be false for scheduled backups + * and true/false for manual backups. Default value: false. + */ + useExistingSnapshot?: boolean; } /** @@ -1801,38 +1815,14 @@ export interface VolumesBeginAuthorizeReplicationOptionalParams extends msRest.R remoteVolumeResourceId?: string; } -/** - * Optional Parameters. - */ -export interface BackupsCreateOptionalParams extends msRest.RequestOptionsBase { - /** - * Label for backup - */ - label?: string; -} - /** * Optional Parameters. */ export interface BackupsUpdateOptionalParams extends msRest.RequestOptionsBase { /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; - /** - * Label for backup - */ - label?: string; -} - -/** - * Optional Parameters. - */ -export interface BackupsBeginCreateOptionalParams extends msRest.RequestOptionsBase { - /** - * Label for backup + * Backup object supplied in the body of the operation. */ - label?: string; + body?: BackupPatch; } /** @@ -1840,13 +1830,9 @@ export interface BackupsBeginCreateOptionalParams extends msRest.RequestOptionsB */ export interface BackupsBeginUpdateOptionalParams extends msRest.RequestOptionsBase { /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; - /** - * Label for backup + * Backup object supplied in the body of the operation. */ - label?: string; + body?: BackupPatch; } /** @@ -2043,6 +2029,14 @@ export type RelationshipStatus = 'Idle' | 'Transferring'; */ export type MirrorState = 'Uninitialized' | 'Mirrored' | 'Broken'; +/** + * Defines values for BackupType. + * Possible values include: 'Manual', 'Scheduled' + * @readonly + * @enum {string} + */ +export type BackupType = 'Manual' | 'Scheduled'; + /** * Contains response data for the list operation. */ @@ -2804,9 +2798,9 @@ export type SnapshotPoliciesBeginUpdateResponse = SnapshotPolicy & { }; /** - * Contains response data for the get operation. + * Contains response data for the getStatus operation. */ -export type VolumeBackupStatusGetResponse = BackupStatus & { +export type BackupsGetStatusResponse = BackupStatus & { /** * The underlying HTTP response. */ @@ -2826,7 +2820,7 @@ export type VolumeBackupStatusGetResponse = BackupStatus & { /** * Contains response data for the list operation. */ -export type AccountBackupsListResponse = BackupsList & { +export type BackupsListResponse = BackupsList & { /** * The underlying HTTP response. */ @@ -2846,7 +2840,7 @@ export type AccountBackupsListResponse = BackupsList & { /** * Contains response data for the get operation. */ -export type AccountBackupsGetResponse = Backup & { +export type BackupsGetResponse = Backup & { /** * The underlying HTTP response. */ @@ -2864,9 +2858,9 @@ export type AccountBackupsGetResponse = Backup & { }; /** - * Contains response data for the list operation. + * Contains response data for the create operation. */ -export type BackupsListResponse = BackupsList & { +export type BackupsCreateResponse = Backup & { /** * The underlying HTTP response. */ @@ -2879,14 +2873,14 @@ export type BackupsListResponse = BackupsList & { /** * The response body as parsed JSON or XML */ - parsedBody: BackupsList; + parsedBody: Backup; }; }; /** - * Contains response data for the get operation. + * Contains response data for the update operation. */ -export type BackupsGetResponse = Backup & { +export type BackupsUpdateResponse = Backup & { /** * The underlying HTTP response. */ @@ -2904,9 +2898,9 @@ export type BackupsGetResponse = Backup & { }; /** - * Contains response data for the create operation. + * Contains response data for the beginCreate operation. */ -export type BackupsCreateResponse = Backup & { +export type BackupsBeginCreateResponse = Backup & { /** * The underlying HTTP response. */ @@ -2924,9 +2918,9 @@ export type BackupsCreateResponse = Backup & { }; /** - * Contains response data for the update operation. + * Contains response data for the beginUpdate operation. */ -export type BackupsUpdateResponse = Backup & { +export type BackupsBeginUpdateResponse = Backup & { /** * The underlying HTTP response. */ @@ -2944,9 +2938,9 @@ export type BackupsUpdateResponse = Backup & { }; /** - * Contains response data for the beginCreate operation. + * Contains response data for the list operation. */ -export type BackupsBeginCreateResponse = Backup & { +export type AccountBackupsListResponse = BackupsList & { /** * The underlying HTTP response. */ @@ -2959,14 +2953,14 @@ export type BackupsBeginCreateResponse = Backup & { /** * The response body as parsed JSON or XML */ - parsedBody: Backup; + parsedBody: BackupsList; }; }; /** - * Contains response data for the beginUpdate operation. + * Contains response data for the get operation. */ -export type BackupsBeginUpdateResponse = Backup & { +export type AccountBackupsGetResponse = Backup & { /** * The underlying HTTP response. */ @@ -3083,6 +3077,26 @@ export type BackupPoliciesBeginCreateResponse = BackupPolicy & { }; }; +/** + * Contains response data for the beginUpdate operation. + */ +export type BackupPoliciesBeginUpdateResponse = BackupPolicy & { + /** + * 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: BackupPolicy; + }; +}; + /** * Contains response data for the list operation. */ diff --git a/sdk/netapp/arm-netapp/src/models/mappers.ts b/sdk/netapp/arm-netapp/src/models/mappers.ts index d74465cf0154..39abaa866cbe 100644 --- a/sdk/netapp/arm-netapp/src/models/mappers.ts +++ b/sdk/netapp/arm-netapp/src/models/mappers.ts @@ -1473,6 +1473,13 @@ export const VolumePatchPropertiesDataProtection: msRest.CompositeMapper = { name: "Composite", className: "VolumeBackupProperties" } + }, + snapshot: { + serializedName: "snapshot", + type: { + name: "Composite", + className: "VolumeSnapshotProperties" + } } } } @@ -2307,6 +2314,13 @@ export const Backup: msRest.CompositeMapper = { type: { name: "String" } + }, + useExistingSnapshot: { + serializedName: "properties.useExistingSnapshot", + defaultValue: false, + type: { + name: "Boolean" + } } } } @@ -2388,6 +2402,13 @@ export const BackupPatch: msRest.CompositeMapper = { type: { name: "String" } + }, + useExistingSnapshot: { + serializedName: "properties.useExistingSnapshot", + defaultValue: false, + type: { + name: "Boolean" + } } } } diff --git a/sdk/netapp/arm-netapp/src/models/parameters.ts b/sdk/netapp/arm-netapp/src/models/parameters.ts index 5da67d7a0784..0a3792675ade 100644 --- a/sdk/netapp/arm-netapp/src/models/parameters.ts +++ b/sdk/netapp/arm-netapp/src/models/parameters.ts @@ -34,7 +34,7 @@ export const apiVersion: msRest.OperationQueryParameter = { mapper: { required: true, serializedName: "api-version", - defaultValue: '2020-12-01', + defaultValue: '2021-02-01', type: { name: "String" } diff --git a/sdk/netapp/arm-netapp/src/models/volumeBackupStatusMappers.ts b/sdk/netapp/arm-netapp/src/models/volumeBackupStatusMappers.ts deleted file mode 100644 index 093fed73a0a5..000000000000 --- a/sdk/netapp/arm-netapp/src/models/volumeBackupStatusMappers.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * 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 { - BackupStatus, - CloudError -} from "../models/mappers"; diff --git a/sdk/netapp/arm-netapp/src/operations/accountBackups.ts b/sdk/netapp/arm-netapp/src/operations/accountBackups.ts index 12d43bb2f8fa..75a1b715f5b6 100644 --- a/sdk/netapp/arm-netapp/src/operations/accountBackups.ts +++ b/sdk/netapp/arm-netapp/src/operations/accountBackups.ts @@ -60,7 +60,7 @@ export class AccountBackups { } /** - * Get Backup for a Netapp Account + * Gets the specified backup for a Netapp Account * @summary Get Backup for a Netapp Account * @param resourceGroupName The name of the resource group. * @param accountName The name of the NetApp account @@ -97,7 +97,7 @@ export class AccountBackups { } /** - * Delete Backup for a Netapp Account + * Delete the specified Backup for a Netapp Account * @summary Delete Backup for a Netapp Account * @param resourceGroupName The name of the resource group. * @param accountName The name of the NetApp account @@ -111,7 +111,7 @@ export class AccountBackups { } /** - * Delete Backup for a Netapp Account + * Delete the specified Backup for a Netapp Account * @summary Delete Backup for a Netapp Account * @param resourceGroupName The name of the resource group. * @param accountName The name of the NetApp account diff --git a/sdk/netapp/arm-netapp/src/operations/backupPolicies.ts b/sdk/netapp/arm-netapp/src/operations/backupPolicies.ts index 0b42264bc940..089ec70f15c0 100644 --- a/sdk/netapp/arm-netapp/src/operations/backupPolicies.ts +++ b/sdk/netapp/arm-netapp/src/operations/backupPolicies.ts @@ -121,35 +121,9 @@ export class BackupPolicies { * @param [options] The optional parameters * @returns Promise */ - update(resourceGroupName: string, accountName: string, backupPolicyName: string, body: Models.BackupPolicyPatch, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param accountName The name of the NetApp account - * @param backupPolicyName Backup policy Name which uniquely identify backup policy. - * @param body Backup policy object supplied in the body of the operation. - * @param callback The callback - */ - update(resourceGroupName: string, accountName: string, backupPolicyName: string, body: Models.BackupPolicyPatch, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param accountName The name of the NetApp account - * @param backupPolicyName Backup policy Name which uniquely identify backup policy. - * @param body Backup policy object supplied in the body of the operation. - * @param options The optional parameters - * @param callback The callback - */ - update(resourceGroupName: string, accountName: string, backupPolicyName: string, body: Models.BackupPolicyPatch, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, accountName: string, backupPolicyName: string, body: Models.BackupPolicyPatch, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - accountName, - backupPolicyName, - body, - options - }, - updateOperationSpec, - callback) as Promise; + update(resourceGroupName: string, accountName: string, backupPolicyName: string, body: Models.BackupPolicyPatch, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,accountName,backupPolicyName,body,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } /** @@ -189,6 +163,29 @@ export class BackupPolicies { options); } + /** + * Patch a backup policy for Netapp Account + * @summary Patch a backup policy + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param body Backup policy object supplied in the body of the operation. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, accountName: string, backupPolicyName: string, body: Models.BackupPolicyPatch, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + backupPolicyName, + body, + options + }, + beginUpdateOperationSpec, + options); + } + /** * Delete backup policy * @summary Delete a backup policy @@ -264,8 +261,8 @@ const getOperationSpec: msRest.OperationSpec = { serializer }; -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", urlParameters: [ Parameters.subscriptionId, @@ -282,7 +279,7 @@ const updateOperationSpec: msRest.OperationSpec = { requestBody: { parameterPath: "body", mapper: { - ...Mappers.BackupPolicyPatch, + ...Mappers.BackupPolicy, required: true } }, @@ -290,9 +287,10 @@ const updateOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.BackupPolicy }, - 202: { + 201: { bodyMapper: Mappers.BackupPolicy }, + 202: {}, default: { bodyMapper: Mappers.CloudError } @@ -300,8 +298,8 @@ const updateOperationSpec: msRest.OperationSpec = { serializer }; -const beginCreateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", urlParameters: [ Parameters.subscriptionId, @@ -318,7 +316,7 @@ const beginCreateOperationSpec: msRest.OperationSpec = { requestBody: { parameterPath: "body", mapper: { - ...Mappers.BackupPolicy, + ...Mappers.BackupPolicyPatch, required: true } }, @@ -326,10 +324,9 @@ const beginCreateOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.BackupPolicy }, - 201: { + 202: { bodyMapper: Mappers.BackupPolicy }, - 202: {}, default: { bodyMapper: Mappers.CloudError } diff --git a/sdk/netapp/arm-netapp/src/operations/backups.ts b/sdk/netapp/arm-netapp/src/operations/backups.ts index 2e59fa436062..a72cf52524e8 100644 --- a/sdk/netapp/arm-netapp/src/operations/backups.ts +++ b/sdk/netapp/arm-netapp/src/operations/backups.ts @@ -26,6 +26,47 @@ export class Backups { this.client = client; } + /** + * Get the status of the backup for a volume + * @summary Get volume's backup status + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param [options] The optional parameters + * @returns Promise + */ + getStatus(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param callback The callback + */ + getStatus(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param options The optional parameters + * @param callback The callback + */ + getStatus(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getStatus(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + poolName, + volumeName, + options + }, + getStatusOperationSpec, + callback) as Promise; + } + /** * List all backups for a volume * @summary List Backups @@ -68,7 +109,7 @@ export class Backups { } /** - * Get a particular backup of the volume + * Gets the specified backup of the volume * @summary Get a backup * @param resourceGroupName The name of the resource group. * @param accountName The name of the NetApp account @@ -120,12 +161,12 @@ export class Backups { * @param poolName The name of the capacity pool * @param volumeName The name of the volume * @param backupName The name of the backup - * @param location Resource location + * @param body Backup object supplied in the body of the operation. * @param [options] The optional parameters * @returns Promise */ - create(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, backupName: string, location: string, options?: Models.BackupsCreateOptionalParams): Promise { - return this.beginCreate(resourceGroupName,accountName,poolName,volumeName,backupName,location,options) + create(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, backupName: string, body: Models.Backup, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,accountName,poolName,volumeName,backupName,body,options) .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } @@ -169,11 +210,11 @@ export class Backups { * @param poolName The name of the capacity pool * @param volumeName The name of the volume * @param backupName The name of the backup - * @param location Resource location + * @param body Backup object supplied in the body of the operation. * @param [options] The optional parameters * @returns Promise */ - beginCreate(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, backupName: string, location: string, options?: Models.BackupsBeginCreateOptionalParams): Promise { + beginCreate(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, backupName: string, body: Models.Backup, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceGroupName, @@ -181,7 +222,7 @@ export class Backups { poolName, volumeName, backupName, - location, + body, options }, beginCreateOperationSpec, @@ -241,6 +282,33 @@ export class Backups { // Operation Specifications const serializer = new msRest.Serializer(Mappers); +const getStatusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backupStatus", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BackupStatus + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups", @@ -314,13 +382,7 @@ const beginCreateOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], requestBody: { - parameterPath: { - location: "location", - label: [ - "options", - "label" - ] - }, + parameterPath: "body", mapper: { ...Mappers.Backup, required: true @@ -359,16 +421,10 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], requestBody: { - parameterPath: { - tags: [ - "options", - "tags" - ], - label: [ - "options", - "label" - ] - }, + parameterPath: [ + "options", + "body" + ], mapper: Mappers.BackupPatch }, responses: { diff --git a/sdk/netapp/arm-netapp/src/operations/index.ts b/sdk/netapp/arm-netapp/src/operations/index.ts index ea246000e9a0..bd1cd443318d 100644 --- a/sdk/netapp/arm-netapp/src/operations/index.ts +++ b/sdk/netapp/arm-netapp/src/operations/index.ts @@ -14,8 +14,7 @@ export * from "./pools"; export * from "./volumes"; export * from "./snapshots"; export * from "./snapshotPolicies"; -export * from "./volumeBackupStatus"; -export * from "./accountBackups"; export * from "./backups"; +export * from "./accountBackups"; export * from "./backupPolicies"; export * from "./vaults"; diff --git a/sdk/netapp/arm-netapp/src/operations/volumeBackupStatus.ts b/sdk/netapp/arm-netapp/src/operations/volumeBackupStatus.ts deleted file mode 100644 index 06f7788d587e..000000000000 --- a/sdk/netapp/arm-netapp/src/operations/volumeBackupStatus.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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/volumeBackupStatusMappers"; -import * as Parameters from "../models/parameters"; -import { AzureNetAppFilesManagementClientContext } from "../azureNetAppFilesManagementClientContext"; - -/** Class representing a VolumeBackupStatus. */ -export class VolumeBackupStatus { - private readonly client: AzureNetAppFilesManagementClientContext; - - /** - * Create a VolumeBackupStatus. - * @param {AzureNetAppFilesManagementClientContext} client Reference to the service client. - */ - constructor(client: AzureNetAppFilesManagementClientContext) { - this.client = client; - } - - /** - * Get the status of the backup for a volume - * @summary Get volume's backup status - * @param resourceGroupName The name of the resource group. - * @param accountName The name of the NetApp account - * @param poolName The name of the capacity pool - * @param volumeName The name of the volume - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param accountName The name of the NetApp account - * @param poolName The name of the capacity pool - * @param volumeName The name of the volume - * @param callback The callback - */ - get(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param accountName The name of the NetApp account - * @param poolName The name of the capacity pool - * @param volumeName The name of the volume - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - accountName, - poolName, - volumeName, - options - }, - getOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backupStatus", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.poolName, - Parameters.volumeName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.BackupStatus - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -};