Class: Azure::ContainerRegistry::Mgmt::V2017_10_01::Registries

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb

Overview

Registries

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Registries

Creates and initializes a new instance of the Registries class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientContainerRegistryManagementClient (readonly)

Returns reference to the ContainerRegistryManagementClient.

Returns:



22
23
24
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 22

def client
  @client
end

Instance Method Details

#begin_create(resource_group_name, registry_name, registry, custom_headers: nil) ⇒ Registry

Creates a container registry with the specified parameters.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • registry (Registry)

    The parameters for creating a container registry.

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

    A hash of custom headers that

Returns:

  • (Registry)

    operation results.



1181
1182
1183
1184
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1181

def begin_create(resource_group_name, registry_name, registry, custom_headers:nil)
  response = begin_create_async(resource_group_name, registry_name, registry, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_async(resource_group_name, registry_name, registry, custom_headers: nil) ⇒ Concurrent::Promise

Creates a container registry with the specified parameters.

the container registry belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • registry (Registry)

    The parameters for creating a container registry.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
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
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1214

def begin_create_async(resource_group_name, registry_name, registry, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, 'registry_name is nil' if registry_name.nil?
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
  fail ArgumentError, 'registry is nil' if registry.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::ContainerRegistry::Mgmt::V2017_10_01::Models::Registry.mapper()
  request_content = @client.serialize(request_mapper,  registry)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name},
      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 || status_code == 201
      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::ContainerRegistry::Mgmt::V2017_10_01::Models::Registry.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 == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ContainerRegistry::Mgmt::V2017_10_01::Models::Registry.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

#begin_create_with_http_info(resource_group_name, registry_name, registry, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates a container registry with the specified parameters.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • registry (Registry)

    The parameters for creating a container registry.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1198
1199
1200
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1198

def begin_create_with_http_info(resource_group_name, registry_name, registry, custom_headers:nil)
  begin_create_async(resource_group_name, registry_name, registry, custom_headers:custom_headers).value!
end

#begin_delete(resource_group_name, registry_name, custom_headers: nil) ⇒ Object

Deletes a container registry.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

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

    A hash of custom headers that



1301
1302
1303
1304
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1301

def begin_delete(resource_group_name, registry_name, custom_headers:nil)
  response = begin_delete_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_async(resource_group_name, registry_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a container registry.

the container registry belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1332

def begin_delete_async(resource_group_name, registry_name, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, 'registry_name is nil' if registry_name.nil?
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name},
      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 == 202 || 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

#begin_delete_with_http_info(resource_group_name, registry_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a container registry.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1317
1318
1319
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1317

def begin_delete_with_http_info(resource_group_name, registry_name, custom_headers:nil)
  begin_delete_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
end

#begin_import_image(resource_group_name, registry_name, parameters, custom_headers: nil) ⇒ Object

Copies an image to this container registry from the specified container registry.

the container registry belongs. to copy and the source container registry. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • parameters (ImportImageParameters)

    The parameters specifying the image

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

    A hash of custom headers that



1075
1076
1077
1078
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1075

def begin_import_image(resource_group_name, registry_name, parameters, custom_headers:nil)
  response = begin_import_image_async(resource_group_name, registry_name, parameters, custom_headers:custom_headers).value!
  nil
end

#begin_import_image_async(resource_group_name, registry_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Copies an image to this container registry from the specified container registry.

the container registry belongs. to copy and the source container registry. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • parameters (ImportImageParameters)

    The parameters specifying the image

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1165
1166
1167
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1112

def begin_import_image_async(resource_group_name, registry_name, parameters, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, 'registry_name is nil' if registry_name.nil?
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.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::ContainerRegistry::Mgmt::V2017_10_01::Models::ImportImageParameters.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.ContainerRegistry/registries/{registryName}/importImage'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name},
      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 || status_code == 202
      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

#begin_import_image_with_http_info(resource_group_name, registry_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Copies an image to this container registry from the specified container registry.

the container registry belongs. to copy and the source container registry. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • parameters (ImportImageParameters)

    The parameters specifying the image

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1094
1095
1096
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1094

def begin_import_image_with_http_info(resource_group_name, registry_name, parameters, custom_headers:nil)
  begin_import_image_async(resource_group_name, registry_name, parameters, custom_headers:custom_headers).value!
end

#begin_update(resource_group_name, registry_name, registry_update_parameters, custom_headers: nil) ⇒ Registry

Updates a container registry with the specified parameters.

the container registry belongs. for updating a container registry. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • registry_update_parameters (RegistryUpdateParameters)

    The parameters

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

    A hash of custom headers that

Returns:

  • (Registry)

    operation results.



1394
1395
1396
1397
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1394

def begin_update(resource_group_name, registry_name, registry_update_parameters, custom_headers:nil)
  response = begin_update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Updates a container registry with the specified parameters.

the container registry belongs. for updating a container registry. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • registry_update_parameters (RegistryUpdateParameters)

    The parameters

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1429

def begin_update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, 'registry_name is nil' if registry_name.nil?
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
  fail ArgumentError, 'registry_update_parameters is nil' if registry_update_parameters.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::ContainerRegistry::Mgmt::V2017_10_01::Models::RegistryUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  registry_update_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name},
      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 || status_code == 201
      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::ContainerRegistry::Mgmt::V2017_10_01::Models::Registry.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 == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ContainerRegistry::Mgmt::V2017_10_01::Models::Registry.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

#begin_update_policies(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers: nil) ⇒ RegistryPolicies

Updates the policies for the specified container registry.

the container registry belongs. for updating policies of a container registry. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • registry_policies_update_parameters (RegistryPolicies)

    The parameters

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

    A hash of custom headers that

Returns:

  • (RegistryPolicies)

    operation results.



1519
1520
1521
1522
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1519

def begin_update_policies(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:nil)
  response = begin_update_policies_async(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_update_policies_async(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Updates the policies for the specified container registry.

the container registry belongs. for updating policies of a container registry. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • registry_policies_update_parameters (RegistryPolicies)

    The parameters

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1613
1614
1615
1616
1617
1618
1619
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1554

def begin_update_policies_async(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, 'registry_name is nil' if registry_name.nil?
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
  fail ArgumentError, 'registry_policies_update_parameters is nil' if registry_policies_update_parameters.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::ContainerRegistry::Mgmt::V2017_10_01::Models::RegistryPolicies.mapper()
  request_content = @client.serialize(request_mapper,  registry_policies_update_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name},
      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 || status_code == 202
      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::ContainerRegistry::Mgmt::V2017_10_01::Models::RegistryPolicies.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

#begin_update_policies_with_http_info(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates the policies for the specified container registry.

the container registry belongs. for updating policies of a container registry. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • registry_policies_update_parameters (RegistryPolicies)

    The parameters

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1537
1538
1539
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1537

def begin_update_policies_with_http_info(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:nil)
  begin_update_policies_async(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:custom_headers).value!
end

#begin_update_with_http_info(resource_group_name, registry_name, registry_update_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates a container registry with the specified parameters.

the container registry belongs. for updating a container registry. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • registry_update_parameters (RegistryUpdateParameters)

    The parameters

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1412
1413
1414
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1412

def begin_update_with_http_info(resource_group_name, registry_name, registry_update_parameters, custom_headers:nil)
  begin_update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers:custom_headers).value!
end

#check_name_availability(registry_name_check_request, custom_headers: nil) ⇒ RegistryNameStatus

Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length.

containing information for the availability request. will be added to the HTTP request.

Parameters:

  • registry_name_check_request (RegistryNameCheckRequest)

    The object

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

    A hash of custom headers that

Returns:

  • (RegistryNameStatus)

    operation results.



81
82
83
84
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 81

def check_name_availability(registry_name_check_request, custom_headers:nil)
  response = check_name_availability_async(registry_name_check_request, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#check_name_availability_async(registry_name_check_request, custom_headers: nil) ⇒ Concurrent::Promise

Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length.

containing information for the availability request. to the HTTP request.

Parameters:

  • registry_name_check_request (RegistryNameCheckRequest)

    The object

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 114

def check_name_availability_async(registry_name_check_request, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'registry_name_check_request is nil' if registry_name_check_request.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::ContainerRegistry::Mgmt::V2017_10_01::Models::RegistryNameCheckRequest.mapper()
  request_content = @client.serialize(request_mapper,  registry_name_check_request)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'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::ContainerRegistry::Mgmt::V2017_10_01::Models::RegistryNameStatus.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

#check_name_availability_with_http_info(registry_name_check_request, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length.

containing information for the availability request. will be added to the HTTP request.

Parameters:

  • registry_name_check_request (RegistryNameCheckRequest)

    The object

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



98
99
100
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 98

def check_name_availability_with_http_info(registry_name_check_request, custom_headers:nil)
  check_name_availability_async(registry_name_check_request, custom_headers:custom_headers).value!
end

#create(resource_group_name, registry_name, registry, custom_headers: nil) ⇒ Registry

Creates a container registry with the specified parameters.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • registry (Registry)

    The parameters for creating a container registry.

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

    A hash of custom headers that

Returns:

  • (Registry)

    operation results.



288
289
290
291
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 288

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

#create_async(resource_group_name, registry_name, registry, custom_headers: nil) ⇒ Concurrent::Promise

the container registry belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • registry (Registry)

    The parameters for creating a container registry.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 304

def create_async(resource_group_name, registry_name, registry, custom_headers:nil)
  # Send request
  promise = begin_create_async(resource_group_name, registry_name, registry, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::ContainerRegistry::Mgmt::V2017_10_01::Models::Registry.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#delete(resource_group_name, registry_name, custom_headers: nil) ⇒ Object

Deletes a container registry.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

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

    A hash of custom headers that



331
332
333
334
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 331

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

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

the container registry belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 346

def delete_async(resource_group_name, registry_name, custom_headers:nil)
  # Send request
  promise = begin_delete_async(resource_group_name, registry_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#get(resource_group_name, registry_name, custom_headers: nil) ⇒ Registry

Gets the properties of the specified container registry.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

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

    A hash of custom headers that

Returns:

  • (Registry)

    operation results.



186
187
188
189
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 186

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

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

Gets the properties of the specified container registry.

the container registry belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
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
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 217

def get_async(resource_group_name, registry_name, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, 'registry_name is nil' if registry_name.nil?
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name},
      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::ContainerRegistry::Mgmt::V2017_10_01::Models::Registry.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_with_http_info(resource_group_name, registry_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the properties of the specified container registry.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



202
203
204
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 202

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

#import_image(resource_group_name, registry_name, parameters, custom_headers: nil) ⇒ Object

Copies an image to this container registry from the specified container registry.

the container registry belongs. to copy and the source container registry. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • parameters (ImportImageParameters)

    The parameters specifying the image

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

    A hash of custom headers that



36
37
38
39
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 36

def import_image(resource_group_name, registry_name, parameters, custom_headers:nil)
  response = import_image_async(resource_group_name, registry_name, parameters, custom_headers:custom_headers).value!
  nil
end

#import_image_async(resource_group_name, registry_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

the container registry belongs. to copy and the source container registry. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • parameters (ImportImageParameters)

    The parameters specifying the image

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 53

def import_image_async(resource_group_name, registry_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_import_image_async(resource_group_name, registry_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#list(custom_headers: nil) ⇒ Array<Registry>

Lists all the container registries under the specified subscription.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (Array<Registry>)

    operation results.



512
513
514
515
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 512

def list(custom_headers:nil)
  first_page = list_as_lazy(custom_headers:custom_headers)
  first_page.get_all_items
end

#list_as_lazy(custom_headers: nil) ⇒ RegistryListResult

Lists all the container registries under the specified subscription.

will be added to the HTTP request.

response.

Parameters:

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

    A hash of custom headers that

Returns:

  • (RegistryListResult)

    which provide lazy access to pages of the



1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1832

def list_as_lazy(custom_headers:nil)
  response = list_async(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(custom_headers: nil) ⇒ Concurrent::Promise

Lists all the container registries under the specified subscription.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 537

def list_async(custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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 = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'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::ContainerRegistry::Mgmt::V2017_10_01::Models::RegistryListResult.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_by_resource_group(resource_group_name, custom_headers: nil) ⇒ Array<Registry>

Lists all the container registries under the specified resource group.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

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

    A hash of custom headers that

Returns:

  • (Array<Registry>)

    operation results.



420
421
422
423
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 420

def list_by_resource_group(resource_group_name, custom_headers:nil)
  first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_resource_group_as_lazy(resource_group_name, custom_headers: nil) ⇒ RegistryListResult

Lists all the container registries under the specified resource group.

the container registry belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

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

    A hash of custom headers that

Returns:

  • (RegistryListResult)

    which provide lazy access to pages of the



1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1812

def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_resource_group_async(resource_group_name, custom_headers: nil) ⇒ Concurrent::Promise

Lists all the container registries under the specified resource group.

the container registry belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 449

def list_by_resource_group_async(resource_group_name, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.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.ContainerRegistry/registries'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
      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::ContainerRegistry::Mgmt::V2017_10_01::Models::RegistryListResult.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_by_resource_group_next(next_page_link, custom_headers: nil) ⇒ RegistryListResult

Lists all the container registries under the specified resource group.

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:

  • (RegistryListResult)

    operation results.



1631
1632
1633
1634
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1631

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

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

Lists all the container registries under the specified resource group.

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.



1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1660

def list_by_resource_group_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::ContainerRegistry::Mgmt::V2017_10_01::Models::RegistryListResult.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_by_resource_group_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all the container registries under the specified resource group.

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.



1646
1647
1648
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1646

def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_resource_group_with_http_info(resource_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all the container registries under the specified resource group.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



435
436
437
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 435

def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
end

#list_credentials(resource_group_name, registry_name, custom_headers: nil) ⇒ RegistryListCredentialsResult

Lists the login credentials for the specified container registry.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

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

    A hash of custom headers that

Returns:

  • (RegistryListCredentialsResult)

    operation results.



601
602
603
604
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 601

def list_credentials(resource_group_name, registry_name, custom_headers:nil)
  response = list_credentials_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_credentials_async(resource_group_name, registry_name, custom_headers: nil) ⇒ Concurrent::Promise

Lists the login credentials for the specified container registry.

the container registry belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
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
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 632

def list_credentials_async(resource_group_name, registry_name, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, 'registry_name is nil' if registry_name.nil?
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name},
      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::ContainerRegistry::Mgmt::V2017_10_01::Models::RegistryListCredentialsResult.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_credentials_with_http_info(resource_group_name, registry_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the login credentials for the specified container registry.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



617
618
619
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 617

def list_credentials_with_http_info(resource_group_name, registry_name, custom_headers:nil)
  list_credentials_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
end

#list_next(next_page_link, custom_headers: nil) ⇒ RegistryListResult

Lists all the container registries under the specified subscription.

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:

  • (RegistryListResult)

    operation results.



1721
1722
1723
1724
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1721

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 the container registries under the specified subscription.

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.



1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1750

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::ContainerRegistry::Mgmt::V2017_10_01::Models::RegistryListResult.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 the container registries under the specified subscription.

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.



1736
1737
1738
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1736

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_policies(resource_group_name, registry_name, custom_headers: nil) ⇒ RegistryPolicies

Lists the policies for the specified container registry.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

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

    A hash of custom headers that

Returns:

  • (RegistryPolicies)

    operation results.



924
925
926
927
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 924

def list_policies(resource_group_name, registry_name, custom_headers:nil)
  response = list_policies_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_policies_async(resource_group_name, registry_name, custom_headers: nil) ⇒ Concurrent::Promise

Lists the policies for the specified container registry.

the container registry belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1007
1008
1009
1010
1011
1012
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 955

def list_policies_async(resource_group_name, registry_name, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, 'registry_name is nil' if registry_name.nil?
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name},
      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::ContainerRegistry::Mgmt::V2017_10_01::Models::RegistryPolicies.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_policies_with_http_info(resource_group_name, registry_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the policies for the specified container registry.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



940
941
942
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 940

def list_policies_with_http_info(resource_group_name, registry_name, custom_headers:nil)
  list_policies_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
end

#list_usages(resource_group_name, registry_name, custom_headers: nil) ⇒ RegistryUsageListResult

Gets the quota usages for the specified container registry.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

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

    A hash of custom headers that

Returns:

  • (RegistryUsageListResult)

    operation results.



823
824
825
826
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 823

def list_usages(resource_group_name, registry_name, custom_headers:nil)
  response = list_usages_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_usages_async(resource_group_name, registry_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the quota usages for the specified container registry.

the container registry belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 854

def list_usages_async(resource_group_name, registry_name, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, 'registry_name is nil' if registry_name.nil?
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name},
      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::ContainerRegistry::Mgmt::V2017_10_01::Models::RegistryUsageListResult.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_usages_with_http_info(resource_group_name, registry_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the quota usages for the specified container registry.

the container registry belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



839
840
841
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 839

def list_usages_with_http_info(resource_group_name, registry_name, custom_headers:nil)
  list_usages_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
end

#list_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all the container registries under the specified subscription.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



525
526
527
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 525

def list_with_http_info(custom_headers:nil)
  list_async(custom_headers:custom_headers).value!
end

#regenerate_credential(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers: nil) ⇒ RegistryListCredentialsResult

Regenerates one of the login credentials for the specified container registry.

the container registry belongs. Specifies name of the password which should be regenerated – password or password2. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

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

    A hash of custom headers that

Returns:

  • (RegistryListCredentialsResult)

    operation results.



706
707
708
709
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 706

def regenerate_credential(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers:nil)
  response = regenerate_credential_async(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#regenerate_credential_async(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Regenerates one of the login credentials for the specified container registry.

the container registry belongs. Specifies name of the password which should be regenerated – password or password2. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • regenerate_credential_parameters (RegenerateCredentialParameters)
  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 745

def regenerate_credential_async(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, 'registry_name is nil' if registry_name.nil?
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
  fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
  fail ArgumentError, 'regenerate_credential_parameters is nil' if regenerate_credential_parameters.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::ContainerRegistry::Mgmt::V2017_10_01::Models::RegenerateCredentialParameters.mapper()
  request_content = @client.serialize(request_mapper,  regenerate_credential_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name},
      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::ContainerRegistry::Mgmt::V2017_10_01::Models::RegistryListCredentialsResult.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

#regenerate_credential_with_http_info(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Regenerates one of the login credentials for the specified container registry.

the container registry belongs. Specifies name of the password which should be regenerated – password or password2. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



726
727
728
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 726

def regenerate_credential_with_http_info(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers:nil)
  regenerate_credential_async(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers:custom_headers).value!
end

#update(resource_group_name, registry_name, registry_update_parameters, custom_headers: nil) ⇒ Registry

Updates a container registry with the specified parameters.

the container registry belongs. for updating a container registry. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • registry_update_parameters (RegistryUpdateParameters)

    The parameters

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

    A hash of custom headers that

Returns:

  • (Registry)

    operation results.



375
376
377
378
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 375

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

#update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers: nil) ⇒ Concurrent::Promise

the container registry belongs. for updating a container registry. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • registry_update_parameters (RegistryUpdateParameters)

    The parameters

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 392

def update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers:nil)
  # Send request
  promise = begin_update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::ContainerRegistry::Mgmt::V2017_10_01::Models::Registry.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#update_policies(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers: nil) ⇒ RegistryPolicies

Updates the policies for the specified container registry.

the container registry belongs. for updating policies of a container registry. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • registry_policies_update_parameters (RegistryPolicies)

    The parameters

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

    A hash of custom headers that

Returns:

  • (RegistryPolicies)

    operation results.



1027
1028
1029
1030
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1027

def update_policies(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:nil)
  response = update_policies_async(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_policies_async(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers: nil) ⇒ Concurrent::Promise

the container registry belongs. for updating policies of a container registry. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group to which

  • registry_name (String)

    The name of the container registry.

  • registry_policies_update_parameters (RegistryPolicies)

    The parameters

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
# File 'lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb', line 1044

def update_policies_async(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:nil)
  # Send request
  promise = begin_update_policies_async(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::ContainerRegistry::Mgmt::V2017_10_01::Models::RegistryPolicies.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end