Class: Azure::Storage::Mgmt::V2021_01_01::BlobContainers

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb

Overview

The Azure Storage Management API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ BlobContainers

Creates and initializes a new instance of the BlobContainers class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientStorageManagementClient (readonly)

Returns reference to the StorageManagementClient.

Returns:



22
23
24
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 22

def client
  @client
end

Instance Method Details

Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. a blob container. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • legal_hold (LegalHold)

    The LegalHold property that will be clear from

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (LegalHold)

    operation results.



882
883
884
885
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 882

def clear_legal_hold(resource_group_name, , container_name, legal_hold, custom_headers:nil)
  response = clear_legal_hold_async(resource_group_name, , container_name, legal_hold, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. a blob container. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • legal_hold (LegalHold)

    The LegalHold property that will be clear from

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 935

def clear_legal_hold_async(resource_group_name, , container_name, legal_hold, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !.nil? && .length > 24
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
  fail ArgumentError, 'legal_hold is nil' if legal_hold.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::LegalHold.mapper()
  request_content = @client.serialize(request_mapper,  legal_hold)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'accountName' => ,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::LegalHold.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. a blob container. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • legal_hold (LegalHold)

    The LegalHold property that will be clear from

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



909
910
911
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 909

def clear_legal_hold_with_http_info(resource_group_name, , container_name, legal_hold, custom_headers:nil)
  clear_legal_hold_async(resource_group_name, , container_name, legal_hold, custom_headers:custom_headers).value!
end

#create(resource_group_name, account_name, container_name, blob_container, custom_headers: nil) ⇒ BlobContainer

Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. create. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • blob_container (BlobContainer)

    Properties of the blob container to

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (BlobContainer)

    operation results.



181
182
183
184
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 181

def create(resource_group_name, , container_name, blob_container, custom_headers:nil)
  response = create_async(resource_group_name, , container_name, blob_container, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_async(resource_group_name, account_name, container_name, blob_container, custom_headers: nil) ⇒ Concurrent::Promise

Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. create. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • blob_container (BlobContainer)

    Properties of the blob container to

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 236

def create_async(resource_group_name, , container_name, blob_container, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !.nil? && .length > 24
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
  fail ArgumentError, 'blob_container is nil' if blob_container.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::BlobContainer.mapper()
  request_content = @client.serialize(request_mapper,  blob_container)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'accountName' => ,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::BlobContainer.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::BlobContainer.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#create_or_update_immutability_policy(resource_group_name, account_name, container_name, parameters: nil, if_match: nil, custom_headers: nil) ⇒ ImmutabilityPolicy

Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. will be created or updated to a blob container. policy to update. A value of “*” can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • parameters (ImmutabilityPolicy) (defaults to: nil)

    The ImmutabilityPolicy Properties that

  • if_match (String) (defaults to: nil)

    The entity state (ETag) version of the immutability

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ImmutabilityPolicy)

    operation results.



1033
1034
1035
1036
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1033

def create_or_update_immutability_policy(resource_group_name, , container_name, parameters:nil, if_match:nil, custom_headers:nil)
  response = create_or_update_immutability_policy_async(resource_group_name, , container_name, parameters:parameters, if_match:if_match, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_immutability_policy_async(resource_group_name, account_name, container_name, parameters: nil, if_match: nil, custom_headers: nil) ⇒ Concurrent::Promise

Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. will be created or updated to a blob container. policy to update. A value of “*” can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • parameters (ImmutabilityPolicy) (defaults to: nil)

    The ImmutabilityPolicy Properties that

  • if_match (String) (defaults to: nil)

    The entity state (ETag) version of the immutability

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1092

def create_or_update_immutability_policy_async(resource_group_name, , container_name, parameters:nil, if_match:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !.nil? && .length > 24
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
  immutability_policy_name = 'default'
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['If-Match'] = if_match unless if_match.nil?
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::ImmutabilityPolicy.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'accountName' => ,'containerName' => container_name,'immutabilityPolicyName' => immutability_policy_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::ImmutabilityPolicy.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#create_or_update_immutability_policy_with_http_info(resource_group_name, account_name, container_name, parameters: nil, if_match: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. will be created or updated to a blob container. policy to update. A value of “*” can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • parameters (ImmutabilityPolicy) (defaults to: nil)

    The ImmutabilityPolicy Properties that

  • if_match (String) (defaults to: nil)

    The entity state (ETag) version of the immutability

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1063
1064
1065
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1063

def create_or_update_immutability_policy_with_http_info(resource_group_name, , container_name, parameters:nil, if_match:nil, custom_headers:nil)
  create_or_update_immutability_policy_async(resource_group_name, , container_name, parameters:parameters, if_match:if_match, custom_headers:custom_headers).value!
end

#create_with_http_info(resource_group_name, account_name, container_name, blob_container, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. create. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • blob_container (BlobContainer)

    Properties of the blob container to

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



209
210
211
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 209

def create_with_http_info(resource_group_name, , container_name, blob_container, custom_headers:nil)
  create_async(resource_group_name, , container_name, blob_container, custom_headers:custom_headers).value!
end

#delete(resource_group_name, account_name, container_name, custom_headers: nil) ⇒ Object

Deletes specified container under its account.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



612
613
614
615
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 612

def delete(resource_group_name, , container_name, custom_headers:nil)
  response = delete_async(resource_group_name, , container_name, custom_headers:custom_headers).value!
  nil
end

#delete_async(resource_group_name, account_name, container_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes specified container under its account.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 657

def delete_async(resource_group_name, , container_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !.nil? && .length > 24
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'accountName' => ,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#delete_immutability_policy(resource_group_name, account_name, container_name, if_match, custom_headers: nil) ⇒ ImmutabilityPolicy

Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. policy to update. A value of “*” can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • if_match (String)

    The entity state (ETag) version of the immutability

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ImmutabilityPolicy)

    operation results.



1337
1338
1339
1340
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1337

def delete_immutability_policy(resource_group_name, , container_name, if_match, custom_headers:nil)
  response = delete_immutability_policy_async(resource_group_name, , container_name, if_match, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#delete_immutability_policy_async(resource_group_name, account_name, container_name, if_match, custom_headers: nil) ⇒ Concurrent::Promise

Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. policy to update. A value of “*” can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • if_match (String)

    The entity state (ETag) version of the immutability

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1398

def delete_immutability_policy_async(resource_group_name, , container_name, if_match, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !.nil? && .length > 24
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
  immutability_policy_name = 'default'
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
  fail ArgumentError, 'if_match is nil' if if_match.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['If-Match'] = if_match unless if_match.nil?
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'accountName' => ,'containerName' => container_name,'immutabilityPolicyName' => immutability_policy_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::ImmutabilityPolicy.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#delete_immutability_policy_with_http_info(resource_group_name, account_name, container_name, if_match, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. policy to update. A value of “*” can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • if_match (String)

    The entity state (ETag) version of the immutability

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1368
1369
1370
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1368

def delete_immutability_policy_with_http_info(resource_group_name, , container_name, if_match, custom_headers:nil)
  delete_immutability_policy_async(resource_group_name, , container_name, if_match, custom_headers:custom_headers).value!
end

#delete_with_http_info(resource_group_name, account_name, container_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes specified container under its account.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



635
636
637
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 635

def delete_with_http_info(resource_group_name, , container_name, custom_headers:nil)
  delete_async(resource_group_name, , container_name, custom_headers:custom_headers).value!
end

#extend_immutability_policy(resource_group_name, account_name, container_name, if_match, parameters: nil, custom_headers: nil) ⇒ ImmutabilityPolicy

Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. policy to update. A value of “*” can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. will be extended for a blob container. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • if_match (String)

    The entity state (ETag) version of the immutability

  • parameters (ImmutabilityPolicy) (defaults to: nil)

    The ImmutabilityPolicy Properties that

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ImmutabilityPolicy)

    operation results.



1640
1641
1642
1643
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1640

def extend_immutability_policy(resource_group_name, , container_name, if_match, parameters:nil, custom_headers:nil)
  response = extend_immutability_policy_async(resource_group_name, , container_name, if_match, parameters:parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#extend_immutability_policy_async(resource_group_name, account_name, container_name, if_match, parameters: nil, custom_headers: nil) ⇒ Concurrent::Promise

Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. policy to update. A value of “*” can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. will be extended for a blob container. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • if_match (String)

    The entity state (ETag) version of the immutability

  • parameters (ImmutabilityPolicy) (defaults to: nil)

    The ImmutabilityPolicy Properties that

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1701

def extend_immutability_policy_async(resource_group_name, , container_name, if_match, parameters:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !.nil? && .length > 24
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
  fail ArgumentError, 'if_match is nil' if if_match.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['If-Match'] = if_match unless if_match.nil?
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::ImmutabilityPolicy.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'accountName' => ,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::ImmutabilityPolicy.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#extend_immutability_policy_with_http_info(resource_group_name, account_name, container_name, if_match, parameters: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. policy to update. A value of “*” can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. will be extended for a blob container. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • if_match (String)

    The entity state (ETag) version of the immutability

  • parameters (ImmutabilityPolicy) (defaults to: nil)

    The ImmutabilityPolicy Properties that

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1671
1672
1673
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1671

def extend_immutability_policy_with_http_info(resource_group_name, , container_name, if_match, parameters:nil, custom_headers:nil)
  extend_immutability_policy_async(resource_group_name, , container_name, if_match, parameters:parameters, custom_headers:custom_headers).value!
end

#get(resource_group_name, account_name, container_name, custom_headers: nil) ⇒ BlobContainer

Gets properties of a specified container.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (BlobContainer)

    operation results.



485
486
487
488
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 485

def get(resource_group_name, , container_name, custom_headers:nil)
  response = get_async(resource_group_name, , container_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, account_name, container_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets properties of a specified container.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 530

def get_async(resource_group_name, , container_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !.nil? && .length > 24
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'accountName' => ,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::BlobContainer.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_immutability_policy(resource_group_name, account_name, container_name, if_match: nil, custom_headers: nil) ⇒ ImmutabilityPolicy

Gets the existing immutability policy along with the corresponding ETag in response headers and body.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. policy to update. A value of “*” can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • if_match (String) (defaults to: nil)

    The entity state (ETag) version of the immutability

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ImmutabilityPolicy)

    operation results.



1189
1190
1191
1192
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1189

def get_immutability_policy(resource_group_name, , container_name, if_match:nil, custom_headers:nil)
  response = get_immutability_policy_async(resource_group_name, , container_name, if_match:if_match, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_immutability_policy_async(resource_group_name, account_name, container_name, if_match: nil, custom_headers: nil) ⇒ Concurrent::Promise

Gets the existing immutability policy along with the corresponding ETag in response headers and body.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. policy to update. A value of “*” can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • if_match (String) (defaults to: nil)

    The entity state (ETag) version of the immutability

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1244

def get_immutability_policy_async(resource_group_name, , container_name, if_match:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !.nil? && .length > 24
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
  immutability_policy_name = 'default'
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['If-Match'] = if_match unless if_match.nil?
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'accountName' => ,'containerName' => container_name,'immutabilityPolicyName' => immutability_policy_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::ImmutabilityPolicy.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_immutability_policy_with_http_info(resource_group_name, account_name, container_name, if_match: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the existing immutability policy along with the corresponding ETag in response headers and body.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. policy to update. A value of “*” can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • if_match (String) (defaults to: nil)

    The entity state (ETag) version of the immutability

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1217
1218
1219
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1217

def get_immutability_policy_with_http_info(resource_group_name, , container_name, if_match:nil, custom_headers:nil)
  get_immutability_policy_async(resource_group_name, , container_name, if_match:if_match, custom_headers:custom_headers).value!
end

#get_with_http_info(resource_group_name, account_name, container_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets properties of a specified container.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



508
509
510
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 508

def get_with_http_info(resource_group_name, , container_name, custom_headers:nil)
  get_async(resource_group_name, , container_name, custom_headers:custom_headers).value!
end

#lease(resource_group_name, account_name, container_name, parameters: nil, custom_headers: nil) ⇒ LeaseContainerResponse

The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • parameters (LeaseContainerRequest) (defaults to: nil)

    Lease Container request body.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (LeaseContainerResponse)

    operation results.



1796
1797
1798
1799
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1796

def lease(resource_group_name, , container_name, parameters:nil, custom_headers:nil)
  response = lease_async(resource_group_name, , container_name, parameters:parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#lease_async(resource_group_name, account_name, container_name, parameters: nil, custom_headers: nil) ⇒ Concurrent::Promise

The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • parameters (LeaseContainerRequest) (defaults to: nil)

    Lease Container request body.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1847

def lease_async(resource_group_name, , container_name, parameters:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !.nil? && .length > 24
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::LeaseContainerRequest.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'accountName' => ,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::LeaseContainerResponse.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#lease_with_http_info(resource_group_name, account_name, container_name, parameters: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • parameters (LeaseContainerRequest) (defaults to: nil)

    Lease Container request body.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1822
1823
1824
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1822

def lease_with_http_info(resource_group_name, , container_name, parameters:nil, custom_headers:nil)
  lease_async(resource_group_name, , container_name, parameters:parameters, custom_headers:custom_headers).value!
end

#list(resource_group_name, account_name, maxpagesize: nil, filter: nil, include: nil, custom_headers: nil) ⇒ Array<ListContainerItem>

Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. that can be included in the list. starting with the filter will be listed. properties for soft deleted blob containers. Possible values include: ‘deleted’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • maxpagesize (String) (defaults to: nil)

    Optional. Specified maximum number of containers

  • filter (String) (defaults to: nil)

    Optional. When specified, only container names

  • include (ListContainersInclude) (defaults to: nil)

    Optional, used to include the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<ListContainerItem>)

    operation results.



45
46
47
48
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 45

def list(resource_group_name, , maxpagesize:nil, filter:nil, include:nil, custom_headers:nil)
  first_page = list_as_lazy(resource_group_name, , maxpagesize:maxpagesize, filter:filter, include:include, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_as_lazy(resource_group_name, account_name, maxpagesize: nil, filter: nil, include: nil, custom_headers: nil) ⇒ ListContainerItems

Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. that can be included in the list. starting with the filter will be listed. properties for soft deleted blob containers. Possible values include: ‘deleted’ will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • maxpagesize (String) (defaults to: nil)

    Optional. Specified maximum number of containers

  • filter (String) (defaults to: nil)

    Optional. When specified, only container names

  • include (ListContainersInclude) (defaults to: nil)

    Optional, used to include the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ListContainerItems)

    which provide lazy access to pages of the



2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 2034

def list_as_lazy(resource_group_name, , maxpagesize:nil, filter:nil, include:nil, custom_headers:nil)
  response = list_async(resource_group_name, , maxpagesize:maxpagesize, filter:filter, include:include, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_async(resource_group_name, account_name, maxpagesize: nil, filter: nil, include: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. that can be included in the list. starting with the filter will be listed. properties for soft deleted blob containers. Possible values include: ‘deleted’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • maxpagesize (String) (defaults to: nil)

    Optional. Specified maximum number of containers

  • filter (String) (defaults to: nil)

    Optional. When specified, only container names

  • include (ListContainersInclude) (defaults to: nil)

    Optional, used to include the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 96

def list_async(resource_group_name, , maxpagesize:nil, filter:nil, include:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !.nil? && .length > 24
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'accountName' => ,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version,'$maxpagesize' => maxpagesize,'$filter' => filter,'$include' => include},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::ListContainerItems.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_next(next_page_link, custom_headers: nil) ⇒ ListContainerItems

Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ListContainerItems)

    operation results.



1930
1931
1932
1933
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1930

def list_next(next_page_link, custom_headers:nil)
  response = list_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1961

def list_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::ListContainerItems.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1946
1947
1948
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1946

def list_next_with_http_info(next_page_link, custom_headers:nil)
  list_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_with_http_info(resource_group_name, account_name, maxpagesize: nil, filter: nil, include: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. that can be included in the list. starting with the filter will be listed. properties for soft deleted blob containers. Possible values include: ‘deleted’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • maxpagesize (String) (defaults to: nil)

    Optional. Specified maximum number of containers

  • filter (String) (defaults to: nil)

    Optional. When specified, only container names

  • include (ListContainersInclude) (defaults to: nil)

    Optional, used to include the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



71
72
73
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 71

def list_with_http_info(resource_group_name, , maxpagesize:nil, filter:nil, include:nil, custom_headers:nil)
  list_async(resource_group_name, , maxpagesize:maxpagesize, filter:filter, include:include, custom_headers:custom_headers).value!
end

#lock_immutability_policy(resource_group_name, account_name, container_name, if_match, custom_headers: nil) ⇒ ImmutabilityPolicy

Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. policy to update. A value of “*” can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • if_match (String)

    The entity state (ETag) version of the immutability

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ImmutabilityPolicy)

    operation results.



1490
1491
1492
1493
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1490

def lock_immutability_policy(resource_group_name, , container_name, if_match, custom_headers:nil)
  response = lock_immutability_policy_async(resource_group_name, , container_name, if_match, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#lock_immutability_policy_async(resource_group_name, account_name, container_name, if_match, custom_headers: nil) ⇒ Concurrent::Promise

Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. policy to update. A value of “*” can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • if_match (String)

    The entity state (ETag) version of the immutability

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1547

def lock_immutability_policy_async(resource_group_name, , container_name, if_match, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !.nil? && .length > 24
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
  fail ArgumentError, 'if_match is nil' if if_match.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['If-Match'] = if_match unless if_match.nil?
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'accountName' => ,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::ImmutabilityPolicy.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#lock_immutability_policy_with_http_info(resource_group_name, account_name, container_name, if_match, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. policy to update. A value of “*” can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • if_match (String)

    The entity state (ETag) version of the immutability

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1519
1520
1521
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 1519

def lock_immutability_policy_with_http_info(resource_group_name, , container_name, if_match, custom_headers:nil)
  lock_immutability_policy_async(resource_group_name, , container_name, if_match, custom_headers:custom_headers).value!
end

Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. blob container. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • legal_hold (LegalHold)

    The LegalHold property that will be set to a

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (LegalHold)

    operation results.



734
735
736
737
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 734

def set_legal_hold(resource_group_name, , container_name, legal_hold, custom_headers:nil)
  response = set_legal_hold_async(resource_group_name, , container_name, legal_hold, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. blob container. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • legal_hold (LegalHold)

    The LegalHold property that will be set to a

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 787

def set_legal_hold_async(resource_group_name, , container_name, legal_hold, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !.nil? && .length > 24
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
  fail ArgumentError, 'legal_hold is nil' if legal_hold.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::LegalHold.mapper()
  request_content = @client.serialize(request_mapper,  legal_hold)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'accountName' => ,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::LegalHold.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. blob container. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • legal_hold (LegalHold)

    The LegalHold property that will be set to a

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



761
762
763
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 761

def set_legal_hold_with_http_info(resource_group_name, , container_name, legal_hold, custom_headers:nil)
  set_legal_hold_async(resource_group_name, , container_name, legal_hold, custom_headers:custom_headers).value!
end

#update(resource_group_name, account_name, container_name, blob_container, custom_headers: nil) ⇒ BlobContainer

Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn’t already exist.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. container. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • blob_container (BlobContainer)

    Properties to update for the blob

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (BlobContainer)

    operation results.



341
342
343
344
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 341

def update(resource_group_name, , container_name, blob_container, custom_headers:nil)
  response = update_async(resource_group_name, , container_name, blob_container, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, account_name, container_name, blob_container, custom_headers: nil) ⇒ Concurrent::Promise

Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn’t already exist.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. container. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • blob_container (BlobContainer)

    Properties to update for the blob

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 394

def update_async(resource_group_name, , container_name, blob_container, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !.nil? && .length > 24
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
  fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
  fail ArgumentError, 'blob_container is nil' if blob_container.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::BlobContainer.mapper()
  request_content = @client.serialize(request_mapper,  blob_container)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'accountName' => ,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2021_01_01::Models::BlobContainer.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update_with_http_info(resource_group_name, account_name, container_name, blob_container, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn’t already exist.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. specified storage account. Blob container 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. container. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • container_name (String)

    The name of the blob container within the

  • blob_container (BlobContainer)

    Properties to update for the blob

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



368
369
370
# File 'lib/2021-01-01/generated/azure_mgmt_storage/blob_containers.rb', line 368

def update_with_http_info(resource_group_name, , container_name, blob_container, custom_headers:nil)
  update_async(resource_group_name, , container_name, blob_container, custom_headers:custom_headers).value!
end