From 3a0a90e00e7de04014e064fa82c973788cfef432 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 5 May 2020 19:09:52 +0000 Subject: [PATCH] Update from master --- .../src/models/blobContainersMappers.ts | 4 + .../src/models/blobServicesMappers.ts | 4 + .../src/models/encryptionScopesMappers.ts | 4 + .../src/models/fileServicesMappers.ts | 4 + .../src/models/fileSharesMappers.ts | 5 + sdk/storage/arm-storage/src/models/index.ts | 357 ++++++++++++++++-- .../src/models/managementPoliciesMappers.ts | 4 + sdk/storage/arm-storage/src/models/mappers.ts | 353 +++++++++++++++++ ...ectReplicationPoliciesOperationsMappers.ts | 74 ++++ .../arm-storage/src/models/parameters.ts | 43 +++ .../privateEndpointConnectionsMappers.ts | 4 + .../src/models/privateLinkResourcesMappers.ts | 4 + .../src/models/storageAccountsMappers.ts | 4 + .../arm-storage/src/operations/fileShares.ts | 157 ++++++-- .../arm-storage/src/operations/index.ts | 1 + .../objectReplicationPoliciesOperations.ts | 331 ++++++++++++++++ .../src/storageManagementClient.ts | 2 + 17 files changed, 1299 insertions(+), 56 deletions(-) create mode 100644 sdk/storage/arm-storage/src/models/objectReplicationPoliciesOperationsMappers.ts create mode 100644 sdk/storage/arm-storage/src/operations/objectReplicationPoliciesOperations.ts diff --git a/sdk/storage/arm-storage/src/models/blobContainersMappers.ts b/sdk/storage/arm-storage/src/models/blobContainersMappers.ts index 841f6031756a..2922e9f1ccfa 100644 --- a/sdk/storage/arm-storage/src/models/blobContainersMappers.ts +++ b/sdk/storage/arm-storage/src/models/blobContainersMappers.ts @@ -59,6 +59,9 @@ export { ManagementPolicySchema, ManagementPolicySnapShot, NetworkRuleSet, + ObjectReplicationPolicy, + ObjectReplicationPolicyFilter, + ObjectReplicationPolicyRule, PrivateEndpoint, PrivateEndpointConnection, PrivateLinkResource, @@ -71,6 +74,7 @@ export { StorageAccount, StorageAccountInternetEndpoints, StorageAccountMicrosoftEndpoints, + TagFilter, TagProperty, TrackedResource, UpdateHistoryProperty, diff --git a/sdk/storage/arm-storage/src/models/blobServicesMappers.ts b/sdk/storage/arm-storage/src/models/blobServicesMappers.ts index 04b152790ea6..5ea05717ecf4 100644 --- a/sdk/storage/arm-storage/src/models/blobServicesMappers.ts +++ b/sdk/storage/arm-storage/src/models/blobServicesMappers.ts @@ -51,6 +51,9 @@ export { ManagementPolicySchema, ManagementPolicySnapShot, NetworkRuleSet, + ObjectReplicationPolicy, + ObjectReplicationPolicyFilter, + ObjectReplicationPolicyRule, PrivateEndpoint, PrivateEndpointConnection, PrivateLinkResource, @@ -63,6 +66,7 @@ export { StorageAccount, StorageAccountInternetEndpoints, StorageAccountMicrosoftEndpoints, + TagFilter, TagProperty, TrackedResource, UpdateHistoryProperty, diff --git a/sdk/storage/arm-storage/src/models/encryptionScopesMappers.ts b/sdk/storage/arm-storage/src/models/encryptionScopesMappers.ts index 6654e1b23bf5..784718605cc2 100644 --- a/sdk/storage/arm-storage/src/models/encryptionScopesMappers.ts +++ b/sdk/storage/arm-storage/src/models/encryptionScopesMappers.ts @@ -52,6 +52,9 @@ export { ManagementPolicySchema, ManagementPolicySnapShot, NetworkRuleSet, + ObjectReplicationPolicy, + ObjectReplicationPolicyFilter, + ObjectReplicationPolicyRule, PrivateEndpoint, PrivateEndpointConnection, PrivateLinkResource, @@ -64,6 +67,7 @@ export { StorageAccount, StorageAccountInternetEndpoints, StorageAccountMicrosoftEndpoints, + TagFilter, TagProperty, TrackedResource, UpdateHistoryProperty, diff --git a/sdk/storage/arm-storage/src/models/fileServicesMappers.ts b/sdk/storage/arm-storage/src/models/fileServicesMappers.ts index 9f9c175bfaf8..44f22a1df678 100644 --- a/sdk/storage/arm-storage/src/models/fileServicesMappers.ts +++ b/sdk/storage/arm-storage/src/models/fileServicesMappers.ts @@ -51,6 +51,9 @@ export { ManagementPolicySchema, ManagementPolicySnapShot, NetworkRuleSet, + ObjectReplicationPolicy, + ObjectReplicationPolicyFilter, + ObjectReplicationPolicyRule, PrivateEndpoint, PrivateEndpointConnection, PrivateLinkResource, @@ -63,6 +66,7 @@ export { StorageAccount, StorageAccountInternetEndpoints, StorageAccountMicrosoftEndpoints, + TagFilter, TagProperty, TrackedResource, UpdateHistoryProperty, diff --git a/sdk/storage/arm-storage/src/models/fileSharesMappers.ts b/sdk/storage/arm-storage/src/models/fileSharesMappers.ts index 73469ee7a351..6e6d768545d4 100644 --- a/sdk/storage/arm-storage/src/models/fileSharesMappers.ts +++ b/sdk/storage/arm-storage/src/models/fileSharesMappers.ts @@ -23,6 +23,7 @@ export { CustomDomain, DateAfterCreation, DateAfterModification, + DeletedShare, DeleteRetentionPolicy, Encryption, EncryptionScope, @@ -51,6 +52,9 @@ export { ManagementPolicySchema, ManagementPolicySnapShot, NetworkRuleSet, + ObjectReplicationPolicy, + ObjectReplicationPolicyFilter, + ObjectReplicationPolicyRule, PrivateEndpoint, PrivateEndpointConnection, PrivateLinkResource, @@ -63,6 +67,7 @@ export { StorageAccount, StorageAccountInternetEndpoints, StorageAccountMicrosoftEndpoints, + TagFilter, TagProperty, TrackedResource, UpdateHistoryProperty, diff --git a/sdk/storage/arm-storage/src/models/index.ts b/sdk/storage/arm-storage/src/models/index.ts index 2dc3628ecbfc..ce8f50a49b85 100644 --- a/sdk/storage/arm-storage/src/models/index.ts +++ b/sdk/storage/arm-storage/src/models/index.ts @@ -720,11 +720,11 @@ export interface GeoReplicationStats { */ export interface BlobRestoreRange { /** - * Blob start range. Empty means account start. + * Blob start range. This is inclusive. Empty means account start. */ startRange: string; /** - * Blob end range. Empty means account end. + * Blob end range. This is exclusive. Empty means account end. */ endRange: string; } @@ -1361,6 +1361,26 @@ export interface ManagementPolicyAction { snapshot?: ManagementPolicySnapShot; } +/** + * Blob index tag based filtering for blob objects + */ +export interface TagFilter { + /** + * This is the filter tag name, it can have 1 - 128 characters + */ + name: string; + /** + * This is the comparison operator which is used for object comparison and filtering. Only == + * (equality operator) is currently supported + */ + op: string; + /** + * This is the filter tag value field used for tag based filtering, it can have 0 - 256 + * characters + */ + value: string; +} + /** * Filters limit rule actions to a subset of blobs within the storage account. If multiple filters * are defined, a logical AND is performed on all filters. @@ -1374,6 +1394,10 @@ export interface ManagementPolicyFilter { * An array of predefined enum values. Only blockBlob is supported. */ blobTypes: string[]; + /** + * An array of blob index tag based filters, there can be at most 10 tag filters + */ + blobIndexMatch?: TagFilter[]; } /** @@ -1512,6 +1536,76 @@ export interface EncryptionScope extends Resource { keyVaultProperties?: EncryptionScopeKeyVaultProperties; } +/** + * Filters limit replication to a subset of blobs within the storage account. A logical OR is + * performed on values in the filter. If multiple filters are defined, a logical AND is performed + * on all filters. + */ +export interface ObjectReplicationPolicyFilter { + /** + * Optional. Filters the results to replicate only blobs whose names begin with the specified + * prefix. + */ + prefixMatch?: string[]; + /** + * Blobs created after the time will be replicated to the destination. It must be in datetime + * format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z + */ + minCreationTime?: string; +} + +/** + * The replication policy rule between two containers. + */ +export interface ObjectReplicationPolicyRule { + /** + * Rule Id is auto-generated for each new rule on destination account. It is required for put + * policy on source account. + */ + ruleId?: string; + /** + * Required. Source container name. + */ + sourceContainer: string; + /** + * Required. Destination container name. + */ + destinationContainer: string; + /** + * Optional. An object that defines the filter set. + */ + filters?: ObjectReplicationPolicyFilter; +} + +/** + * The replication policy between two storage accounts. Multiple rules can be defined in one + * policy. + */ +export interface ObjectReplicationPolicy extends Resource { + /** + * A unique id for object replication policy. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly policyId?: string; + /** + * Indicates when the policy is enabled on the source account. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly enabledTime?: Date; + /** + * Required. Source account name. + */ + sourceAccount: string; + /** + * Required. Destination account name. + */ + destinationAccount: string; + /** + * The storage account object replication rules. + */ + rules?: ObjectReplicationPolicyRule[]; +} + /** * An error response from the storage resource provider. */ @@ -1924,6 +2018,11 @@ export interface RestorePolicyProperties { * DeleteRetentionPolicy.days. */ days?: number; + /** + * Returns the date and time the restore policy was last enabled. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastEnabledTime?: Date; } /** @@ -2067,6 +2166,72 @@ export interface FileShare extends AzureEntityResource { * 5TB (5120). For Large File Shares, the maximum size is 102400. */ shareQuota?: number; + /** + * The authentication protocol that is used for the file share. Can only be specified when + * creating a share. Possible values include: 'SMB', 'NFS' + */ + enabledProtocols?: EnabledProtocols; + /** + * The property is for NFS share only. The default is NoRootSquash. Possible values include: + * 'NoRootSquash', 'RootSquash', 'AllSquash' + */ + rootSquash?: RootSquashType; + /** + * The version of the share. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly version?: string; + /** + * Indicates whether the share was deleted. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly deleted?: boolean; + /** + * The deleted time if the share was deleted. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly deletedTime?: Date; + /** + * Remaining retention days for share that was soft deleted. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly remainingRetentionDays?: number; + /** + * Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. Possible values include: + * 'TransactionOptimized', 'Hot', 'Cool', 'Premium' + */ + accessTier?: ShareAccessTier; + /** + * Indicates the last modification time for share access tier. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly accessTierChangeTime?: Date; + /** + * Indicates if there is a pending transition for access tier. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly accessTierStatus?: string; + /** + * The approximate size of the data stored on the share. Note that this value may not include all + * recently created or recently resized files. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly shareUsageBytes?: number; +} + +/** + * The deleted share to be restored. + */ +export interface DeletedShare { + /** + * Required. Identify the name of the deleted share that will be restored. + */ + deletedShareName: string; + /** + * Required. Identify the version of the deleted share that will be restored. + */ + deletedShareVersion: string; } /** @@ -2087,6 +2252,58 @@ export interface FileShareItem extends AzureEntityResource { * 5TB (5120). For Large File Shares, the maximum size is 102400. */ shareQuota?: number; + /** + * The authentication protocol that is used for the file share. Can only be specified when + * creating a share. Possible values include: 'SMB', 'NFS' + */ + enabledProtocols?: EnabledProtocols; + /** + * The property is for NFS share only. The default is NoRootSquash. Possible values include: + * 'NoRootSquash', 'RootSquash', 'AllSquash' + */ + rootSquash?: RootSquashType; + /** + * The version of the share. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly version?: string; + /** + * Indicates whether the share was deleted. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly deleted?: boolean; + /** + * The deleted time if the share was deleted. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly deletedTime?: Date; + /** + * Remaining retention days for share that was soft deleted. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly remainingRetentionDays?: number; + /** + * Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. Possible values include: + * 'TransactionOptimized', 'Hot', 'Cool', 'Premium' + */ + accessTier?: ShareAccessTier; + /** + * Indicates the last modification time for share access tier. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly accessTierChangeTime?: Date; + /** + * Indicates if there is a pending transition for access tier. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly accessTierStatus?: string; + /** + * The approximate size of the data stored on the share. Note that this value may not include all + * recently created or recently resized files. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly shareUsageBytes?: number; } /** @@ -2216,36 +2433,22 @@ export interface FileSharesListOptionalParams extends msRest.RequestOptionsBase * Optional. When specified, only share names starting with the filter will be listed. */ filter?: string; -} - -/** - * Optional Parameters. - */ -export interface FileSharesCreateOptionalParams extends msRest.RequestOptionsBase { - /** - * A name-value pair to associate with the share as metadata. - */ - metadata?: { [propertyName: string]: string }; /** - * The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to - * 5TB (5120). For Large File Shares, the maximum size is 102400. + * Optional, used to expand the properties within share's properties. Possible values include: + * 'deleted' */ - shareQuota?: number; + expand?: ListSharesExpand; } /** * Optional Parameters. */ -export interface FileSharesUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * A name-value pair to associate with the share as metadata. - */ - metadata?: { [propertyName: string]: string }; +export interface FileSharesGetOptionalParams extends msRest.RequestOptionsBase { /** - * The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to - * 5TB (5120). For Large File Shares, the maximum size is 102400. + * Optional, used to expand the properties within share's properties. Possible values include: + * 'stats' */ - shareQuota?: number; + expand?: GetShareExpand; } /** @@ -2354,6 +2557,14 @@ export interface StorageAccountListResult extends Array { export interface UsageListResult extends Array { } +/** + * @interface + * List storage account object replication policies. + * @extends Array + */ +export interface ObjectReplicationPolicies extends Array { +} + /** * @interface * List of encryption scopes requested, and if paging is required, a URL to the next page of @@ -2699,6 +2910,30 @@ export type ImmutabilityPolicyState = 'Locked' | 'Unlocked'; */ export type ImmutabilityPolicyUpdateType = 'put' | 'lock' | 'extend'; +/** + * Defines values for EnabledProtocols. + * Possible values include: 'SMB', 'NFS' + * @readonly + * @enum {string} + */ +export type EnabledProtocols = 'SMB' | 'NFS'; + +/** + * Defines values for RootSquashType. + * Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash' + * @readonly + * @enum {string} + */ +export type RootSquashType = 'NoRootSquash' | 'RootSquash' | 'AllSquash'; + +/** + * Defines values for ShareAccessTier. + * Possible values include: 'TransactionOptimized', 'Hot', 'Cool', 'Premium' + * @readonly + * @enum {string} + */ +export type ShareAccessTier = 'TransactionOptimized' | 'Hot' | 'Cool' | 'Premium'; + /** * Defines values for StorageAccountExpand. * Possible values include: 'geoReplicationStats', 'blobRestoreStatus' @@ -2715,6 +2950,22 @@ export type StorageAccountExpand = 'geoReplicationStats' | 'blobRestoreStatus'; */ export type ListKeyExpand = 'kerb'; +/** + * Defines values for ListSharesExpand. + * Possible values include: 'deleted' + * @readonly + * @enum {string} + */ +export type ListSharesExpand = 'deleted'; + +/** + * Defines values for GetShareExpand. + * Possible values include: 'stats' + * @readonly + * @enum {string} + */ +export type GetShareExpand = 'stats'; + /** * Defines values for Action1. * Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break' @@ -3163,6 +3414,66 @@ export type PrivateLinkResourcesListByStorageAccountResponse = PrivateLinkResour }; }; +/** + * Contains response data for the list operation. + */ +export type ObjectReplicationPoliciesListResponse = ObjectReplicationPolicies & { + /** + * 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: ObjectReplicationPolicies; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ObjectReplicationPoliciesGetResponse = ObjectReplicationPolicy & { + /** + * 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: ObjectReplicationPolicy; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type ObjectReplicationPoliciesCreateOrUpdateResponse = ObjectReplicationPolicy & { + /** + * 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: ObjectReplicationPolicy; + }; +}; + /** * Contains response data for the put operation. */ diff --git a/sdk/storage/arm-storage/src/models/managementPoliciesMappers.ts b/sdk/storage/arm-storage/src/models/managementPoliciesMappers.ts index 1f0770fd0551..b2869eb2eeb7 100644 --- a/sdk/storage/arm-storage/src/models/managementPoliciesMappers.ts +++ b/sdk/storage/arm-storage/src/models/managementPoliciesMappers.ts @@ -50,6 +50,9 @@ export { ManagementPolicySchema, ManagementPolicySnapShot, NetworkRuleSet, + ObjectReplicationPolicy, + ObjectReplicationPolicyFilter, + ObjectReplicationPolicyRule, PrivateEndpoint, PrivateEndpointConnection, PrivateLinkResource, @@ -62,6 +65,7 @@ export { StorageAccount, StorageAccountInternetEndpoints, StorageAccountMicrosoftEndpoints, + TagFilter, TagProperty, TrackedResource, UpdateHistoryProperty, diff --git a/sdk/storage/arm-storage/src/models/mappers.ts b/sdk/storage/arm-storage/src/models/mappers.ts index 7923f47baad4..778396ffa6df 100644 --- a/sdk/storage/arm-storage/src/models/mappers.ts +++ b/sdk/storage/arm-storage/src/models/mappers.ts @@ -2170,6 +2170,45 @@ export const ManagementPolicyAction: msRest.CompositeMapper = { } }; +export const TagFilter: msRest.CompositeMapper = { + serializedName: "TagFilter", + type: { + name: "Composite", + className: "TagFilter", + modelProperties: { + name: { + required: true, + serializedName: "name", + constraints: { + MaxLength: 128, + MinLength: 1 + }, + type: { + name: "String" + } + }, + op: { + required: true, + serializedName: "op", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "value", + constraints: { + MaxLength: 256, + MinLength: 0 + }, + type: { + name: "String" + } + } + } + } +}; + export const ManagementPolicyFilter: msRest.CompositeMapper = { serializedName: "ManagementPolicyFilter", type: { @@ -2198,6 +2237,18 @@ export const ManagementPolicyFilter: msRest.CompositeMapper = { } } } + }, + blobIndexMatch: { + serializedName: "blobIndexMatch", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TagFilter" + } + } + } } } } @@ -2440,6 +2491,121 @@ export const EncryptionScope: msRest.CompositeMapper = { } }; +export const ObjectReplicationPolicyFilter: msRest.CompositeMapper = { + serializedName: "ObjectReplicationPolicyFilter", + type: { + name: "Composite", + className: "ObjectReplicationPolicyFilter", + modelProperties: { + prefixMatch: { + serializedName: "prefixMatch", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + minCreationTime: { + serializedName: "minCreationTime", + type: { + name: "String" + } + } + } + } +}; + +export const ObjectReplicationPolicyRule: msRest.CompositeMapper = { + serializedName: "ObjectReplicationPolicyRule", + type: { + name: "Composite", + className: "ObjectReplicationPolicyRule", + modelProperties: { + ruleId: { + serializedName: "ruleId", + type: { + name: "String" + } + }, + sourceContainer: { + required: true, + serializedName: "sourceContainer", + type: { + name: "String" + } + }, + destinationContainer: { + required: true, + serializedName: "destinationContainer", + type: { + name: "String" + } + }, + filters: { + serializedName: "filters", + type: { + name: "Composite", + className: "ObjectReplicationPolicyFilter" + } + } + } + } +}; + +export const ObjectReplicationPolicy: msRest.CompositeMapper = { + serializedName: "ObjectReplicationPolicy", + type: { + name: "Composite", + className: "ObjectReplicationPolicy", + modelProperties: { + ...Resource.type.modelProperties, + policyId: { + readOnly: true, + serializedName: "properties.policyId", + type: { + name: "String" + } + }, + enabledTime: { + readOnly: true, + serializedName: "properties.enabledTime", + type: { + name: "DateTime" + } + }, + sourceAccount: { + required: true, + serializedName: "properties.sourceAccount", + type: { + name: "String" + } + }, + destinationAccount: { + required: true, + serializedName: "properties.destinationAccount", + type: { + name: "String" + } + }, + rules: { + serializedName: "properties.rules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ObjectReplicationPolicyRule" + } + } + } + } + } + } +}; + export const ErrorResponse: msRest.CompositeMapper = { serializedName: "ErrorResponse", type: { @@ -3082,6 +3248,13 @@ export const RestorePolicyProperties: msRest.CompositeMapper = { type: { name: "Number" } + }, + lastEnabledTime: { + readOnly: true, + serializedName: "lastEnabledTime", + type: { + name: "DateTime" + } } } } @@ -3312,6 +3485,97 @@ export const FileShare: msRest.CompositeMapper = { type: { name: "Number" } + }, + enabledProtocols: { + serializedName: "properties.enabledProtocols", + type: { + name: "String" + } + }, + rootSquash: { + serializedName: "properties.rootSquash", + type: { + name: "String" + } + }, + version: { + readOnly: true, + serializedName: "properties.version", + type: { + name: "String" + } + }, + deleted: { + readOnly: true, + serializedName: "properties.deleted", + type: { + name: "Boolean" + } + }, + deletedTime: { + readOnly: true, + serializedName: "properties.deletedTime", + type: { + name: "DateTime" + } + }, + remainingRetentionDays: { + readOnly: true, + serializedName: "properties.remainingRetentionDays", + type: { + name: "Number" + } + }, + accessTier: { + serializedName: "properties.accessTier", + type: { + name: "String" + } + }, + accessTierChangeTime: { + readOnly: true, + serializedName: "properties.accessTierChangeTime", + type: { + name: "DateTime" + } + }, + accessTierStatus: { + readOnly: true, + serializedName: "properties.accessTierStatus", + type: { + name: "String" + } + }, + shareUsageBytes: { + readOnly: true, + serializedName: "properties.shareUsageBytes", + type: { + name: "Number" + } + } + } + } +}; + +export const DeletedShare: msRest.CompositeMapper = { + serializedName: "DeletedShare", + type: { + name: "Composite", + className: "DeletedShare", + modelProperties: { + deletedShareName: { + required: true, + serializedName: "deletedShareName", + type: { + name: "String" + } + }, + deletedShareVersion: { + required: true, + serializedName: "deletedShareVersion", + type: { + name: "String" + } } } } @@ -3351,6 +3615,73 @@ export const FileShareItem: msRest.CompositeMapper = { type: { name: "Number" } + }, + enabledProtocols: { + serializedName: "properties.enabledProtocols", + type: { + name: "String" + } + }, + rootSquash: { + serializedName: "properties.rootSquash", + type: { + name: "String" + } + }, + version: { + readOnly: true, + serializedName: "properties.version", + type: { + name: "String" + } + }, + deleted: { + readOnly: true, + serializedName: "properties.deleted", + type: { + name: "Boolean" + } + }, + deletedTime: { + readOnly: true, + serializedName: "properties.deletedTime", + type: { + name: "DateTime" + } + }, + remainingRetentionDays: { + readOnly: true, + serializedName: "properties.remainingRetentionDays", + type: { + name: "Number" + } + }, + accessTier: { + serializedName: "properties.accessTier", + type: { + name: "String" + } + }, + accessTierChangeTime: { + readOnly: true, + serializedName: "properties.accessTierChangeTime", + type: { + name: "DateTime" + } + }, + accessTierStatus: { + readOnly: true, + serializedName: "properties.accessTierStatus", + type: { + name: "String" + } + }, + shareUsageBytes: { + readOnly: true, + serializedName: "properties.shareUsageBytes", + type: { + name: "Number" + } } } } @@ -3533,6 +3864,28 @@ export const UsageListResult: msRest.CompositeMapper = { } }; +export const ObjectReplicationPolicies: msRest.CompositeMapper = { + serializedName: "ObjectReplicationPolicies", + type: { + name: "Composite", + className: "ObjectReplicationPolicies", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ObjectReplicationPolicy" + } + } + } + } + } + } +}; + export const EncryptionScopeListResult: msRest.CompositeMapper = { serializedName: "EncryptionScopeListResult", type: { diff --git a/sdk/storage/arm-storage/src/models/objectReplicationPoliciesOperationsMappers.ts b/sdk/storage/arm-storage/src/models/objectReplicationPoliciesOperationsMappers.ts new file mode 100644 index 000000000000..9f9fc2af4d1c --- /dev/null +++ b/sdk/storage/arm-storage/src/models/objectReplicationPoliciesOperationsMappers.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + ActiveDirectoryProperties, + AzureEntityResource, + AzureFilesIdentityBasedAuthentication, + BaseResource, + BlobContainer, + BlobRestoreParameters, + BlobRestoreRange, + BlobRestoreStatus, + BlobServiceProperties, + ChangeFeed, + CorsRule, + CorsRules, + CustomDomain, + DateAfterCreation, + DateAfterModification, + DeleteRetentionPolicy, + Encryption, + EncryptionScope, + EncryptionScopeKeyVaultProperties, + EncryptionService, + EncryptionServices, + Endpoints, + ErrorResponse, + FileServiceProperties, + FileShare, + FileShareItem, + GeoReplicationStats, + Identity, + ImmutabilityPolicy, + ImmutabilityPolicyProperties, + IPRule, + KeyVaultProperties, + LegalHoldProperties, + ListContainerItem, + ManagementPolicy, + ManagementPolicyAction, + ManagementPolicyBaseBlob, + ManagementPolicyDefinition, + ManagementPolicyFilter, + ManagementPolicyRule, + ManagementPolicySchema, + ManagementPolicySnapShot, + NetworkRuleSet, + ObjectReplicationPolicies, + ObjectReplicationPolicy, + ObjectReplicationPolicyFilter, + ObjectReplicationPolicyRule, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateLinkResource, + PrivateLinkServiceConnectionState, + ProxyResource, + Resource, + RestorePolicyProperties, + RoutingPreference, + Sku, + StorageAccount, + StorageAccountInternetEndpoints, + StorageAccountMicrosoftEndpoints, + TagFilter, + TagProperty, + TrackedResource, + UpdateHistoryProperty, + VirtualNetworkRule +} from "../models/mappers"; diff --git a/sdk/storage/arm-storage/src/models/parameters.ts b/sdk/storage/arm-storage/src/models/parameters.ts index f5c7e2fa39b6..38e6d36a2533 100644 --- a/sdk/storage/arm-storage/src/models/parameters.ts +++ b/sdk/storage/arm-storage/src/models/parameters.ts @@ -118,6 +118,36 @@ export const expand1: msRest.OperationQueryParameter = { } } }; +export const expand2: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "expand" + ], + mapper: { + serializedName: "$expand", + type: { + name: "Enum", + allowedValues: [ + "deleted" + ] + } + } +}; +export const expand3: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "expand" + ], + mapper: { + serializedName: "$expand", + type: { + name: "Enum", + allowedValues: [ + "stats" + ] + } + } +}; export const fileServicesName: msRest.OperationURLParameter = { parameterPath: "fileServicesName", mapper: { @@ -221,6 +251,19 @@ export const nextPageLink: msRest.OperationURLParameter = { }, skipEncoding: true }; +export const objectReplicationPolicyId: msRest.OperationURLParameter = { + parameterPath: "objectReplicationPolicyId", + mapper: { + required: true, + serializedName: "objectReplicationPolicyId", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + } +}; export const privateEndpointConnectionName: msRest.OperationURLParameter = { parameterPath: "privateEndpointConnectionName", mapper: { diff --git a/sdk/storage/arm-storage/src/models/privateEndpointConnectionsMappers.ts b/sdk/storage/arm-storage/src/models/privateEndpointConnectionsMappers.ts index ade001101396..48d725d8a1a9 100644 --- a/sdk/storage/arm-storage/src/models/privateEndpointConnectionsMappers.ts +++ b/sdk/storage/arm-storage/src/models/privateEndpointConnectionsMappers.ts @@ -50,6 +50,9 @@ export { ManagementPolicySchema, ManagementPolicySnapShot, NetworkRuleSet, + ObjectReplicationPolicy, + ObjectReplicationPolicyFilter, + ObjectReplicationPolicyRule, PrivateEndpoint, PrivateEndpointConnection, PrivateLinkResource, @@ -62,6 +65,7 @@ export { StorageAccount, StorageAccountInternetEndpoints, StorageAccountMicrosoftEndpoints, + TagFilter, TagProperty, TrackedResource, UpdateHistoryProperty, diff --git a/sdk/storage/arm-storage/src/models/privateLinkResourcesMappers.ts b/sdk/storage/arm-storage/src/models/privateLinkResourcesMappers.ts index 07454a28f91a..5f7c0e9e4022 100644 --- a/sdk/storage/arm-storage/src/models/privateLinkResourcesMappers.ts +++ b/sdk/storage/arm-storage/src/models/privateLinkResourcesMappers.ts @@ -50,6 +50,9 @@ export { ManagementPolicySchema, ManagementPolicySnapShot, NetworkRuleSet, + ObjectReplicationPolicy, + ObjectReplicationPolicyFilter, + ObjectReplicationPolicyRule, PrivateEndpoint, PrivateEndpointConnection, PrivateLinkResource, @@ -63,6 +66,7 @@ export { StorageAccount, StorageAccountInternetEndpoints, StorageAccountMicrosoftEndpoints, + TagFilter, TagProperty, TrackedResource, UpdateHistoryProperty, diff --git a/sdk/storage/arm-storage/src/models/storageAccountsMappers.ts b/sdk/storage/arm-storage/src/models/storageAccountsMappers.ts index dd059a1dd293..2a844a4c8970 100644 --- a/sdk/storage/arm-storage/src/models/storageAccountsMappers.ts +++ b/sdk/storage/arm-storage/src/models/storageAccountsMappers.ts @@ -54,6 +54,9 @@ export { ManagementPolicySchema, ManagementPolicySnapShot, NetworkRuleSet, + ObjectReplicationPolicy, + ObjectReplicationPolicyFilter, + ObjectReplicationPolicyRule, PrivateEndpoint, PrivateEndpointConnection, PrivateLinkResource, @@ -74,6 +77,7 @@ export { StorageAccountMicrosoftEndpoints, StorageAccountRegenerateKeyParameters, StorageAccountUpdateParameters, + TagFilter, TagProperty, TrackedResource, UpdateHistoryProperty, diff --git a/sdk/storage/arm-storage/src/operations/fileShares.ts b/sdk/storage/arm-storage/src/operations/fileShares.ts index 4aa2b2e10b9a..0b7e466add49 100644 --- a/sdk/storage/arm-storage/src/operations/fileShares.ts +++ b/sdk/storage/arm-storage/src/operations/fileShares.ts @@ -80,10 +80,11 @@ export class FileShares { * names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash * (-) only. Every dash (-) character must be immediately preceded and followed by a letter or * number. + * @param fileShare Properties of the file share to create. * @param [options] The optional parameters * @returns Promise */ - create(resourceGroupName: string, accountName: string, shareName: string, options?: Models.FileSharesCreateOptionalParams): Promise; + create(resourceGroupName: string, accountName: string, shareName: string, fileShare: Models.FileShare, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group within the user's subscription. The name * is case insensitive. @@ -94,9 +95,10 @@ export class FileShares { * names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash * (-) only. Every dash (-) character must be immediately preceded and followed by a letter or * number. + * @param fileShare Properties of the file share to create. * @param callback The callback */ - create(resourceGroupName: string, accountName: string, shareName: string, callback: msRest.ServiceCallback): void; + create(resourceGroupName: string, accountName: string, shareName: string, fileShare: Models.FileShare, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group within the user's subscription. The name * is case insensitive. @@ -107,16 +109,18 @@ export class FileShares { * names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash * (-) only. Every dash (-) character must be immediately preceded and followed by a letter or * number. + * @param fileShare Properties of the file share to create. * @param options The optional parameters * @param callback The callback */ - create(resourceGroupName: string, accountName: string, shareName: string, options: Models.FileSharesCreateOptionalParams, callback: msRest.ServiceCallback): void; - create(resourceGroupName: string, accountName: string, shareName: string, options?: Models.FileSharesCreateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + create(resourceGroupName: string, accountName: string, shareName: string, fileShare: Models.FileShare, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + create(resourceGroupName: string, accountName: string, shareName: string, fileShare: Models.FileShare, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, shareName, + fileShare, options }, createOperationSpec, @@ -135,10 +139,11 @@ export class FileShares { * names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash * (-) only. Every dash (-) character must be immediately preceded and followed by a letter or * number. + * @param fileShare Properties to update for the file share. * @param [options] The optional parameters * @returns Promise */ - update(resourceGroupName: string, accountName: string, shareName: string, options?: Models.FileSharesUpdateOptionalParams): Promise; + update(resourceGroupName: string, accountName: string, shareName: string, fileShare: Models.FileShare, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group within the user's subscription. The name * is case insensitive. @@ -149,9 +154,10 @@ export class FileShares { * names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash * (-) only. Every dash (-) character must be immediately preceded and followed by a letter or * number. + * @param fileShare Properties to update for the file share. * @param callback The callback */ - update(resourceGroupName: string, accountName: string, shareName: string, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, accountName: string, shareName: string, fileShare: Models.FileShare, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group within the user's subscription. The name * is case insensitive. @@ -162,16 +168,18 @@ export class FileShares { * names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash * (-) only. Every dash (-) character must be immediately preceded and followed by a letter or * number. + * @param fileShare Properties to update for the file share. * @param options The optional parameters * @param callback The callback */ - update(resourceGroupName: string, accountName: string, shareName: string, options: Models.FileSharesUpdateOptionalParams, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, accountName: string, shareName: string, options?: Models.FileSharesUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update(resourceGroupName: string, accountName: string, shareName: string, fileShare: Models.FileShare, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, accountName: string, shareName: string, fileShare: Models.FileShare, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, shareName, + fileShare, options }, updateOperationSpec, @@ -192,7 +200,7 @@ export class FileShares { * @param [options] The optional parameters * @returns Promise */ - get(resourceGroupName: string, accountName: string, shareName: string, options?: msRest.RequestOptionsBase): Promise; + get(resourceGroupName: string, accountName: string, shareName: string, options?: Models.FileSharesGetOptionalParams): Promise; /** * @param resourceGroupName The name of the resource group within the user's subscription. The name * is case insensitive. @@ -219,8 +227,8 @@ export class FileShares { * @param options The optional parameters * @param callback The callback */ - get(resourceGroupName: string, accountName: string, shareName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, accountName: string, shareName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get(resourceGroupName: string, accountName: string, shareName: string, options: Models.FileSharesGetOptionalParams, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, accountName: string, shareName: string, options?: Models.FileSharesGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -286,6 +294,71 @@ export class FileShares { callback); } + /** + * Restore a file share within a valid retention days if share soft delete is enabled + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param shareName The name of the file share within the specified storage account. File share + * names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash + * (-) only. Every dash (-) character must be immediately preceded and followed by a letter or + * number. + * @param deletedShareName Required. Identify the name of the deleted share that will be restored. + * @param deletedShareVersion Required. Identify the version of the deleted share that will be + * restored. + * @param [options] The optional parameters + * @returns Promise + */ + restore(resourceGroupName: string, accountName: string, shareName: string, deletedShareName: string, deletedShareVersion: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param shareName The name of the file share within the specified storage account. File share + * names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash + * (-) only. Every dash (-) character must be immediately preceded and followed by a letter or + * number. + * @param deletedShareName Required. Identify the name of the deleted share that will be restored. + * @param deletedShareVersion Required. Identify the version of the deleted share that will be + * restored. + * @param callback The callback + */ + restore(resourceGroupName: string, accountName: string, shareName: string, deletedShareName: string, deletedShareVersion: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param shareName The name of the file share within the specified storage account. File share + * names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash + * (-) only. Every dash (-) character must be immediately preceded and followed by a letter or + * number. + * @param deletedShareName Required. Identify the name of the deleted share that will be restored. + * @param deletedShareVersion Required. Identify the version of the deleted share that will be + * restored. + * @param options The optional parameters + * @param callback The callback + */ + restore(resourceGroupName: string, accountName: string, shareName: string, deletedShareName: string, deletedShareVersion: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + restore(resourceGroupName: string, accountName: string, shareName: string, deletedShareName: string, deletedShareVersion: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + shareName, + deletedShareName, + deletedShareVersion, + options + }, + restoreOperationSpec, + callback); + } + /** * Lists all shares. * @param nextPageLink The NextLink from the previous successful call to List operation. @@ -328,7 +401,8 @@ const listOperationSpec: msRest.OperationSpec = { queryParameters: [ Parameters.apiVersion, Parameters.maxpagesize, - Parameters.filter + Parameters.filter, + Parameters.expand2 ], headerParameters: [ Parameters.acceptLanguage @@ -360,16 +434,7 @@ const createOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], requestBody: { - parameterPath: { - metadata: [ - "options", - "metadata" - ], - shareQuota: [ - "options", - "shareQuota" - ] - }, + parameterPath: "fileShare", mapper: { ...Mappers.FileShare, required: true @@ -405,16 +470,7 @@ const updateOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], requestBody: { - parameterPath: { - metadata: [ - "options", - "metadata" - ], - shareQuota: [ - "options", - "shareQuota" - ] - }, + parameterPath: "fileShare", mapper: { ...Mappers.FileShare, required: true @@ -441,7 +497,8 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion, + Parameters.expand3 ], headerParameters: [ Parameters.acceptLanguage @@ -482,6 +539,40 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { serializer }; +const restoreOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.shareName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + deletedShareName: "deletedShareName", + deletedShareVersion: "deletedShareVersion" + }, + mapper: { + ...Mappers.DeletedShare, + required: true + } + }, + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + const listNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", diff --git a/sdk/storage/arm-storage/src/operations/index.ts b/sdk/storage/arm-storage/src/operations/index.ts index af5df33ba851..1c0df5536191 100644 --- a/sdk/storage/arm-storage/src/operations/index.ts +++ b/sdk/storage/arm-storage/src/operations/index.ts @@ -15,6 +15,7 @@ export * from "./usages"; export * from "./managementPolicies"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; +export * from "./objectReplicationPoliciesOperations"; export * from "./encryptionScopes"; export * from "./blobServices"; export * from "./blobContainers"; diff --git a/sdk/storage/arm-storage/src/operations/objectReplicationPoliciesOperations.ts b/sdk/storage/arm-storage/src/operations/objectReplicationPoliciesOperations.ts new file mode 100644 index 000000000000..f62c6b9045f1 --- /dev/null +++ b/sdk/storage/arm-storage/src/operations/objectReplicationPoliciesOperations.ts @@ -0,0 +1,331 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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/objectReplicationPoliciesOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { StorageManagementClientContext } from "../storageManagementClientContext"; + +/** Class representing a ObjectReplicationPoliciesOperations. */ +export class ObjectReplicationPoliciesOperations { + private readonly client: StorageManagementClientContext; + + /** + * Create a ObjectReplicationPoliciesOperations. + * @param {StorageManagementClientContext} client Reference to the service client. + */ + constructor(client: StorageManagementClientContext) { + this.client = client; + } + + /** + * List the object replication policies associated with the storage account. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param callback The callback + */ + list(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Get the object replication policy of the storage account by policy ID. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy + * ID is unknown. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, accountName: string, objectReplicationPolicyId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy + * ID is unknown. + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, objectReplicationPolicyId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy + * ID is unknown. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, objectReplicationPolicyId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, accountName: string, objectReplicationPolicyId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + objectReplicationPolicyId, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Create or update the object replication policy of the storage account. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy + * ID is unknown. + * @param properties The object replication policy set to a storage account. A unique policy ID + * will be created if absent. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, accountName: string, objectReplicationPolicyId: string, properties: Models.ObjectReplicationPolicy, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy + * ID is unknown. + * @param properties The object replication policy set to a storage account. A unique policy ID + * will be created if absent. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, accountName: string, objectReplicationPolicyId: string, properties: Models.ObjectReplicationPolicy, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy + * ID is unknown. + * @param properties The object replication policy set to a storage account. A unique policy ID + * will be created if absent. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, accountName: string, objectReplicationPolicyId: string, properties: Models.ObjectReplicationPolicy, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, objectReplicationPolicyId: string, properties: Models.ObjectReplicationPolicy, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + objectReplicationPolicyId, + properties, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Deletes the object replication policy associated with the specified storage account. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy + * ID is unknown. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, accountName: string, objectReplicationPolicyId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy + * ID is unknown. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, objectReplicationPolicyId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy + * ID is unknown. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, objectReplicationPolicyId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, objectReplicationPolicyId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + objectReplicationPolicyId, + options + }, + deleteMethodOperationSpec, + callback); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ObjectReplicationPolicies + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.objectReplicationPolicyId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ObjectReplicationPolicy + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.objectReplicationPolicyId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "properties", + mapper: { + ...Mappers.ObjectReplicationPolicy, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ObjectReplicationPolicy + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.objectReplicationPolicyId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/storage/arm-storage/src/storageManagementClient.ts b/sdk/storage/arm-storage/src/storageManagementClient.ts index 7277405a90f2..b3d91941a14c 100644 --- a/sdk/storage/arm-storage/src/storageManagementClient.ts +++ b/sdk/storage/arm-storage/src/storageManagementClient.ts @@ -24,6 +24,7 @@ class StorageManagementClient extends StorageManagementClientContext { managementPolicies: operations.ManagementPolicies; privateEndpointConnections: operations.PrivateEndpointConnections; privateLinkResources: operations.PrivateLinkResources; + objectReplicationPolicies: operations.ObjectReplicationPoliciesOperations; encryptionScopes: operations.EncryptionScopes; blobServices: operations.BlobServices; blobContainers: operations.BlobContainers; @@ -45,6 +46,7 @@ class StorageManagementClient extends StorageManagementClientContext { this.managementPolicies = new operations.ManagementPolicies(this); this.privateEndpointConnections = new operations.PrivateEndpointConnections(this); this.privateLinkResources = new operations.PrivateLinkResources(this); + this.objectReplicationPolicies = new operations.ObjectReplicationPoliciesOperations(this); this.encryptionScopes = new operations.EncryptionScopes(this); this.blobServices = new operations.BlobServices(this); this.blobContainers = new operations.BlobContainers(this);