Class: Azure::Cosmosdb::Mgmt::V2020_03_01::CassandraResources

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

Overview

Azure Cosmos DB Database Service Resource Provider REST API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ CassandraResources

Creates and initializes a new instance of the CassandraResources class.

Parameters:

  • client

    service class for accessing basic functionality.



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

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientCosmosDBManagementClient (readonly)

Returns reference to the CosmosDBManagementClient.

Returns:



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

def client
  @client
end

Instance Method Details

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

Create or update an Azure Cosmos DB Cassandra keyspace

is case insensitive.

CassandraKeyspaceCreateUpdateParameters

The parameters to provide for the

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (CassandraKeyspaceGetResults)

    operation results.



1005
1006
1007
1008
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1005

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

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

Create or update an Azure Cosmos DB Cassandra keyspace

is case insensitive.

CassandraKeyspaceCreateUpdateParameters

The parameters to provide for the

current Cassandra keyspace. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1044

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


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

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

  # Serialize Request
  request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::CassandraKeyspaceCreateUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  create_update_cassandra_keyspace_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Create or update an Azure Cosmos DB Cassandra keyspace

is case insensitive.

CassandraKeyspaceCreateUpdateParameters

The parameters to provide for the

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1025
1026
1027
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1025

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

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

Create or update an Azure Cosmos DB Cassandra Table

is case insensitive.

CassandraTableCreateUpdateParameters

The parameters to provide for the

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (CassandraTableGetResults)

    operation results.



1356
1357
1358
1359
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1356

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

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

Create or update an Azure Cosmos DB Cassandra Table

is case insensitive.

CassandraTableCreateUpdateParameters

The parameters to provide for the

current Cassandra Table. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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

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


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

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

  # Serialize Request
  request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::CassandraTableCreateUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  create_update_cassandra_table_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Create or update an Azure Cosmos DB Cassandra Table

is case insensitive.

CassandraTableCreateUpdateParameters

The parameters to provide for the

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1377
1378
1379
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1377

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

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

Deletes an existing Azure Cosmos DB Cassandra keyspace.

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that



1127
1128
1129
1130
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1127

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

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

Deletes an existing Azure Cosmos DB Cassandra keyspace.

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1160

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


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}'

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Deletes an existing Azure Cosmos DB Cassandra keyspace.

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1144
1145
1146
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1144

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

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

Deletes an existing Azure Cosmos DB Cassandra table.

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that



1482
1483
1484
1485
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1482

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

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

Deletes an existing Azure Cosmos DB Cassandra table.

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1517

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


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}'

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Deletes an existing Azure Cosmos DB Cassandra table.

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1500
1501
1502
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1500

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



1229
1230
1231
1232
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1229

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

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

Update RUs per second of an Azure Cosmos DB Cassandra Keyspace

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1268

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


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

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

  # Serialize Request
  request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  update_throughput_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Update RUs per second of an Azure Cosmos DB Cassandra Keyspace

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1249
1250
1251
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1249

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

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

Update RUs per second of an Azure Cosmos DB Cassandra table

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



1587
1588
1589
1590
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1587

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

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

Update RUs per second of an Azure Cosmos DB Cassandra table

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1626

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


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

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

  # Serialize Request
  request_mapper = Azure::Cosmosdb::Mgmt::V2020_03_01::Models::ThroughputSettingsUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  update_throughput_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Update RUs per second of an Azure Cosmos DB Cassandra table

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1607
1608
1609
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 1607

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

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

Create or update an Azure Cosmos DB Cassandra keyspace

is case insensitive.

CassandraKeyspaceCreateUpdateParameters

The parameters to provide for the

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (CassandraKeyspaceGetResults)

    operation results.



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

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

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

is case insensitive.

CassandraKeyspaceCreateUpdateParameters

The parameters to provide for the

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

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



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

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

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

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

  promise
end

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

Create or update an Azure Cosmos DB Cassandra Table

is case insensitive.

CassandraTableCreateUpdateParameters

The parameters to provide for the

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (CassandraTableGetResults)

    operation results.



740
741
742
743
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 740

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

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

is case insensitive.

CassandraTableCreateUpdateParameters

The parameters to provide for the

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

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 760

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

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

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

  promise
end

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

Deletes an existing Azure Cosmos DB Cassandra keyspace.

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that



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

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

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

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

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



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

def delete_cassandra_keyspace_async(resource_group_name, , keyspace_name, custom_headers:nil)
  # Send request
  promise = begin_delete_cassandra_keyspace_async(resource_group_name, , keyspace_name, custom_headers:custom_headers)

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

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

  promise
end

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

Deletes an existing Azure Cosmos DB Cassandra table.

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that



789
790
791
792
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 789

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

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

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

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 806

def delete_cassandra_table_async(resource_group_name, , keyspace_name, table_name, custom_headers:nil)
  # Send request
  promise = begin_delete_cassandra_table_async(resource_group_name, , keyspace_name, table_name, custom_headers:custom_headers)

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

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

  promise
end

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (CassandraKeyspaceGetResults)

    operation results.



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

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

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

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

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 180

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


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}'

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



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

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

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

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

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



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

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

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



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

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

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (CassandraTableGetResults)

    operation results.



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

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

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

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

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 659

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


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}'

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



836
837
838
839
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 836

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

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

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

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 873

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


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default'

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



855
856
857
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 855

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

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



642
643
644
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 642

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

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

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

    A hash of custom headers that

Returns:

  • (CassandraKeyspaceListResult)

    operation results.



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

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

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

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

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



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

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

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (CassandraTableListResult)

    operation results.



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

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

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

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

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 547

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


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables'

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



531
532
533
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 531

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



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

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

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

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

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



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

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

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

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

  promise
end

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

Update RUs per second of an Azure Cosmos DB Cassandra table

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



953
954
955
956
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 953

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

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

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

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • account_name (String)

    Cosmos DB database account name.

  • keyspace_name (String)

    Cosmos DB keyspace name.

  • table_name (String)

    Cosmos DB table name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
# File 'lib/2020-03-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb', line 972

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

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