Class: Azure::Cosmosdb::Mgmt::V2020_09_01::CassandraResources

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb

Overview

Azure Cosmos DB Database Service Resource Provider REST API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ CassandraResources

Creates and initializes a new instance of the CassandraResources class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientCosmosDBManagementClient (readonly)

Returns reference to the CosmosDBManagementClient.

Returns:



22
23
24
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 22

def client
  @client
end

Instance Method Details

#begin_create_update_cassandra_keyspace(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers: nil) ⇒ CassandraKeyspaceGetResults

Create or update an Azure Cosmos DB Cassandra keyspace

is case insensitive.

CassandraKeyspaceCreateUpdateParameters

The parameters to provide for the

current Cassandra keyspace. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (CassandraKeyspaceGetResults)

    operation results.



1197
1198
1199
1200
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1197

def begin_create_update_cassandra_keyspace(resource_group_name, , keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil)
  response = begin_create_update_cassandra_keyspace_async(resource_group_name, , keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Create or update an Azure Cosmos DB Cassandra keyspace

is case insensitive.

CassandraKeyspaceCreateUpdateParameters

The parameters to provide for the

current Cassandra keyspace. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • create_update_cassandra_keyspace_parameters
  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1236

def begin_create_update_cassandra_keyspace_async(resource_group_name, , keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, 'create_update_cassandra_keyspace_parameters is nil' if create_update_cassandra_keyspace_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::Cosmosdb::Mgmt::V2020_09_01::Models::CassandraKeyspaceCreateUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  create_update_cassandra_keyspace_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}'

  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,'accountName' => ,'keyspaceName' => keyspace_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 == 202 || 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::Cosmosdb::Mgmt::V2020_09_01::Models::CassandraKeyspaceGetResults.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_update_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update an Azure Cosmos DB Cassandra keyspace

is case insensitive.

CassandraKeyspaceCreateUpdateParameters

The parameters to provide for the

current Cassandra keyspace. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1217
1218
1219
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1217

def begin_create_update_cassandra_keyspace_with_http_info(resource_group_name, , keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil)
  begin_create_update_cassandra_keyspace_async(resource_group_name, , keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value!
end

#begin_create_update_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers: nil) ⇒ CassandraTableGetResults

Create or update an Azure Cosmos DB Cassandra Table

is case insensitive.

CassandraTableCreateUpdateParameters

The parameters to provide for the

current Cassandra Table. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (CassandraTableGetResults)

    operation results.



1772
1773
1774
1775
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1772

def begin_create_update_cassandra_table(resource_group_name, , keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil)
  response = begin_create_update_cassandra_table_async(resource_group_name, , keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Create or update an Azure Cosmos DB Cassandra Table

is case insensitive.

CassandraTableCreateUpdateParameters

The parameters to provide for the

current Cassandra Table. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • create_update_cassandra_table_parameters
  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1813

def begin_create_update_cassandra_table_async(resource_group_name, , keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
  fail ArgumentError, 'table_name is nil' if table_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, 'create_update_cassandra_table_parameters is nil' if create_update_cassandra_table_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::Cosmosdb::Mgmt::V2020_09_01::Models::CassandraTableCreateUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  create_update_cassandra_table_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}'

  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,'accountName' => ,'keyspaceName' => keyspace_name,'tableName' => table_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 == 202 || 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::Cosmosdb::Mgmt::V2020_09_01::Models::CassandraTableGetResults.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_update_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update an Azure Cosmos DB Cassandra Table

is case insensitive.

CassandraTableCreateUpdateParameters

The parameters to provide for the

current Cassandra Table. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1793
1794
1795
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1793

def begin_create_update_cassandra_table_with_http_info(resource_group_name, , keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil)
  begin_create_update_cassandra_table_async(resource_group_name, , keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value!
end

#begin_delete_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ Object

Deletes an existing Azure Cosmos DB Cassandra keyspace.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that



1319
1320
1321
1322
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1319

def begin_delete_cassandra_keyspace(resource_group_name, , keyspace_name, custom_headers:nil)
  response = begin_delete_cassandra_keyspace_async(resource_group_name, , keyspace_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes an existing Azure Cosmos DB Cassandra keyspace.

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1352

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


  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.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}'

  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,'accountName' => ,'keyspaceName' => keyspace_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 == 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_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes an existing Azure Cosmos DB Cassandra keyspace.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1336
1337
1338
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1336

def begin_delete_cassandra_keyspace_with_http_info(resource_group_name, , keyspace_name, custom_headers:nil)
  begin_delete_cassandra_keyspace_async(resource_group_name, , keyspace_name, custom_headers:custom_headers).value!
end

#begin_delete_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ Object

Deletes an existing Azure Cosmos DB Cassandra table.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that



1898
1899
1900
1901
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1898

def begin_delete_cassandra_table(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  response = begin_delete_cassandra_table_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes an existing Azure Cosmos DB Cassandra table.

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1933

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


  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.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}'

  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,'accountName' => ,'keyspaceName' => keyspace_name,'tableName' => table_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 == 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_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes an existing Azure Cosmos DB Cassandra table.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1916
1917
1918
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1916

def begin_delete_cassandra_table_with_http_info(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  begin_delete_cassandra_table_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers).value!
end

#begin_migrate_cassandra_keyspace_to_autoscale(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



1545
1546
1547
1548
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1545

def begin_migrate_cassandra_keyspace_to_autoscale(resource_group_name, , keyspace_name, custom_headers:nil)
  response = begin_migrate_cassandra_keyspace_to_autoscale_async(resource_group_name, , keyspace_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_migrate_cassandra_keyspace_to_autoscale_async(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ Concurrent::Promise

Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1580

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


  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.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale'

  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,'accountName' => ,'keyspaceName' => keyspace_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 == 202 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsGetResults.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_migrate_cassandra_keyspace_to_autoscale_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1563
1564
1565
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1563

def begin_migrate_cassandra_keyspace_to_autoscale_with_http_info(resource_group_name, , keyspace_name, custom_headers:nil)
  begin_migrate_cassandra_keyspace_to_autoscale_async(resource_group_name, , keyspace_name, custom_headers:custom_headers).value!
end

#begin_migrate_cassandra_keyspace_to_manual_throughput(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



1657
1658
1659
1660
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1657

def begin_migrate_cassandra_keyspace_to_manual_throughput(resource_group_name, , keyspace_name, custom_headers:nil)
  response = begin_migrate_cassandra_keyspace_to_manual_throughput_async(resource_group_name, , keyspace_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_migrate_cassandra_keyspace_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ Concurrent::Promise

Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1692

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


  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.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput'

  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,'accountName' => ,'keyspaceName' => keyspace_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 == 202 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsGetResults.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_migrate_cassandra_keyspace_to_manual_throughput_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1675
1676
1677
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1675

def begin_migrate_cassandra_keyspace_to_manual_throughput_with_http_info(resource_group_name, , keyspace_name, custom_headers:nil)
  begin_migrate_cassandra_keyspace_to_manual_throughput_async(resource_group_name, , keyspace_name, custom_headers:custom_headers).value!
end

#begin_migrate_cassandra_table_to_autoscale(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



2129
2130
2131
2132
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 2129

def begin_migrate_cassandra_table_to_autoscale(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  response = begin_migrate_cassandra_table_to_autoscale_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_migrate_cassandra_table_to_autoscale_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ Concurrent::Promise

Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 2166

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


  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.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale'

  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,'accountName' => ,'keyspaceName' => keyspace_name,'tableName' => table_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 == 202 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsGetResults.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_migrate_cassandra_table_to_autoscale_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2148
2149
2150
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 2148

def begin_migrate_cassandra_table_to_autoscale_with_http_info(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  begin_migrate_cassandra_table_to_autoscale_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers).value!
end

#begin_migrate_cassandra_table_to_manual_throughput(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



2245
2246
2247
2248
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 2245

def begin_migrate_cassandra_table_to_manual_throughput(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  response = begin_migrate_cassandra_table_to_manual_throughput_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_migrate_cassandra_table_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ Concurrent::Promise

Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 2282

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


  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.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput'

  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,'accountName' => ,'keyspaceName' => keyspace_name,'tableName' => table_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 == 202 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsGetResults.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_migrate_cassandra_table_to_manual_throughput_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2264
2265
2266
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 2264

def begin_migrate_cassandra_table_to_manual_throughput_with_http_info(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  begin_migrate_cassandra_table_to_manual_throughput_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers).value!
end

#begin_update_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Update RUs per second of an Azure Cosmos DB Cassandra Keyspace

is case insensitive. RUs per second of the parameters to provide for the current Cassandra Keyspace. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



1421
1422
1423
1424
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1421

def begin_update_cassandra_keyspace_throughput(resource_group_name, , keyspace_name, update_throughput_parameters, custom_headers:nil)
  response = begin_update_cassandra_keyspace_throughput_async(resource_group_name, , keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Update RUs per second of an Azure Cosmos DB Cassandra Keyspace

is case insensitive. RUs per second of the parameters to provide for the current Cassandra Keyspace. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1460

def begin_update_cassandra_keyspace_throughput_async(resource_group_name, , keyspace_name, update_throughput_parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_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::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  update_throughput_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default'

  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,'accountName' => ,'keyspaceName' => keyspace_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 == 202 || 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::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsGetResults.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_cassandra_keyspace_throughput_with_http_info(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Update RUs per second of an Azure Cosmos DB Cassandra Keyspace

is case insensitive. RUs per second of the parameters to provide for the current Cassandra Keyspace. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1441
1442
1443
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1441

def begin_update_cassandra_keyspace_throughput_with_http_info(resource_group_name, , keyspace_name, update_throughput_parameters, custom_headers:nil)
  begin_update_cassandra_keyspace_throughput_async(resource_group_name, , keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value!
end

#begin_update_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Update RUs per second of an Azure Cosmos DB Cassandra table

is case insensitive. RUs per second of the parameters to provide for the current Cassandra table. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



2003
2004
2005
2006
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 2003

def begin_update_cassandra_table_throughput(resource_group_name, , keyspace_name, table_name, update_throughput_parameters, custom_headers:nil)
  response = begin_update_cassandra_table_throughput_async(resource_group_name, , keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Update RUs per second of an Azure Cosmos DB Cassandra table

is case insensitive. RUs per second of the parameters to provide for the current Cassandra table. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 2042

def begin_update_cassandra_table_throughput_async(resource_group_name, , keyspace_name, table_name, update_throughput_parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
  fail ArgumentError, 'table_name is nil' if table_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_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::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  update_throughput_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default'

  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,'accountName' => ,'keyspaceName' => keyspace_name,'tableName' => table_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 == 202 || 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::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsGetResults.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_cassandra_table_throughput_with_http_info(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Update RUs per second of an Azure Cosmos DB Cassandra table

is case insensitive. RUs per second of the parameters to provide for the current Cassandra table. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2023
2024
2025
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 2023

def begin_update_cassandra_table_throughput_with_http_info(resource_group_name, , keyspace_name, table_name, update_throughput_parameters, custom_headers:nil)
  begin_update_cassandra_table_throughput_async(resource_group_name, , keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value!
end

#create_update_cassandra_keyspace(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers: nil) ⇒ CassandraKeyspaceGetResults

Create or update an Azure Cosmos DB Cassandra keyspace

is case insensitive.

CassandraKeyspaceCreateUpdateParameters

The parameters to provide for the

current Cassandra keyspace. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (CassandraKeyspaceGetResults)

    operation results.



259
260
261
262
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 259

def create_update_cassandra_keyspace(resource_group_name, , keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil)
  response = create_update_cassandra_keyspace_async(resource_group_name, , keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers: nil) ⇒ Concurrent::Promise

is case insensitive.

CassandraKeyspaceCreateUpdateParameters

The parameters to provide for the

current Cassandra keyspace. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • create_update_cassandra_keyspace_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



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 278

def create_update_cassandra_keyspace_async(resource_group_name, , keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil)
  # Send request
  promise = begin_create_update_cassandra_keyspace_async(resource_group_name, , keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Cosmosdb::Mgmt::V2020_09_01::Models::CassandraKeyspaceGetResults.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

#create_update_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers: nil) ⇒ CassandraTableGetResults

Create or update an Azure Cosmos DB Cassandra Table

is case insensitive.

CassandraTableCreateUpdateParameters

The parameters to provide for the

current Cassandra Table. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (CassandraTableGetResults)

    operation results.



834
835
836
837
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 834

def create_update_cassandra_table(resource_group_name, , keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil)
  response = create_update_cassandra_table_async(resource_group_name, , keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers: nil) ⇒ Concurrent::Promise

is case insensitive.

CassandraTableCreateUpdateParameters

The parameters to provide for the

current Cassandra Table. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • create_update_cassandra_table_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



854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 854

def create_update_cassandra_table_async(resource_group_name, , keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil)
  # Send request
  promise = begin_create_update_cassandra_table_async(resource_group_name, , keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Cosmosdb::Mgmt::V2020_09_01::Models::CassandraTableGetResults.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_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ Object

Deletes an existing Azure Cosmos DB Cassandra keyspace.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that



306
307
308
309
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 306

def delete_cassandra_keyspace(resource_group_name, , keyspace_name, custom_headers:nil)
  response = delete_cassandra_keyspace_async(resource_group_name, , keyspace_name, custom_headers:custom_headers).value!
  nil
end

#delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ Concurrent::Promise

is case insensitive. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 322

def delete_cassandra_keyspace_async(resource_group_name, , keyspace_name, custom_headers:nil)
  # Send request
  promise = begin_delete_cassandra_keyspace_async(resource_group_name, , keyspace_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

#delete_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ Object

Deletes an existing Azure Cosmos DB Cassandra table.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that



883
884
885
886
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 883

def delete_cassandra_table(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  response = delete_cassandra_table_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers).value!
  nil
end

#delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ Concurrent::Promise

is case insensitive. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 900

def delete_cassandra_table_async(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  # Send request
  promise = begin_delete_cassandra_table_async(resource_group_name, , keyspace_name, table_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_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ CassandraKeyspaceGetResults

Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (CassandraKeyspaceGetResults)

    operation results.



145
146
147
148
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 145

def get_cassandra_keyspace(resource_group_name, , keyspace_name, custom_headers:nil)
  response = get_cassandra_keyspace_async(resource_group_name, , keyspace_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name.

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
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
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 180

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


  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.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}'

  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,'accountName' => ,'keyspaceName' => keyspace_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::Cosmosdb::Mgmt::V2020_09_01::Models::CassandraKeyspaceGetResults.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_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



351
352
353
354
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 351

def get_cassandra_keyspace_throughput(resource_group_name, , keyspace_name, custom_headers:nil)
  response = get_cassandra_keyspace_throughput_async(resource_group_name, , keyspace_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name.

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 386

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


  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.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default'

  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,'accountName' => ,'keyspaceName' => keyspace_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::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsGetResults.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_cassandra_keyspace_throughput_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



369
370
371
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 369

def get_cassandra_keyspace_throughput_with_http_info(resource_group_name, , keyspace_name, custom_headers:nil)
  get_cassandra_keyspace_throughput_async(resource_group_name, , keyspace_name, custom_headers:custom_headers).value!
end

#get_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



163
164
165
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 163

def get_cassandra_keyspace_with_http_info(resource_group_name, , keyspace_name, custom_headers:nil)
  get_cassandra_keyspace_async(resource_group_name, , keyspace_name, custom_headers:custom_headers).value!
end

#get_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ CassandraTableGetResults

Gets the Cassandra table under an existing Azure Cosmos DB database account.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (CassandraTableGetResults)

    operation results.



718
719
720
721
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 718

def get_cassandra_table(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  response = get_cassandra_table_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the Cassandra table under an existing Azure Cosmos DB database account.

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
811
812
813
814
815
816
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 753

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


  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.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}'

  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,'accountName' => ,'keyspaceName' => keyspace_name,'tableName' => table_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::Cosmosdb::Mgmt::V2020_09_01::Models::CassandraTableGetResults.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_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



930
931
932
933
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 930

def get_cassandra_table_throughput(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  response = get_cassandra_table_throughput_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name.

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 967

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


  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.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default'

  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,'accountName' => ,'keyspaceName' => keyspace_name,'tableName' => table_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::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsGetResults.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_cassandra_table_throughput_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



949
950
951
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 949

def get_cassandra_table_throughput_with_http_info(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  get_cassandra_table_throughput_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers).value!
end

#get_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the Cassandra table under an existing Azure Cosmos DB database account.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



736
737
738
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 736

def get_cassandra_table_with_http_info(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  get_cassandra_table_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers).value!
end

#list_cassandra_keyspaces(resource_group_name, account_name, custom_headers: nil) ⇒ CassandraKeyspaceListResult

Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

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

    A hash of custom headers that

Returns:

  • (CassandraKeyspaceListResult)

    operation results.



36
37
38
39
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 36

def list_cassandra_keyspaces(resource_group_name, , custom_headers:nil)
  response = list_cassandra_keyspaces_async(resource_group_name, , custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 69

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


  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.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces'

  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,'accountName' => },
      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::Cosmosdb::Mgmt::V2020_09_01::Models::CassandraKeyspaceListResult.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_cassandra_keyspaces_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



53
54
55
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 53

def list_cassandra_keyspaces_with_http_info(resource_group_name, , custom_headers:nil)
  list_cassandra_keyspaces_async(resource_group_name, , custom_headers:custom_headers).value!
end

#list_cassandra_tables(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ CassandraTableListResult

Lists the Cassandra table under an existing Azure Cosmos DB database account.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (CassandraTableListResult)

    operation results.



608
609
610
611
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 608

def list_cassandra_tables(resource_group_name, , keyspace_name, custom_headers:nil)
  response = list_cassandra_tables_async(resource_group_name, , keyspace_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ Concurrent::Promise

Lists the Cassandra table under an existing Azure Cosmos DB database account.

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
690
691
692
693
694
695
696
697
698
699
700
701
702
703
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 641

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


  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.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables'

  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,'accountName' => ,'keyspaceName' => keyspace_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::Cosmosdb::Mgmt::V2020_09_01::Models::CassandraTableListResult.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_cassandra_tables_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the Cassandra table under an existing Azure Cosmos DB database account.

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



625
626
627
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 625

def list_cassandra_tables_with_http_info(resource_group_name, , keyspace_name, custom_headers:nil)
  list_cassandra_tables_async(resource_group_name, , keyspace_name, custom_headers:custom_headers).value!
end

#migrate_cassandra_keyspace_to_autoscale(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



515
516
517
518
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 515

def migrate_cassandra_keyspace_to_autoscale(resource_group_name, , keyspace_name, custom_headers:nil)
  response = migrate_cassandra_keyspace_to_autoscale_async(resource_group_name, , keyspace_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#migrate_cassandra_keyspace_to_autoscale_async(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ Concurrent::Promise

is case insensitive. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 531

def migrate_cassandra_keyspace_to_autoscale_async(resource_group_name, , keyspace_name, custom_headers:nil)
  # Send request
  promise = begin_migrate_cassandra_keyspace_to_autoscale_async(resource_group_name, , keyspace_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsGetResults.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

#migrate_cassandra_keyspace_to_manual_throughput(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



562
563
564
565
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 562

def migrate_cassandra_keyspace_to_manual_throughput(resource_group_name, , keyspace_name, custom_headers:nil)
  response = migrate_cassandra_keyspace_to_manual_throughput_async(resource_group_name, , keyspace_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#migrate_cassandra_keyspace_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers: nil) ⇒ Concurrent::Promise

is case insensitive. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 578

def migrate_cassandra_keyspace_to_manual_throughput_async(resource_group_name, , keyspace_name, custom_headers:nil)
  # Send request
  promise = begin_migrate_cassandra_keyspace_to_manual_throughput_async(resource_group_name, , keyspace_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsGetResults.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

#migrate_cassandra_table_to_autoscale(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



1098
1099
1100
1101
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1098

def migrate_cassandra_table_to_autoscale(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  response = migrate_cassandra_table_to_autoscale_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#migrate_cassandra_table_to_autoscale_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ Concurrent::Promise

is case insensitive. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1115

def migrate_cassandra_table_to_autoscale_async(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  # Send request
  promise = begin_migrate_cassandra_table_to_autoscale_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsGetResults.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

#migrate_cassandra_table_to_manual_throughput(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



1147
1148
1149
1150
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1147

def migrate_cassandra_table_to_manual_throughput(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  response = migrate_cassandra_table_to_manual_throughput_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#migrate_cassandra_table_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers: nil) ⇒ Concurrent::Promise

is case insensitive. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1164

def migrate_cassandra_table_to_manual_throughput_async(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  # Send request
  promise = begin_migrate_cassandra_table_to_manual_throughput_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsGetResults.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_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Update RUs per second of an Azure Cosmos DB Cassandra Keyspace

is case insensitive. RUs per second of the parameters to provide for the current Cassandra Keyspace. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



465
466
467
468
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 465

def update_cassandra_keyspace_throughput(resource_group_name, , keyspace_name, update_throughput_parameters, custom_headers:nil)
  response = update_cassandra_keyspace_throughput_async(resource_group_name, , keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers: nil) ⇒ Concurrent::Promise

is case insensitive. RUs per second of the parameters to provide for the current Cassandra Keyspace. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 484

def update_cassandra_keyspace_throughput_async(resource_group_name, , keyspace_name, update_throughput_parameters, custom_headers:nil)
  # Send request
  promise = begin_update_cassandra_keyspace_throughput_async(resource_group_name, , keyspace_name, update_throughput_parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsGetResults.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_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Update RUs per second of an Azure Cosmos DB Cassandra table

is case insensitive. RUs per second of the parameters to provide for the current Cassandra table. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



1047
1048
1049
1050
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1047

def update_cassandra_table_throughput(resource_group_name, , keyspace_name, table_name, update_throughput_parameters, custom_headers:nil)
  response = update_cassandra_table_throughput_async(resource_group_name, , keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers: nil) ⇒ Concurrent::Promise

is case insensitive. RUs per second of the parameters to provide for the current Cassandra table. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
# File 'lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1066

def update_cassandra_table_throughput_async(resource_group_name, , keyspace_name, table_name, update_throughput_parameters, custom_headers:nil)
  # Send request
  promise = begin_update_cassandra_table_throughput_async(resource_group_name, , keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Cosmosdb::Mgmt::V2020_09_01::Models::ThroughputSettingsGetResults.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