diff --git a/sdk/netapp/arm-netapp/src/azureNetAppFilesManagementClientContext.ts b/sdk/netapp/arm-netapp/src/azureNetAppFilesManagementClientContext.ts index ee772c0e8cc1..1ab0acdda65d 100644 --- a/sdk/netapp/arm-netapp/src/azureNetAppFilesManagementClientContext.ts +++ b/sdk/netapp/arm-netapp/src/azureNetAppFilesManagementClientContext.ts @@ -45,7 +45,7 @@ export class AzureNetAppFilesManagementClientContext extends msRestAzure.AzureSe super(credentials, options); - this.apiVersion = '2019-08-01'; + this.apiVersion = '2019-10-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/netapp/arm-netapp/src/models/index.ts b/sdk/netapp/arm-netapp/src/models/index.ts index ae70ef240714..2feca57b415d 100644 --- a/sdk/netapp/arm-netapp/src/models/index.ts +++ b/sdk/netapp/arm-netapp/src/models/index.ts @@ -420,26 +420,30 @@ export interface VolumePropertiesExportPolicy { */ export interface ReplicationObject { /** - * replicationId. Id + * Id */ replicationId?: string; /** - * endpointType. Indicates whether the local volume is the source or destination for the Volume - * Replication + * Indicates whether the local volume is the source or destination for the Volume Replication. + * Possible values include: 'src', 'dst' */ - endpointType: string; + endpointType?: EndpointType; /** - * replicationSchedule. Schedule + * Schedule. Possible values include: '_10minutely', 'hourly', 'daily', 'weekly', 'monthly' */ - replicationSchedule: string; + replicationSchedule: ReplicationSchedule; /** - * remoteVolumeResourceId. The resource ID of the remote volume. + * The resource ID of the remote volume. */ remoteVolumeResourceId: string; + /** + * The remote region for the other end of the Volume Replication. + */ + remoteVolumeRegion?: string; } /** - * DataProtection volume, can have a replication object + * DataProtection type volumes include an object containing details of the replication * @summary DataProtection */ export interface VolumePropertiesDataProtection { @@ -533,9 +537,40 @@ export interface Volume extends BaseResource { */ volumeType?: string; /** - * DataProtection. DataProtection volume, can have a replication object + * DataProtection. DataProtection type volumes include an object containing details of the + * replication */ dataProtection?: VolumePropertiesDataProtection; + /** + * Restoring + */ + isRestoring?: boolean; +} + +/** + * Replication status + */ +export interface ReplicationStatus { + /** + * Replication health check + */ + healthy?: boolean; + /** + * Status of the mirror relationship. Possible values include: 'Idle', 'Transferring' + */ + relationshipStatus?: RelationshipStatus; + /** + * The status of the replication. Possible values include: 'Uninitialized', 'Mirrored', 'Broken' + */ + mirrorState?: MirrorState; + /** + * The progress of the replication + */ + totalProgress?: string; + /** + * Displays error message if the replication is in an error state + */ + errorMessage?: string; } /** @@ -723,6 +758,26 @@ export interface SnapshotPatch extends BaseResource { tags?: { [propertyName: string]: string }; } +/** + * Authorize request + */ +export interface AuthorizeRequest { + /** + * Resource id + */ + remoteVolumeResourceId?: string; +} + +/** + * Optional Parameters. + */ +export interface VolumesAuthorizeReplicationOptionalParams extends msRest.RequestOptionsBase { + /** + * Resource id + */ + remoteVolumeResourceId?: string; +} + /** * Optional Parameters. */ @@ -816,6 +871,38 @@ export type CheckNameResourceTypes = 'Microsoft.NetApp/netAppAccounts' | 'Micros */ export type ServiceLevel = 'Standard' | 'Premium' | 'Ultra'; +/** + * Defines values for EndpointType. + * Possible values include: 'src', 'dst' + * @readonly + * @enum {string} + */ +export type EndpointType = 'src' | 'dst'; + +/** + * Defines values for ReplicationSchedule. + * Possible values include: '_10minutely', 'hourly', 'daily', 'weekly', 'monthly' + * @readonly + * @enum {string} + */ +export type ReplicationSchedule = '_10minutely' | 'hourly' | 'daily' | 'weekly' | 'monthly'; + +/** + * Defines values for RelationshipStatus. + * Possible values include: 'Idle', 'Transferring' + * @readonly + * @enum {string} + */ +export type RelationshipStatus = 'Idle' | 'Transferring'; + +/** + * Defines values for MirrorState. + * Possible values include: 'Uninitialized', 'Mirrored', 'Broken' + * @readonly + * @enum {string} + */ +export type MirrorState = 'Uninitialized' | 'Mirrored' | 'Broken'; + /** * Contains response data for the list operation. */ @@ -1156,6 +1243,26 @@ export type VolumesUpdateResponse = Volume & { }; }; +/** + * Contains response data for the replicationStatusMethod operation. + */ +export type VolumesReplicationStatusMethodResponse = ReplicationStatus & { + /** + * 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: ReplicationStatus; + }; +}; + /** * Contains response data for the beginCreateOrUpdate operation. */ diff --git a/sdk/netapp/arm-netapp/src/models/mappers.ts b/sdk/netapp/arm-netapp/src/models/mappers.ts index 2617799f1d8f..a33d7d77cf91 100644 --- a/sdk/netapp/arm-netapp/src/models/mappers.ts +++ b/sdk/netapp/arm-netapp/src/models/mappers.ts @@ -688,7 +688,6 @@ export const ReplicationObject: msRest.CompositeMapper = { } }, endpointType: { - required: true, serializedName: "endpointType", type: { name: "String" @@ -707,6 +706,12 @@ export const ReplicationObject: msRest.CompositeMapper = { type: { name: "String" } + }, + remoteVolumeRegion: { + serializedName: "remoteVolumeRegion", + type: { + name: "String" + } } } } @@ -885,6 +890,52 @@ export const Volume: msRest.CompositeMapper = { name: "Composite", className: "VolumePropertiesDataProtection" } + }, + isRestoring: { + serializedName: "properties.isRestoring", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ReplicationStatus: msRest.CompositeMapper = { + serializedName: "replicationStatus", + type: { + name: "Composite", + className: "ReplicationStatus", + modelProperties: { + healthy: { + serializedName: "healthy", + type: { + name: "Boolean" + } + }, + relationshipStatus: { + serializedName: "relationshipStatus", + type: { + name: "String" + } + }, + mirrorState: { + serializedName: "mirrorState", + type: { + name: "String" + } + }, + totalProgress: { + serializedName: "totalProgress", + type: { + name: "String" + } + }, + errorMessage: { + serializedName: "errorMessage", + type: { + name: "String" + } } } } @@ -1215,6 +1266,22 @@ export const SnapshotPatch: msRest.CompositeMapper = { } }; +export const AuthorizeRequest: msRest.CompositeMapper = { + serializedName: "authorizeRequest", + type: { + name: "Composite", + className: "AuthorizeRequest", + modelProperties: { + remoteVolumeResourceId: { + serializedName: "remoteVolumeResourceId", + type: { + name: "String" + } + } + } + } +}; + export const OperationListResult: msRest.CompositeMapper = { serializedName: "OperationListResult", type: { diff --git a/sdk/netapp/arm-netapp/src/models/parameters.ts b/sdk/netapp/arm-netapp/src/models/parameters.ts index 343cbd826fe2..d8674d35aaad 100644 --- a/sdk/netapp/arm-netapp/src/models/parameters.ts +++ b/sdk/netapp/arm-netapp/src/models/parameters.ts @@ -35,7 +35,7 @@ export const apiVersion: msRest.OperationQueryParameter = { mapper: { required: true, serializedName: "api-version", - defaultValue: '2019-08-01', + defaultValue: '2019-10-01', type: { name: "String" } diff --git a/sdk/netapp/arm-netapp/src/models/volumesMappers.ts b/sdk/netapp/arm-netapp/src/models/volumesMappers.ts index 92b4d5632f24..2d5984890d09 100644 --- a/sdk/netapp/arm-netapp/src/models/volumesMappers.ts +++ b/sdk/netapp/arm-netapp/src/models/volumesMappers.ts @@ -8,6 +8,7 @@ export { ActiveDirectory, + AuthorizeRequest, BaseResource, CapacityPool, CapacityPoolPatch, @@ -16,6 +17,7 @@ export { NetAppAccount, NetAppAccountPatch, ReplicationObject, + ReplicationStatus, Snapshot, SnapshotPatch, Volume, diff --git a/sdk/netapp/arm-netapp/src/operations/volumes.ts b/sdk/netapp/arm-netapp/src/operations/volumes.ts index 7720d4eae10b..c763914b6521 100644 --- a/sdk/netapp/arm-netapp/src/operations/volumes.ts +++ b/sdk/netapp/arm-netapp/src/operations/volumes.ts @@ -181,6 +181,213 @@ export class Volumes { .then(lroPoller => lroPoller.pollUntilFinished()); } + /** + * Break the replication connection on the destination volume + * @summary Break volume replication + * @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 + */ + breakReplication(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 + */ + breakReplication(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 + */ + breakReplication(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + breakReplication(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 + }, + breakReplicationOperationSpec, + callback); + } + + /** + * Get the status of the replication + * @summary Get volume replication 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 + */ + replicationStatusMethod(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 + */ + replicationStatusMethod(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 + */ + replicationStatusMethod(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + replicationStatusMethod(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 + }, + replicationStatusMethodOperationSpec, + callback) as Promise; + } + + /** + * Resync the connection on the destination volume. If the operation is ran on the source volume it + * will reverse-resync the connection and sync from source to destination. + * @summary Resync volume replication + * @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 + */ + resyncReplication(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 + */ + resyncReplication(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 + */ + resyncReplication(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + resyncReplication(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 + }, + resyncReplicationOperationSpec, + callback); + } + + /** + * Delete the replication connection on the destination volume, and send release to the source + * replication + * @summary Delete volume replication + * @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 + */ + deleteReplication(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 + */ + deleteReplication(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 + */ + deleteReplication(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteReplication(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 + }, + deleteReplicationOperationSpec, + callback); + } + + /** + * Authorize the replication connection on the source volume + * @summary Authorize source volume replication + * @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 + */ + authorizeReplication(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: Models.VolumesAuthorizeReplicationOptionalParams): 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 + */ + authorizeReplication(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 + */ + authorizeReplication(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options: Models.VolumesAuthorizeReplicationOptionalParams, callback: msRest.ServiceCallback): void; + authorizeReplication(resourceGroupName: string, accountName: string, poolName: string, volumeName: string, options?: Models.VolumesAuthorizeReplicationOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + poolName, + volumeName, + options + }, + authorizeReplicationOperationSpec, + callback); + } + /** * Create or update the specified volume within the capacity pool * @summary Create or Update a volume @@ -320,6 +527,145 @@ const updateOperationSpec: msRest.OperationSpec = { serializer }; +const breakReplicationOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const replicationStatusMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ReplicationStatus + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const resyncReplicationOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteReplicationOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const authorizeReplicationOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.volumeName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + remoteVolumeResourceId: [ + "options", + "remoteVolumeResourceId" + ] + }, + mapper: { + ...Mappers.AuthorizeRequest, + required: true + } + }, + responses: { + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}",