Class: Azure::Cosmosdb::Mgmt::V2019_08_01::CassandraResources

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2019-08-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/2019-08-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/2019-08-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

CassandraKeyspaceCreateUpdateParameters

The parameters to provide for the

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

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



962
963
964
965
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 962

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

CassandraKeyspaceCreateUpdateParameters

The parameters to provide for the

current Cassandra keyspace. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



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
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 999

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, '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, '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::V2019_08_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::V2019_08_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

CassandraKeyspaceCreateUpdateParameters

The parameters to provide for the

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

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



981
982
983
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 981

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

CassandraTableCreateUpdateParameters

The parameters to provide for the

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

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



1298
1299
1300
1301
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1298

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

CassandraTableCreateUpdateParameters

The parameters to provide for the

current Cassandra Table. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
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
1405
1406
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1337

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, '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, '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::V2019_08_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::V2019_08_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

CassandraTableCreateUpdateParameters

The parameters to provide for the

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

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



1318
1319
1320
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1318

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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • 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



1079
1080
1081
1082
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1079

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.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1110

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, '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?


  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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



1095
1096
1097
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1095

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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • 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



1419
1420
1421
1422
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1419

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.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1452

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, '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?


  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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



1436
1437
1438
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1436

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_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

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)

    Name of an Azure resource group.

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



1176
1177
1178
1179
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1176

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

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

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1213

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, '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, '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::V2019_08_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::V2019_08_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

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)

    Name of an Azure resource group.

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



1195
1196
1197
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1195

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

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)

    Name of an Azure resource group.

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



1519
1520
1521
1522
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1519

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

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

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1556

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, '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, '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::V2019_08_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::V2019_08_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

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)

    Name of an Azure resource group.

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



1538
1539
1540
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1538

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

CassandraKeyspaceCreateUpdateParameters

The parameters to provide for the

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

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



248
249
250
251
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 248

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

CassandraKeyspaceCreateUpdateParameters

The parameters to provide for the

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

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • 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



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 266

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::V2019_08_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

CassandraTableCreateUpdateParameters

The parameters to provide for the

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

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



708
709
710
711
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 708

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

CassandraTableCreateUpdateParameters

The parameters to provide for the

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

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • 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



727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 727

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::V2019_08_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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • 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



293
294
295
296
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 293

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

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • 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



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 308

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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • 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



755
756
757
758
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 755

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

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • 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



771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 771

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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



139
140
141
142
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 139

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.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



172
173
174
175
176
177
178
179
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
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 172

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, '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?


  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::V2019_08_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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



336
337
338
339
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 336

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.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
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
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 369

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, '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?


  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::V2019_08_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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



353
354
355
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 353

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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



156
157
158
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 156

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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



597
598
599
600
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 597

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.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 630

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, '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?


  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::V2019_08_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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



800
801
802
803
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 800

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.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 835

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, '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?


  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::V2019_08_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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



818
819
820
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 818

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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



614
615
616
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 614

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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



35
36
37
38
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 35

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.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



66
67
68
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
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 66

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, '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?


  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::V2019_08_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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



51
52
53
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 51

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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



492
493
494
495
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 492

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.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 523

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, '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?


  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::V2019_08_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.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

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



508
509
510
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 508

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

#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

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)

    Name of an Azure resource group.

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



445
446
447
448
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 445

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

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)

    Name of an Azure resource group.

  • 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



463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 463

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::V2019_08_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

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)

    Name of an Azure resource group.

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



912
913
914
915
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 912

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

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)

    Name of an Azure resource group.

  • 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



930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
# File 'lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 930

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::V2019_08_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