class Azure::Cosmosdb::Mgmt::V2015_04_08::DatabaseAccounts
Attributes
@return [CosmosDB] reference to the CosmosDB
Public Class Methods
Creates and initializes a new instance of the DatabaseAccounts
class. @param client service class for accessing basic functionality.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 17 def initialize(client) @client = client end
Public Instance Methods
Creates or updates an Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The parameters to provide for the current database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DatabaseAccount] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5702 def begin_create_or_update(resource_group_name, account_name, create_update_parameters, custom_headers:nil) response = begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates or updates an Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The parameters to provide for the current database account. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5735 def begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'create_update_parameters is nil' if create_update_parameters.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::DatabaseAccountCreateUpdateParameters.mapper() request_content = @client.serialize(request_mapper, create_update_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}' 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' => account_name}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 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::V2015_04_08::Models::DatabaseAccount.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
Creates or updates an Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The parameters to provide for the current database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5719 def begin_create_or_update_with_http_info(resource_group_name, account_name, create_update_parameters, custom_headers:nil) begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers).value! end
Create or update an Azure
Cosmos DB Cassandra keyspace
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param create_update_cassandra_keyspace_parameters
- CassandraKeyspaceCreateUpdateParameters
-
The parameters to provide for the
current Cassandra keyspace. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CassandraKeyspace] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8015 def begin_create_update_cassandra_keyspace(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) response = begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Create or update an Azure
Cosmos DB Cassandra keyspace
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param create_update_cassandra_keyspace_parameters
- CassandraKeyspaceCreateUpdateParameters
-
The parameters to provide for the
current Cassandra keyspace. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8052 def begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'create_update_cassandra_keyspace_parameters is nil' if create_update_cassandra_keyspace_parameters.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::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}/apis/cassandra/keyspaces/{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' => account_name,'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::V2015_04_08::Models::CassandraKeyspace.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Create or update an Azure
Cosmos DB Cassandra keyspace
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param create_update_cassandra_keyspace_parameters
- CassandraKeyspaceCreateUpdateParameters
-
The parameters to provide for the
current Cassandra keyspace. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8034 def begin_create_update_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value! end
Create or update an Azure
Cosmos DB Cassandra Table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param create_update_cassandra_table_parameters
- CassandraTableCreateUpdateParameters
-
The parameters to provide for the
current Cassandra Table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CassandraTable] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8348 def begin_create_update_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) response = begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Create or update an Azure
Cosmos DB Cassandra Table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param create_update_cassandra_table_parameters
- CassandraTableCreateUpdateParameters
-
The parameters to provide for the
current Cassandra Table. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8387 def begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? fail ArgumentError, 'table_name is nil' if table_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'create_update_cassandra_table_parameters is nil' if create_update_cassandra_table_parameters.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::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}/apis/cassandra/keyspaces/{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' => account_name,'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::V2015_04_08::Models::CassandraTable.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Create or update an Azure
Cosmos DB Cassandra Table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param create_update_cassandra_table_parameters
- CassandraTableCreateUpdateParameters
-
The parameters to provide for the
current Cassandra Table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8368 def 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) begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value! end
Create or update an Azure
Cosmos DB Gremlin database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param create_update_gremlin_database_parameters
- GremlinDatabaseCreateUpdateParameters
-
The parameters to provide for the
current Gremlin database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [GremlinDatabase] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8691 def begin_create_update_gremlin_database(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) response = begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Create or update an Azure
Cosmos DB Gremlin database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param create_update_gremlin_database_parameters
- GremlinDatabaseCreateUpdateParameters
-
The parameters to provide for the
current Gremlin database. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8728 def begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'create_update_gremlin_database_parameters is nil' if create_update_gremlin_database_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::V2015_04_08::Models::GremlinDatabaseCreateUpdateParameters.mapper() request_content = @client.serialize(request_mapper, create_update_gremlin_database_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}/apis/gremlin/databases/{databaseName}' 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' => account_name,'databaseName' => database_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::V2015_04_08::Models::GremlinDatabase.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Create or update an Azure
Cosmos DB Gremlin database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param create_update_gremlin_database_parameters
- GremlinDatabaseCreateUpdateParameters
-
The parameters to provide for the
current Gremlin database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8710 def begin_create_update_gremlin_database_with_http_info(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers).value! end
Create or update an Azure
Cosmos DB Gremlin graph
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param create_update_gremlin_graph_parameters
- GremlinGraphCreateUpdateParameters
-
The parameters to provide for the
current Gremlin graph. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [GremlinGraph] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 9024 def begin_create_update_gremlin_graph(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) response = begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Create or update an Azure
Cosmos DB Gremlin graph
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param create_update_gremlin_graph_parameters
- GremlinGraphCreateUpdateParameters
-
The parameters to provide for the
current Gremlin graph. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 9063 def begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, 'graph_name is nil' if graph_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'create_update_gremlin_graph_parameters is nil' if create_update_gremlin_graph_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::V2015_04_08::Models::GremlinGraphCreateUpdateParameters.mapper() request_content = @client.serialize(request_mapper, create_update_gremlin_graph_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}/apis/gremlin/databases/{databaseName}/graphs/{graphName}' 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' => account_name,'databaseName' => database_name,'graphName' => graph_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::V2015_04_08::Models::GremlinGraph.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Create or update an Azure
Cosmos DB Gremlin graph
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param create_update_gremlin_graph_parameters
- GremlinGraphCreateUpdateParameters
-
The parameters to provide for the
current Gremlin graph. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 9044 def begin_create_update_gremlin_graph_with_http_info(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers).value! end
Create or update an Azure
Cosmos DB MongoDB Collection
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param create_update_mongo_dbcollection_parameters
- MongoDBCollectionCreateUpdateParameters
-
The parameters to provide for the
current MongoDB Collection
. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MongoDBCollection] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7343 def begin_create_update_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) response = begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Create or update an Azure
Cosmos DB MongoDB Collection
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param create_update_mongo_dbcollection_parameters
- MongoDBCollectionCreateUpdateParameters
-
The parameters to provide for the
current MongoDB Collection
. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7382 def begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, 'collection_name is nil' if collection_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'create_update_mongo_dbcollection_parameters is nil' if create_update_mongo_dbcollection_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::V2015_04_08::Models::MongoDBCollectionCreateUpdateParameters.mapper() request_content = @client.serialize(request_mapper, create_update_mongo_dbcollection_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}/apis/mongodb/databases/{databaseName}/collections/{collectionName}' 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' => account_name,'databaseName' => database_name,'collectionName' => collection_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::V2015_04_08::Models::MongoDBCollection.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Create or update an Azure
Cosmos DB MongoDB Collection
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param create_update_mongo_dbcollection_parameters
- MongoDBCollectionCreateUpdateParameters
-
The parameters to provide for the
current MongoDB Collection
. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7363 def begin_create_update_mongo_dbcollection_with_http_info(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers).value! end
Create or updates Azure
Cosmos DB MongoDB database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param create_update_mongo_dbdatabase_parameters
- MongoDBDatabaseCreateUpdateParameters
-
The parameters to provide for the
current MongoDB database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MongoDBDatabase] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7010 def begin_create_update_mongo_dbdatabase(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) response = begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Create or updates Azure
Cosmos DB MongoDB database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param create_update_mongo_dbdatabase_parameters
- MongoDBDatabaseCreateUpdateParameters
-
The parameters to provide for the
current MongoDB database. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7047 def begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'create_update_mongo_dbdatabase_parameters is nil' if create_update_mongo_dbdatabase_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::V2015_04_08::Models::MongoDBDatabaseCreateUpdateParameters.mapper() request_content = @client.serialize(request_mapper, create_update_mongo_dbdatabase_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}/apis/mongodb/databases/{databaseName}' 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' => account_name,'databaseName' => database_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::V2015_04_08::Models::MongoDBDatabase.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Create or updates Azure
Cosmos DB MongoDB database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param create_update_mongo_dbdatabase_parameters
- MongoDBDatabaseCreateUpdateParameters
-
The parameters to provide for the
current MongoDB database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7029 def begin_create_update_mongo_dbdatabase_with_http_info(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers).value! end
Create or update an Azure
Cosmos DB SQL container
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param create_update_sql_container_parameters
- SqlContainerCreateUpdateParameters
-
The parameters to provide for the
current SQL container. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SqlContainer] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6667 def begin_create_update_sql_container(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) response = begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Create or update an Azure
Cosmos DB SQL container
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param create_update_sql_container_parameters
- SqlContainerCreateUpdateParameters
-
The parameters to provide for the
current SQL container. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6706 def begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, 'container_name is nil' if container_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'create_update_sql_container_parameters is nil' if create_update_sql_container_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::V2015_04_08::Models::SqlContainerCreateUpdateParameters.mapper() request_content = @client.serialize(request_mapper, create_update_sql_container_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}/apis/sql/databases/{databaseName}/containers/{containerName}' 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' => account_name,'databaseName' => database_name,'containerName' => container_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::V2015_04_08::Models::SqlContainer.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Create or update an Azure
Cosmos DB SQL container
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param create_update_sql_container_parameters
- SqlContainerCreateUpdateParameters
-
The parameters to provide for the
current SQL container. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6687 def begin_create_update_sql_container_with_http_info(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers).value! end
Create or update an Azure
Cosmos DB SQL database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param create_update_sql_database_parameters
- SqlDatabaseCreateUpdateParameters
-
The parameters to provide for the current
SQL database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SqlDatabase] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6334 def begin_create_update_sql_database(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) response = begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Create or update an Azure
Cosmos DB SQL database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param create_update_sql_database_parameters
- SqlDatabaseCreateUpdateParameters
-
The parameters to provide for the current
SQL database. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6371 def begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'create_update_sql_database_parameters is nil' if create_update_sql_database_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::V2015_04_08::Models::SqlDatabaseCreateUpdateParameters.mapper() request_content = @client.serialize(request_mapper, create_update_sql_database_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}/apis/sql/databases/{databaseName}' 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' => account_name,'databaseName' => database_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::V2015_04_08::Models::SqlDatabase.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Create or update an Azure
Cosmos DB SQL database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param create_update_sql_database_parameters
- SqlDatabaseCreateUpdateParameters
-
The parameters to provide for the current
SQL database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6353 def begin_create_update_sql_database_with_http_info(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers).value! end
Create or update an Azure
Cosmos DB Table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param create_update_table_parameters [TableCreateUpdateParameters] The parameters to provide for the current Table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Table] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7685 def begin_create_update_table(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) response = begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Create or update an Azure
Cosmos DB Table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param create_update_table_parameters [TableCreateUpdateParameters] The parameters to provide for the current Table. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7720 def begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'table_name is nil' if table_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'create_update_table_parameters is nil' if create_update_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::V2015_04_08::Models::TableCreateUpdateParameters.mapper() request_content = @client.serialize(request_mapper, create_update_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}/apis/table/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' => account_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::V2015_04_08::Models::Table.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Create or update an Azure
Cosmos DB Table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param create_update_table_parameters [TableCreateUpdateParameters] The parameters to provide for the current Table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7703 def begin_create_update_table_with_http_info(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers).value! end
Deletes an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5813 def begin_delete(resource_group_name, account_name, custom_headers:nil) response = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! nil end
Deletes an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5842 def begin_delete_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' 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' => account_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
Deletes an existing Azure
Cosmos DB Cassandra keyspace.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8132 def begin_delete_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers:nil) response = begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! nil end
Deletes an existing Azure
Cosmos DB Cassandra keyspace.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8163 def begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{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' => account_name,'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
Deletes an existing Azure
Cosmos DB Cassandra keyspace.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8148 def begin_delete_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! end
Deletes an existing Azure
Cosmos DB Cassandra table.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8469 def begin_delete_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) response = begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! nil end
Deletes an existing Azure
Cosmos DB Cassandra table.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8502 def begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? fail ArgumentError, 'table_name is nil' if table_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{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' => account_name,'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
Deletes an existing Azure
Cosmos DB Cassandra table.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8486 def begin_delete_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! end
Deletes an existing Azure
Cosmos DB Gremlin database.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8808 def begin_delete_gremlin_database(resource_group_name, account_name, database_name, custom_headers:nil) response = begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! nil end
Deletes an existing Azure
Cosmos DB Gremlin database.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8839 def begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}' 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' => account_name,'databaseName' => database_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
Deletes an existing Azure
Cosmos DB Gremlin database.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8824 def begin_delete_gremlin_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! end
Deletes an existing Azure
Cosmos DB Gremlin graph.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 9145 def begin_delete_gremlin_graph(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) response = begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! nil end
Deletes an existing Azure
Cosmos DB Gremlin graph.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 9178 def begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, 'graph_name is nil' if graph_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}' 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' => account_name,'databaseName' => database_name,'graphName' => graph_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
Deletes an existing Azure
Cosmos DB Gremlin graph.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 9162 def begin_delete_gremlin_graph_with_http_info(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! end
Deletes an existing Azure
Cosmos DB MongoDB Collection
.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7464 def begin_delete_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) response = begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! nil end
Deletes an existing Azure
Cosmos DB MongoDB Collection
.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7497 def begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, 'collection_name is nil' if collection_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}' 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' => account_name,'databaseName' => database_name,'collectionName' => collection_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
Deletes an existing Azure
Cosmos DB MongoDB Collection
.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7481 def begin_delete_mongo_dbcollection_with_http_info(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! end
Deletes an existing Azure
Cosmos DB MongoDB database.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7127 def begin_delete_mongo_dbdatabase(resource_group_name, account_name, database_name, custom_headers:nil) response = begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! nil end
Deletes an existing Azure
Cosmos DB MongoDB database.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7158 def begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}' 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' => account_name,'databaseName' => database_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
Deletes an existing Azure
Cosmos DB MongoDB database.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7143 def begin_delete_mongo_dbdatabase_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! end
Deletes an existing Azure
Cosmos DB SQL container.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6788 def begin_delete_sql_container(resource_group_name, account_name, database_name, container_name, custom_headers:nil) response = begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! nil end
Deletes an existing Azure
Cosmos DB SQL container.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6821 def begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, 'container_name is nil' if container_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}' 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' => account_name,'databaseName' => database_name,'containerName' => container_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
Deletes an existing Azure
Cosmos DB SQL container.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6805 def begin_delete_sql_container_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! end
Deletes an existing Azure
Cosmos DB SQL database.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6451 def begin_delete_sql_database(resource_group_name, account_name, database_name, custom_headers:nil) response = begin_delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! nil end
Deletes an existing Azure
Cosmos DB SQL database.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6482 def begin_delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}' 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' => account_name,'databaseName' => database_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
Deletes an existing Azure
Cosmos DB SQL database.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6467 def begin_delete_sql_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) begin_delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! end
Deletes an existing Azure
Cosmos DB Table.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7800 def begin_delete_table(resource_group_name, account_name, table_name, custom_headers:nil) response = begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! nil end
Deletes an existing Azure
Cosmos DB Table.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7831 def begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'table_name is nil' if table_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/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' => account_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
Deletes an existing Azure
Cosmos DB Table.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7816 def begin_delete_table_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil) begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! end
Deletes an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5828 def begin_delete_with_http_info(resource_group_name, account_name, custom_headers:nil) begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! end
Changes the failover priority for the Azure
Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param failover_parameters [FailoverPolicies] The new failover policies for the database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5907 def begin_failover_priority_change(resource_group_name, account_name, failover_parameters, custom_headers:nil) response = begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers).value! nil end
Changes the failover priority for the Azure
Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param failover_parameters [FailoverPolicies] The new failover policies for the database account. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5946 def begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'failover_parameters is nil' if failover_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::V2015_04_08::Models::FailoverPolicies.mapper() request_content = @client.serialize(request_mapper, failover_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}/failoverPriorityChange' 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' => account_name}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 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
Changes the failover priority for the Azure
Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param failover_parameters [FailoverPolicies] The new failover policies for the database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5927 def begin_failover_priority_change_with_http_info(resource_group_name, account_name, failover_parameters, custom_headers:nil) begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers).value! end
Offline the specified region for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region to offline for the database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6017 def begin_offline_region(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) response = begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers).value! nil end
Offline the specified region for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region to offline for the database account. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6052 def begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'region_parameter_for_offline is nil' if region_parameter_for_offline.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::V2015_04_08::Models::RegionForOnlineOffline.mapper() request_content = @client.serialize(request_mapper, region_parameter_for_offline) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion' 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' => account_name}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end
Offline the specified region for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region to offline for the database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6035 def begin_offline_region_with_http_info(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers).value! end
Online the specified region for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region to online for the database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6123 def begin_online_region(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) response = begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers).value! nil end
Online the specified region for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region to online for the database account. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6158 def begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'region_parameter_for_online is nil' if region_parameter_for_online.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::V2015_04_08::Models::RegionForOnlineOffline.mapper() request_content = @client.serialize(request_mapper, region_parameter_for_online) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion' 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' => account_name}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end
Online the specified region for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region to online for the database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6141 def begin_online_region_with_http_info(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers).value! end
Patches the properties of an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param update_parameters [DatabaseAccountPatchParameters] The tags parameter to patch for the current database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DatabaseAccount] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5588 def begin_patch(resource_group_name, account_name, update_parameters, custom_headers:nil) response = begin_patch_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Patches the properties of an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param update_parameters [DatabaseAccountPatchParameters] The tags parameter to patch for the current database account. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5621 def begin_patch_async(resource_group_name, account_name, update_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'update_parameters is nil' if update_parameters.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::DatabaseAccountPatchParameters.mapper() request_content = @client.serialize(request_mapper, update_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}' 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' => account_name}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:patch, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 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::V2015_04_08::Models::DatabaseAccount.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
Patches the properties of an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param update_parameters [DatabaseAccountPatchParameters] The tags parameter to patch for the current database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5605 def begin_patch_with_http_info(resource_group_name, account_name, update_parameters, custom_headers:nil) begin_patch_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers).value! end
Regenerates an access key for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of the key to regenerate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6228 def begin_regenerate_key(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) response = begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers).value! nil end
Regenerates an access key for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of the key to regenerate. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6261 def begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'key_to_regenerate is nil' if key_to_regenerate.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::V2015_04_08::Models::DatabaseAccountRegenerateKeyParameters.mapper() request_content = @client.serialize(request_mapper, key_to_regenerate) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey' 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' => account_name}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end
Regenerates an access key for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of the key to regenerate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6245 def begin_regenerate_key_with_http_info(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers).value! end
Update RUs per second of an Azure
Cosmos DB Cassandra Keyspace
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Cassandra Keyspace. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8228 def begin_update_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) response = begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Update RUs per second of an Azure
Cosmos DB Cassandra Keyspace
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Cassandra Keyspace. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8263 def begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::ThroughputUpdateParameters.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}/apis/cassandra/keyspaces/{keyspaceName}/settings/throughput' 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' => account_name,'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::V2015_04_08::Models::Throughput.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Update RUs per second of an Azure
Cosmos DB Cassandra Keyspace
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Cassandra Keyspace. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8246 def begin_update_cassandra_keyspace_throughput_with_http_info(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value! end
Update RUs per second of an Azure
Cosmos DB Cassandra table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Cassandra table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8569 def begin_update_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) response = begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Update RUs per second of an Azure
Cosmos DB Cassandra table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Cassandra table. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8606 def begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? fail ArgumentError, 'table_name is nil' if table_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::ThroughputUpdateParameters.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}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}/settings/throughput' 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' => account_name,'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::V2015_04_08::Models::Throughput.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Update RUs per second of an Azure
Cosmos DB Cassandra table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Cassandra table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8588 def begin_update_cassandra_table_throughput_with_http_info(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! end
Update RUs per second of an Azure
Cosmos DB Gremlin database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Gremlin database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8904 def begin_update_gremlin_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) response = begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Update RUs per second of an Azure
Cosmos DB Gremlin database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Gremlin database. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8939 def begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::ThroughputUpdateParameters.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}/apis/gremlin/databases/{databaseName}/settings/throughput' 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' => account_name,'databaseName' => database_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::V2015_04_08::Models::Throughput.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Update RUs per second of an Azure
Cosmos DB Gremlin database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Gremlin database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 8922 def begin_update_gremlin_database_throughput_with_http_info(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! end
Update RUs per second of an Azure
Cosmos DB Gremlin graph
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Gremlin graph. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 9245 def begin_update_gremlin_graph_throughput(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) response = begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Update RUs per second of an Azure
Cosmos DB Gremlin graph
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Gremlin graph. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 9282 def begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, 'graph_name is nil' if graph_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::ThroughputUpdateParameters.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}/apis/gremlin/databases/{databaseName}/graphs/{graphName}/settings/throughput' 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' => account_name,'databaseName' => database_name,'graphName' => graph_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::V2015_04_08::Models::Throughput.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Update RUs per second of an Azure
Cosmos DB Gremlin graph
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Gremlin graph. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 9264 def begin_update_gremlin_graph_throughput_with_http_info(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers).value! end
Update the RUs per second of an Azure
Cosmos DB MongoDB collection
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current MongoDB collection. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7564 def begin_update_mongo_dbcollection_throughput(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) response = begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Update the RUs per second of an Azure
Cosmos DB MongoDB collection
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current MongoDB collection. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7601 def begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, 'collection_name is nil' if collection_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::ThroughputUpdateParameters.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}/apis/mongodb/databases/{databaseName}/collections/{collectionName}/settings/throughput' 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' => account_name,'databaseName' => database_name,'collectionName' => collection_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::V2015_04_08::Models::Throughput.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Update the RUs per second of an Azure
Cosmos DB MongoDB collection
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current MongoDB collection. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7583 def begin_update_mongo_dbcollection_throughput_with_http_info(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:custom_headers).value! end
Update RUs per second of the an Azure
Cosmos DB MongoDB database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current MongoDB database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7223 def begin_update_mongo_dbdatabase_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) response = begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Update RUs per second of the an Azure
Cosmos DB MongoDB database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current MongoDB database. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7258 def begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::ThroughputUpdateParameters.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}/apis/mongodb/databases/{databaseName}/settings/throughput' 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' => account_name,'databaseName' => database_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::V2015_04_08::Models::Throughput.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Update RUs per second of the an Azure
Cosmos DB MongoDB database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current MongoDB database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7241 def begin_update_mongo_dbdatabase_throughput_with_http_info(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! end
Update RUs per second of an Azure
Cosmos DB SQL container
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param update_throughput_parameters [ThroughputUpdateParameters] The parameters to provide for the RUs per second of the current SQL container. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6888 def begin_update_sql_container_throughput(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) response = begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Update RUs per second of an Azure
Cosmos DB SQL container
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param update_throughput_parameters [ThroughputUpdateParameters] The parameters to provide for the RUs per second of the current SQL container. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6925 def begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, 'container_name is nil' if container_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::ThroughputUpdateParameters.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}/apis/sql/databases/{databaseName}/containers/{containerName}/settings/throughput' 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' => account_name,'databaseName' => database_name,'containerName' => container_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::V2015_04_08::Models::Throughput.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Update RUs per second of an Azure
Cosmos DB SQL container
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param update_throughput_parameters [ThroughputUpdateParameters] The parameters to provide for the RUs per second of the current SQL container. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6907 def begin_update_sql_container_throughput_with_http_info(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:custom_headers).value! end
Update RUs per second of an Azure
Cosmos DB SQL database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param update_throughput_parameters [ThroughputUpdateParameters] The parameters to provide for the RUs per second of the current SQL database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6547 def begin_update_sql_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) response = begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Update RUs per second of an Azure
Cosmos DB SQL database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param update_throughput_parameters [ThroughputUpdateParameters] The parameters to provide for the RUs per second of the current SQL database. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6582 def begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::ThroughputUpdateParameters.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}/apis/sql/databases/{databaseName}/settings/throughput' 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' => account_name,'databaseName' => database_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::V2015_04_08::Models::Throughput.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Update RUs per second of an Azure
Cosmos DB SQL database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param update_throughput_parameters [ThroughputUpdateParameters] The parameters to provide for the RUs per second of the current SQL database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 6565 def begin_update_sql_database_throughput_with_http_info(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! end
Update RUs per second of an Azure
Cosmos DB Table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param update_throughput_parameters [ThroughputUpdateParameters] The parameters to provide for the RUs per second of the current Table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7896 def begin_update_table_throughput(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) response = begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Update RUs per second of an Azure
Cosmos DB Table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param update_throughput_parameters [ThroughputUpdateParameters] The parameters to provide for the RUs per second of the current Table. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7931 def begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'table_name is nil' if table_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::ThroughputUpdateParameters.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}/apis/table/tables/{tableName}/settings/throughput' 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' => account_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::V2015_04_08::Models::Throughput.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Update RUs per second of an Azure
Cosmos DB Table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param update_throughput_parameters [ThroughputUpdateParameters] The parameters to provide for the RUs per second of the current Table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 7914 def begin_update_table_throughput_with_http_info(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! end
Checks that the Azure
Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters.
@param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Boolean] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1032 def check_name_exists(account_name, custom_headers:nil) response = check_name_exists_async(account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Checks that the Azure
Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters.
@param account_name [String] Cosmos DB database account name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1063 def check_name_exists_async(account_name, custom_headers:nil) fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'accountName' => account_name}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:head, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 404 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.body = (status_code == 200) 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
Checks that the Azure
Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters.
@param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1048 def check_name_exists_with_http_info(account_name, custom_headers:nil) check_name_exists_async(account_name, custom_headers:custom_headers).value! end
Creates or updates an Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The parameters to provide for the current database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DatabaseAccount] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 182 def create_or_update(resource_group_name, account_name, create_update_parameters, custom_headers:nil) response = create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The parameters to provide for the current database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 198 def create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:nil) # Send request promise = begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::DatabaseAccount.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 or update an Azure
Cosmos DB Cassandra keyspace
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param create_update_cassandra_keyspace_parameters
- CassandraKeyspaceCreateUpdateParameters
-
The parameters to provide for the
current Cassandra keyspace. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CassandraKeyspace] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3956 def create_update_cassandra_keyspace(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) response = create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param create_update_cassandra_keyspace_parameters
- CassandraKeyspaceCreateUpdateParameters
-
The parameters to provide for the
current Cassandra keyspace. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3974 def create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil) # Send request promise = begin_create_update_cassandra_keyspace_async(resource_group_name, account_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::V2015_04_08::Models::CassandraKeyspace.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 or update an Azure
Cosmos DB Cassandra Table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param create_update_cassandra_table_parameters
- CassandraTableCreateUpdateParameters
-
The parameters to provide for the
current Cassandra Table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CassandraTable] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4414 def create_update_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil) response = create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param create_update_cassandra_table_parameters
- CassandraTableCreateUpdateParameters
-
The parameters to provide for the
current Cassandra Table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4433 def create_update_cassandra_table_async(resource_group_name, account_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, account_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::V2015_04_08::Models::CassandraTable.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 or update an Azure
Cosmos DB Gremlin database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param create_update_gremlin_database_parameters
- GremlinDatabaseCreateUpdateParameters
-
The parameters to provide for the
current Gremlin database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [GremlinDatabase] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4878 def create_update_gremlin_database(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) response = create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param create_update_gremlin_database_parameters
- GremlinDatabaseCreateUpdateParameters
-
The parameters to provide for the
current Gremlin database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4896 def create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil) # Send request promise = begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::GremlinDatabase.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 or update an Azure
Cosmos DB Gremlin graph
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param create_update_gremlin_graph_parameters
- GremlinGraphCreateUpdateParameters
-
The parameters to provide for the
current Gremlin graph. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [GremlinGraph] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5336 def create_update_gremlin_graph(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) response = create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param create_update_gremlin_graph_parameters
- GremlinGraphCreateUpdateParameters
-
The parameters to provide for the
current Gremlin graph. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5355 def create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil) # Send request promise = begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::GremlinGraph.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 or update an Azure
Cosmos DB MongoDB Collection
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param create_update_mongo_dbcollection_parameters
- MongoDBCollectionCreateUpdateParameters
-
The parameters to provide for the
current MongoDB Collection
. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MongoDBCollection] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3042 def create_update_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) response = create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param create_update_mongo_dbcollection_parameters
- MongoDBCollectionCreateUpdateParameters
-
The parameters to provide for the
current MongoDB Collection
. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3061 def create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:nil) # Send request promise = begin_create_update_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, create_update_mongo_dbcollection_parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::MongoDBCollection.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 or updates Azure
Cosmos DB MongoDB database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param create_update_mongo_dbdatabase_parameters
- MongoDBDatabaseCreateUpdateParameters
-
The parameters to provide for the
current MongoDB database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MongoDBDatabase] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2578 def create_update_mongo_dbdatabase(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) response = create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param create_update_mongo_dbdatabase_parameters
- MongoDBDatabaseCreateUpdateParameters
-
The parameters to provide for the
current MongoDB database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2596 def create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:nil) # Send request promise = begin_create_update_mongo_dbdatabase_async(resource_group_name, account_name, database_name, create_update_mongo_dbdatabase_parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::MongoDBDatabase.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 or update an Azure
Cosmos DB SQL container
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param create_update_sql_container_parameters
- SqlContainerCreateUpdateParameters
-
The parameters to provide for the
current SQL container. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SqlContainer] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2114 def create_update_sql_container(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) response = create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param create_update_sql_container_parameters
- SqlContainerCreateUpdateParameters
-
The parameters to provide for the
current SQL container. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2133 def create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:nil) # Send request promise = begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::SqlContainer.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 or update an Azure
Cosmos DB SQL database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param create_update_sql_database_parameters
- SqlDatabaseCreateUpdateParameters
-
The parameters to provide for the current
SQL database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SqlDatabase] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1656 def create_update_sql_database(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) response = create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param create_update_sql_database_parameters
- SqlDatabaseCreateUpdateParameters
-
The parameters to provide for the current
SQL database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1674 def create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:nil) # Send request promise = begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::SqlDatabase.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 or update an Azure
Cosmos DB Table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param create_update_table_parameters [TableCreateUpdateParameters] The parameters to provide for the current Table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Table] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3502 def create_update_table(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) response = create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param create_update_table_parameters [TableCreateUpdateParameters] The parameters to provide for the current Table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3519 def create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil) # Send request promise = begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_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::V2015_04_08::Models::Table.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
Deletes an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 224 def delete(resource_group_name, account_name, custom_headers:nil) response = delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! nil end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 238 def delete_async(resource_group_name, account_name, custom_headers:nil) # Send request promise = begin_delete_async(resource_group_name, account_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
Deletes an existing Azure
Cosmos DB Cassandra keyspace.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4001 def delete_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers:nil) response = delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! nil end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4016 def delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) # Send request promise = begin_delete_cassandra_keyspace_async(resource_group_name, account_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
Deletes an existing Azure
Cosmos DB Cassandra table.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4461 def delete_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) response = delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! nil end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4477 def delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) # Send request promise = begin_delete_cassandra_table_async(resource_group_name, account_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
Deletes an existing Azure
Cosmos DB Gremlin database.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4923 def delete_gremlin_database(resource_group_name, account_name, database_name, custom_headers:nil) response = delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! nil end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4938 def delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:nil) # Send request promise = begin_delete_gremlin_database_async(resource_group_name, account_name, database_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
Deletes an existing Azure
Cosmos DB Gremlin graph.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5383 def delete_gremlin_graph(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) response = delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! nil end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5399 def delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) # Send request promise = begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_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
Deletes an existing Azure
Cosmos DB MongoDB Collection
.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3089 def delete_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) response = delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! nil end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3105 def delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) # Send request promise = begin_delete_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_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
Deletes an existing Azure
Cosmos DB MongoDB database.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2623 def delete_mongo_dbdatabase(resource_group_name, account_name, database_name, custom_headers:nil) response = delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! nil end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2638 def delete_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:nil) # Send request promise = begin_delete_mongo_dbdatabase_async(resource_group_name, account_name, database_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
Deletes an existing Azure
Cosmos DB SQL container.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2161 def delete_sql_container(resource_group_name, account_name, database_name, container_name, custom_headers:nil) response = delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! nil end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2177 def delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) # Send request promise = begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_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
Deletes an existing Azure
Cosmos DB SQL database.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1701 def delete_sql_database(resource_group_name, account_name, database_name, custom_headers:nil) response = delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! nil end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1716 def delete_sql_database_async(resource_group_name, account_name, database_name, custom_headers:nil) # Send request promise = begin_delete_sql_database_async(resource_group_name, account_name, database_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
Deletes an existing Azure
Cosmos DB Table.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3546 def delete_table(resource_group_name, account_name, table_name, custom_headers:nil) response = delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! nil end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3561 def delete_table_async(resource_group_name, account_name, table_name, custom_headers:nil) # Send request promise = begin_delete_table_async(resource_group_name, account_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
Changes the failover priority for the Azure
Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param failover_parameters [FailoverPolicies] The new failover policies for the database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 267 def failover_priority_change(resource_group_name, account_name, failover_parameters, custom_headers:nil) response = failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers).value! nil end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param failover_parameters [FailoverPolicies] The new failover policies for the database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 283 def failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:nil) # Send request promise = begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
Retrieves the properties of an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DatabaseAccount] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 34 def get(resource_group_name, account_name, custom_headers:nil) response = get_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Retrieves the properties of an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 63 def get_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' 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' => account_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::V2015_04_08::Models::DatabaseAccount.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
Gets the Cassandra keyspaces under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CassandraKeyspace] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3847 def get_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers:nil) response = get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the Cassandra keyspaces under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3880 def get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{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' => account_name,'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::V2015_04_08::Models::CassandraKeyspace.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
Gets the RUs per second of the Cassandra Keyspace under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4044 def get_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, custom_headers:nil) response = get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the RUs per second of the Cassandra Keyspace under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4077 def get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/settings/throughput' 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' => account_name,'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::V2015_04_08::Models::Throughput.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
Gets the RUs per second of the Cassandra Keyspace under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4061 def get_cassandra_keyspace_throughput_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! end
Gets the Cassandra keyspaces under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3864 def get_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! end
Gets the Cassandra table under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CassandraTable] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4303 def get_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) response = get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the Cassandra table under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4336 def get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? fail ArgumentError, 'table_name is nil' if table_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{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' => account_name,'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::V2015_04_08::Models::CassandraTable.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
Gets the RUs per second of the Cassandra table under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4506 def get_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) response = get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the RUs per second of the Cassandra table under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4541 def get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? fail ArgumentError, 'table_name is nil' if table_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}/settings/throughput' 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' => account_name,'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::V2015_04_08::Models::Throughput.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
Gets the RUs per second of the Cassandra table under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4524 def get_cassandra_table_throughput_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! end
Gets the Cassandra table under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4320 def get_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil) get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value! end
Gets the Gremlin databases under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [GremlinDatabase] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4769 def get_gremlin_database(resource_group_name, account_name, database_name, custom_headers:nil) response = get_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the Gremlin databases under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4802 def get_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}' 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' => account_name,'databaseName' => database_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::V2015_04_08::Models::GremlinDatabase.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
Gets the RUs per second of the Gremlin database under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4966 def get_gremlin_database_throughput(resource_group_name, account_name, database_name, custom_headers:nil) response = get_gremlin_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the RUs per second of the Gremlin database under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4999 def get_gremlin_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/settings/throughput' 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' => account_name,'databaseName' => database_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::V2015_04_08::Models::Throughput.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
Gets the RUs per second of the Gremlin database under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4983 def get_gremlin_database_throughput_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) get_gremlin_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! end
Gets the Gremlin databases under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4786 def get_gremlin_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) get_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! end
Gets the Gremlin graph under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [GremlinGraph] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5225 def get_gremlin_graph(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) response = get_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the Gremlin graph under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5258 def get_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, 'graph_name is nil' if graph_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}' 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' => account_name,'databaseName' => database_name,'graphName' => graph_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::V2015_04_08::Models::GremlinGraph.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
Gets the Gremlin graph throughput under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5428 def get_gremlin_graph_throughput(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) response = get_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the Gremlin graph throughput under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5463 def get_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, 'graph_name is nil' if graph_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}/settings/throughput' 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' => account_name,'databaseName' => database_name,'graphName' => graph_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::V2015_04_08::Models::Throughput.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
Gets the Gremlin graph throughput under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5446 def get_gremlin_graph_throughput_with_http_info(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) get_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! end
Gets the Gremlin graph under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5242 def get_gremlin_graph_with_http_info(resource_group_name, account_name, database_name, graph_name, custom_headers:nil) get_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value! end
Gets the MongoDB collection under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MongoDBCollection] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2929 def get_mongo_dbcollection(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) response = get_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the MongoDB collection under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2964 def get_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, 'collection_name is nil' if collection_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}' 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' => account_name,'databaseName' => database_name,'collectionName' => collection_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::V2015_04_08::Models::MongoDBCollection.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
Gets the RUs per second of the MongoDB collection under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3134 def get_mongo_dbcollection_throughput(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) response = get_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the RUs per second of the MongoDB collection under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3169 def get_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, 'collection_name is nil' if collection_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}/settings/throughput' 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' => account_name,'databaseName' => database_name,'collectionName' => collection_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::V2015_04_08::Models::Throughput.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
Gets the RUs per second of the MongoDB collection under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3152 def get_mongo_dbcollection_throughput_with_http_info(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) get_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! end
Gets the MongoDB collection under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2947 def get_mongo_dbcollection_with_http_info(resource_group_name, account_name, database_name, collection_name, custom_headers:nil) get_mongo_dbcollection_async(resource_group_name, account_name, database_name, collection_name, custom_headers:custom_headers).value! end
Gets the MongoDB databases under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MongoDBDatabase] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2469 def get_mongo_dbdatabase(resource_group_name, account_name, database_name, custom_headers:nil) response = get_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the MongoDB databases under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2502 def get_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}' 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' => account_name,'databaseName' => database_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::V2015_04_08::Models::MongoDBDatabase.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
Gets the RUs per second of the MongoDB database under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2666 def get_mongo_dbdatabase_throughput(resource_group_name, account_name, database_name, custom_headers:nil) response = get_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the RUs per second of the MongoDB database under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2699 def get_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/settings/throughput' 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' => account_name,'databaseName' => database_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::V2015_04_08::Models::Throughput.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
Gets the RUs per second of the MongoDB database under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2683 def get_mongo_dbdatabase_throughput_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) get_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! end
Gets the MongoDB databases under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2486 def get_mongo_dbdatabase_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) get_mongo_dbdatabase_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! end
Lists the read-only access keys for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DatabaseAccountListReadOnlyKeysResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 784 def get_read_only_keys(resource_group_name, account_name, custom_headers:nil) response = get_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the read-only access keys for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 815 def get_read_only_keys_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys' 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' => account_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::V2015_04_08::Models::DatabaseAccountListReadOnlyKeysResult.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
Lists the read-only access keys for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 800 def get_read_only_keys_with_http_info(resource_group_name, account_name, custom_headers:nil) get_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! end
Gets the SQL container under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SqlContainer] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2003 def get_sql_container(resource_group_name, account_name, database_name, container_name, custom_headers:nil) response = get_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the SQL container under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2036 def get_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, 'container_name is nil' if container_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}' 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' => account_name,'databaseName' => database_name,'containerName' => container_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::V2015_04_08::Models::SqlContainer.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
Gets the RUs per second of the SQL container under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2206 def get_sql_container_throughput(resource_group_name, account_name, database_name, container_name, custom_headers:nil) response = get_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the RUs per second of the SQL container under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2241 def get_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, 'container_name is nil' if container_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}/settings/throughput' 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' => account_name,'databaseName' => database_name,'containerName' => container_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::V2015_04_08::Models::Throughput.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
Gets the RUs per second of the SQL container under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2224 def get_sql_container_throughput_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) get_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! end
Gets the SQL container under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2020 def get_sql_container_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers:nil) get_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers:custom_headers).value! end
Gets the SQL database under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SqlDatabase] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1547 def get_sql_database(resource_group_name, account_name, database_name, custom_headers:nil) response = get_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the SQL database under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1580 def get_sql_database_async(resource_group_name, account_name, database_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}' 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' => account_name,'databaseName' => database_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::V2015_04_08::Models::SqlDatabase.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
Gets the RUs per second of the SQL database under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1744 def get_sql_database_throughput(resource_group_name, account_name, database_name, custom_headers:nil) response = get_sql_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the RUs per second of the SQL database under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1777 def get_sql_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/settings/throughput' 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' => account_name,'databaseName' => database_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::V2015_04_08::Models::Throughput.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
Gets the RUs per second of the SQL database under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1761 def get_sql_database_throughput_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) get_sql_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! end
Gets the SQL database under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1564 def get_sql_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) get_sql_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! end
Gets the Tables under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Table] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3394 def get_table(resource_group_name, account_name, table_name, custom_headers:nil) response = get_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the Tables under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3427 def get_table_async(resource_group_name, account_name, table_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'table_name is nil' if table_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/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' => account_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::V2015_04_08::Models::Table.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
Gets the RUs per second of the Table under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3589 def get_table_throughput(resource_group_name, account_name, table_name, custom_headers:nil) response = get_table_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the RUs per second of the Table under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3622 def get_table_throughput_async(resource_group_name, account_name, table_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'table_name is nil' if table_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}/settings/throughput' 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' => account_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::V2015_04_08::Models::Throughput.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
Gets the RUs per second of the Table under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3606 def get_table_throughput_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil) get_table_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! end
Gets the Tables under an existing Azure
Cosmos DB database account with the provided name.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3411 def get_table_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil) get_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value! end
Retrieves the properties of an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 49 def get_with_http_info(resource_group_name, account_name, custom_headers:nil) get_async(resource_group_name, account_name, custom_headers:custom_headers).value! end
Lists all the Azure
Cosmos DB database accounts available under the subscription.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DatabaseAccountsListResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 308 def list(custom_headers:nil) response = list_async(custom_headers:custom_headers).value! response.body unless response.nil? end
Lists all the Azure
Cosmos DB database accounts available under the subscription.
@param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 335 def list_async(custom_headers:nil) fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::DatabaseAccountsListResult.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
Lists all the Azure
Cosmos DB database accounts available under the given resource group.
@param resource_group_name [String] Name of an Azure
resource group. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DatabaseAccountsListResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 398 def list_by_resource_group(resource_group_name, custom_headers:nil) response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists all the Azure
Cosmos DB database accounts available under the given resource group.
@param resource_group_name [String] Name of an Azure
resource group. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 427 def list_by_resource_group_async(resource_group_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::DatabaseAccountsListResult.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
Lists all the Azure
Cosmos DB database accounts available under the given resource group.
@param resource_group_name [String] Name of an Azure
resource group. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 413 def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil) list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value! end
Lists the Cassandra keyspaces under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CassandraKeyspaceListResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3743 def list_cassandra_keyspaces(resource_group_name, account_name, custom_headers:nil) response = list_cassandra_keyspaces_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the Cassandra keyspaces under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3774 def list_cassandra_keyspaces_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces' 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' => account_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::V2015_04_08::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
Lists the Cassandra keyspaces under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3759 def list_cassandra_keyspaces_with_http_info(resource_group_name, account_name, custom_headers:nil) list_cassandra_keyspaces_async(resource_group_name, account_name, custom_headers:custom_headers).value! end
Lists the Cassandra table under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CassandraTableListResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4198 def list_cassandra_tables(resource_group_name, account_name, keyspace_name, custom_headers:nil) response = list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the Cassandra table under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4229 def list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{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' => account_name,'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::V2015_04_08::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
Lists the Cassandra table under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4214 def list_cassandra_tables_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil) list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value! end
Lists the connection strings for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DatabaseAccountListConnectionStringsResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 595 def list_connection_strings(resource_group_name, account_name, custom_headers:nil) response = list_connection_strings_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the connection strings for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 626 def list_connection_strings_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings' 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' => account_name}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::DatabaseAccountListConnectionStringsResult.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
Lists the connection strings for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 611 def list_connection_strings_with_http_info(resource_group_name, account_name, custom_headers:nil) list_connection_strings_async(resource_group_name, account_name, custom_headers:custom_headers).value! end
Lists the Gremlin databases under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [GremlinDatabaseListResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4665 def list_gremlin_databases(resource_group_name, account_name, custom_headers:nil) response = list_gremlin_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the Gremlin databases under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4696 def list_gremlin_databases_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases' 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' => account_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::V2015_04_08::Models::GremlinDatabaseListResult.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
Lists the Gremlin databases under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4681 def list_gremlin_databases_with_http_info(resource_group_name, account_name, custom_headers:nil) list_gremlin_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! end
Lists the Gremlin graph under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [GremlinGraphListResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5120 def list_gremlin_graphs(resource_group_name, account_name, database_name, custom_headers:nil) response = list_gremlin_graphs_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the Gremlin graph under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5151 def list_gremlin_graphs_async(resource_group_name, account_name, database_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs' 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' => account_name,'databaseName' => database_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::V2015_04_08::Models::GremlinGraphListResult.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
Lists the Gremlin graph under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5136 def list_gremlin_graphs_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) list_gremlin_graphs_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! end
Lists the access keys for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DatabaseAccountListKeysResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 494 def list_keys(resource_group_name, account_name, custom_headers:nil) response = list_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the access keys for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 523 def list_keys_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys' 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' => account_name}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::DatabaseAccountListKeysResult.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
Lists the access keys for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 509 def list_keys_with_http_info(resource_group_name, account_name, custom_headers:nil) list_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! end
Retrieves metric definitions for the given database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MetricDefinitionsListResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1345 def list_metric_definitions(resource_group_name, account_name, custom_headers:nil) response = list_metric_definitions_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Retrieves metric definitions for the given database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1374 def list_metric_definitions_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions' 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' => account_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::V2015_04_08::Models::MetricDefinitionsListResult.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
Retrieves metric definitions for the given database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1360 def list_metric_definitions_with_http_info(resource_group_name, account_name, custom_headers:nil) list_metric_definitions_async(resource_group_name, account_name, custom_headers:custom_headers).value! end
Retrieves the metrics determined by the given filter for the given database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param filter [String] An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MetricListResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1125 def list_metrics(resource_group_name, account_name, filter, custom_headers:nil) response = list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value! response.body unless response.nil? end
Retrieves the metrics determined by the given filter for the given database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param filter [String] An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1164 def list_metrics_async(resource_group_name, account_name, filter, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'filter is nil' if filter.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics' 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' => account_name}, query_params: {'api-version' => @client.api_version,'$filter' => filter}, 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::V2015_04_08::Models::MetricListResult.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
Retrieves the metrics determined by the given filter for the given database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param filter [String] An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1145 def list_metrics_with_http_info(resource_group_name, account_name, filter, custom_headers:nil) list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value! end
Lists the MongoDB collection under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MongoDBCollectionListResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2821 def list_mongo_dbcollections(resource_group_name, account_name, database_name, custom_headers:nil) response = list_mongo_dbcollections_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the MongoDB collection under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2854 def list_mongo_dbcollections_async(resource_group_name, account_name, database_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections' 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' => account_name,'databaseName' => database_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::V2015_04_08::Models::MongoDBCollectionListResult.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
Lists the MongoDB collection under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2838 def list_mongo_dbcollections_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) list_mongo_dbcollections_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! end
Lists the MongoDB databases under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MongoDBDatabaseListResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2365 def list_mongo_dbdatabases(resource_group_name, account_name, custom_headers:nil) response = list_mongo_dbdatabases_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the MongoDB databases under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2396 def list_mongo_dbdatabases_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases' 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' => account_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::V2015_04_08::Models::MongoDBDatabaseListResult.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
Lists the MongoDB databases under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2381 def list_mongo_dbdatabases_with_http_info(resource_group_name, account_name, custom_headers:nil) list_mongo_dbdatabases_async(resource_group_name, account_name, custom_headers:custom_headers).value! end
Lists the read-only access keys for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DatabaseAccountListReadOnlyKeysResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 887 def list_read_only_keys(resource_group_name, account_name, custom_headers:nil) response = list_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the read-only access keys for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 918 def list_read_only_keys_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys' 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' => account_name}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::DatabaseAccountListReadOnlyKeysResult.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
Lists the read-only access keys for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 903 def list_read_only_keys_with_http_info(resource_group_name, account_name, custom_headers:nil) list_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value! end
Lists the SQL container under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SqlContainerListResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1898 def list_sql_containers(resource_group_name, account_name, database_name, custom_headers:nil) response = list_sql_containers_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the SQL container under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1929 def list_sql_containers_async(resource_group_name, account_name, database_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, 'database_name is nil' if database_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers' 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' => account_name,'databaseName' => database_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::V2015_04_08::Models::SqlContainerListResult.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
Lists the SQL container under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1914 def list_sql_containers_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil) list_sql_containers_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value! end
Lists the SQL databases under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SqlDatabaseListResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1445 def list_sql_databases(resource_group_name, account_name, custom_headers:nil) response = list_sql_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the SQL databases under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1474 def list_sql_databases_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases' 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' => account_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::V2015_04_08::Models::SqlDatabaseListResult.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
Lists the SQL databases under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1460 def list_sql_databases_with_http_info(resource_group_name, account_name, custom_headers:nil) list_sql_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value! end
Lists the Tables under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [TableListResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3292 def list_tables(resource_group_name, account_name, custom_headers:nil) response = list_tables_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the Tables under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3321 def list_tables_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/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' => account_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::V2015_04_08::Models::TableListResult.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
Lists the Tables under an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3307 def list_tables_with_http_info(resource_group_name, account_name, custom_headers:nil) list_tables_async(resource_group_name, account_name, custom_headers:custom_headers).value! end
Retrieves the usages (most recent data) for the given database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param filter [String] An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [UsagesResult] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1239 def list_usages(resource_group_name, account_name, filter:nil, custom_headers:nil) response = list_usages_async(resource_group_name, account_name, filter:filter, custom_headers:custom_headers).value! response.body unless response.nil? end
Retrieves the usages (most recent data) for the given database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param filter [String] An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1274 def list_usages_async(resource_group_name, account_name, filter:nil, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages' 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' => account_name}, query_params: {'api-version' => @client.api_version,'$filter' => filter}, 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::V2015_04_08::Models::UsagesResult.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
Retrieves the usages (most recent data) for the given database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param filter [String] An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1257 def list_usages_with_http_info(resource_group_name, account_name, filter:nil, custom_headers:nil) list_usages_async(resource_group_name, account_name, filter:filter, custom_headers:custom_headers).value! end
Lists all the Azure
Cosmos DB database accounts available under the subscription.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 322 def list_with_http_info(custom_headers:nil) list_async(custom_headers:custom_headers).value! end
Offline the specified region for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region to offline for the database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 698 def offline_region(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) response = offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers).value! nil end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region to offline for the database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 714 def offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil) # Send request promise = begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, 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
Online the specified region for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region to online for the database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 741 def online_region(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) response = online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers).value! nil end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region to online for the database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 757 def online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil) # Send request promise = begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, 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
Patches the properties of an existing Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param update_parameters [DatabaseAccountPatchParameters] The tags parameter to patch for the current database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DatabaseAccount] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 136 def patch(resource_group_name, account_name, update_parameters, custom_headers:nil) response = patch_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param update_parameters [DatabaseAccountPatchParameters] The tags parameter to patch for the current database account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 152 def patch_async(resource_group_name, account_name, update_parameters, custom_headers:nil) # Send request promise = begin_patch_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::DatabaseAccount.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
Regenerates an access key for the specified Azure
Cosmos DB database account.
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of the key to regenerate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 989 def regenerate_key(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) response = regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers).value! nil end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of the key to regenerate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1005 def regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:nil) # Send request promise = begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, 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
Update RUs per second of an Azure
Cosmos DB Cassandra Keyspace
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Cassandra Keyspace. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4152 def update_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) response = update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Cassandra Keyspace. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4169 def update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil) # Send request promise = begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_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::V2015_04_08::Models::Throughput.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 RUs per second of an Azure
Cosmos DB Cassandra table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Cassandra table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4618 def update_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) response = update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param keyspace_name [String] Cosmos DB keyspace name. @param table_name [String] Cosmos DB table name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Cassandra table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 4636 def update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil) # Send request promise = begin_update_cassandra_table_throughput_async(resource_group_name, account_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::V2015_04_08::Models::Throughput.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 RUs per second of an Azure
Cosmos DB Gremlin database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Gremlin database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5074 def update_gremlin_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) response = update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Gremlin database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5091 def update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) # Send request promise = begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_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::V2015_04_08::Models::Throughput.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 RUs per second of an Azure
Cosmos DB Gremlin graph
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Gremlin graph. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5540 def update_gremlin_graph_throughput(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) response = update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param graph_name [String] Cosmos DB graph name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current Gremlin graph. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 5558 def update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil) # Send request promise = begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_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::V2015_04_08::Models::Throughput.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 the RUs per second of an Azure
Cosmos DB MongoDB collection
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current MongoDB collection. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3246 def update_mongo_dbcollection_throughput(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) response = update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param collection_name [String] Cosmos DB collection name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current MongoDB collection. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3264 def update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_name, update_throughput_parameters, custom_headers:nil) # Send request promise = begin_update_mongo_dbcollection_throughput_async(resource_group_name, account_name, database_name, collection_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::V2015_04_08::Models::Throughput.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 RUs per second of the an Azure
Cosmos DB MongoDB database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current MongoDB database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2774 def update_mongo_dbdatabase_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) response = update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param update_throughput_parameters [ThroughputUpdateParameters] The RUs per second of the parameters to provide for the current MongoDB database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2791 def update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) # Send request promise = begin_update_mongo_dbdatabase_throughput_async(resource_group_name, account_name, database_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::V2015_04_08::Models::Throughput.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 RUs per second of an Azure
Cosmos DB SQL container
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param update_throughput_parameters [ThroughputUpdateParameters] The parameters to provide for the RUs per second of the current SQL container. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2318 def update_sql_container_throughput(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) response = update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param container_name [String] Cosmos DB container name. @param update_throughput_parameters [ThroughputUpdateParameters] The parameters to provide for the RUs per second of the current SQL container. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 2336 def update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers:nil) # Send request promise = begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_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::V2015_04_08::Models::Throughput.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 RUs per second of an Azure
Cosmos DB SQL database
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param update_throughput_parameters [ThroughputUpdateParameters] The parameters to provide for the RUs per second of the current SQL database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1852 def update_sql_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) response = update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param database_name [String] Cosmos DB database name. @param update_throughput_parameters [ThroughputUpdateParameters] The parameters to provide for the RUs per second of the current SQL database. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 1869 def update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil) # Send request promise = begin_update_sql_database_throughput_async(resource_group_name, account_name, database_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::V2015_04_08::Models::Throughput.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 RUs per second of an Azure
Cosmos DB Table
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param update_throughput_parameters [ThroughputUpdateParameters] The parameters to provide for the RUs per second of the current Table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Throughput] operation results.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3697 def update_table_throughput(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) response = update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of an Azure
resource group. @param account_name [String] Cosmos DB database account name. @param table_name [String] Cosmos DB table name. @param update_throughput_parameters [ThroughputUpdateParameters] The parameters to provide for the RUs per second of the current Table. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb, line 3714 def update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil) # Send request promise = begin_update_table_throughput_async(resource_group_name, account_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::V2015_04_08::Models::Throughput.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