Class: Azure::Cosmosdb::Mgmt::V2019_12_12::SqlResources

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb

Overview

Azure Cosmos DB Database Service Resource Provider REST API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ SqlResources

Creates and initializes a new instance of the SqlResources class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientCosmosDBManagementClient (readonly)

Returns reference to the CosmosDBManagementClient.

Returns:



22
23
24
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 22

def client
  @client
end

Instance Method Details

#begin_create_update_sql_container(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers: nil) ⇒ SqlContainerGetResults

Create or update an Azure Cosmos DB SQL container

SqlContainerCreateUpdateParameters

The parameters to provide for the

current SQL container. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (SqlContainerGetResults)

    operation results.



2263
2264
2265
2266
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2263

def begin_create_update_sql_container(resource_group_name, , database_name, container_name, create_update_sql_container_parameters, custom_headers:nil)
  response = begin_create_update_sql_container_async(resource_group_name, , database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Create or update an Azure Cosmos DB SQL container

SqlContainerCreateUpdateParameters

The parameters to provide for the

current SQL container. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2302

def begin_create_update_sql_container_async(resource_group_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 .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, '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::V2019_12_12::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}/sqlDatabases/{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' => ,'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::V2019_12_12::Models::SqlContainerGetResults.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_create_update_sql_container_with_http_info(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update an Azure Cosmos DB SQL container

SqlContainerCreateUpdateParameters

The parameters to provide for the

current SQL container. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2283
2284
2285
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2283

def begin_create_update_sql_container_with_http_info(resource_group_name, , database_name, container_name, create_update_sql_container_parameters, custom_headers:nil)
  begin_create_update_sql_container_async(resource_group_name, , database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers).value!
end

#begin_create_update_sql_database(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers: nil) ⇒ SqlDatabaseGetResults

Create or update an Azure Cosmos DB SQL database

SqlDatabaseCreateUpdateParameters

The parameters to provide for the current

SQL database. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

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

    A hash of custom headers that

Returns:

  • (SqlDatabaseGetResults)

    operation results.



1930
1931
1932
1933
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1930

def begin_create_update_sql_database(resource_group_name, , database_name, create_update_sql_database_parameters, custom_headers:nil)
  response = begin_create_update_sql_database_async(resource_group_name, , database_name, create_update_sql_database_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Create or update an Azure Cosmos DB SQL database

SqlDatabaseCreateUpdateParameters

The parameters to provide for the current

SQL database. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

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

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1967

def begin_create_update_sql_database_async(resource_group_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 .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, '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::V2019_12_12::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}/sqlDatabases/{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' => ,'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::V2019_12_12::Models::SqlDatabaseGetResults.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_create_update_sql_database_with_http_info(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update an Azure Cosmos DB SQL database

SqlDatabaseCreateUpdateParameters

The parameters to provide for the current

SQL database. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1949
1950
1951
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1949

def begin_create_update_sql_database_with_http_info(resource_group_name, , database_name, create_update_sql_database_parameters, custom_headers:nil)
  begin_create_update_sql_database_async(resource_group_name, , database_name, create_update_sql_database_parameters, custom_headers:custom_headers).value!
end

#begin_create_update_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers: nil) ⇒ SqlStoredProcedureGetResults

Create or update an Azure Cosmos DB SQL storedProcedure

SqlStoredProcedureCreateUpdateParameters

The parameters to provide for the

current SQL storedProcedure. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • stored_procedure_name (String)

    Cosmos DB storedProcedure name.

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

    A hash of custom headers that

Returns:

  • (SqlStoredProcedureGetResults)

    operation results.



2608
2609
2610
2611
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2608

def begin_create_update_sql_stored_procedure(resource_group_name, , database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil)
  response = begin_create_update_sql_stored_procedure_async(resource_group_name, , database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Create or update an Azure Cosmos DB SQL storedProcedure

SqlStoredProcedureCreateUpdateParameters

The parameters to provide for the

current SQL storedProcedure. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • stored_procedure_name (String)

    Cosmos DB storedProcedure name.

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

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2649

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


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

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

  # Serialize Request
  request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlStoredProcedureCreateUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  create_update_sql_stored_procedure_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}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}'

  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' => ,'databaseName' => database_name,'containerName' => container_name,'storedProcedureName' => stored_procedure_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

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

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

    result
  end

  promise.execute
end

#begin_create_update_sql_stored_procedure_with_http_info(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update an Azure Cosmos DB SQL storedProcedure

SqlStoredProcedureCreateUpdateParameters

The parameters to provide for the

current SQL storedProcedure. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • stored_procedure_name (String)

    Cosmos DB storedProcedure name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2629
2630
2631
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2629

def begin_create_update_sql_stored_procedure_with_http_info(resource_group_name, , database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil)
  begin_create_update_sql_stored_procedure_async(resource_group_name, , database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers).value!
end

#begin_create_update_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers: nil) ⇒ SqlTriggerGetResults

Create or update an Azure Cosmos DB SQL trigger

SqlTriggerCreateUpdateParameters

The parameters to provide for the current

SQL trigger. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • trigger_name (String)

    Cosmos DB trigger name.

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

    A hash of custom headers that

Returns:

  • (SqlTriggerGetResults)

    operation results.



3074
3075
3076
3077
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 3074

def begin_create_update_sql_trigger(resource_group_name, , database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil)
  response = begin_create_update_sql_trigger_async(resource_group_name, , database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Create or update an Azure Cosmos DB SQL trigger

SqlTriggerCreateUpdateParameters

The parameters to provide for the current

SQL trigger. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • trigger_name (String)

    Cosmos DB trigger name.

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

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 3115

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


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

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

  # Serialize Request
  request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlTriggerCreateUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  create_update_sql_trigger_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}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}'

  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' => ,'databaseName' => database_name,'containerName' => container_name,'triggerName' => trigger_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

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

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

    result
  end

  promise.execute
end

#begin_create_update_sql_trigger_with_http_info(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update an Azure Cosmos DB SQL trigger

SqlTriggerCreateUpdateParameters

The parameters to provide for the current

SQL trigger. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • trigger_name (String)

    Cosmos DB trigger name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3095
3096
3097
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 3095

def begin_create_update_sql_trigger_with_http_info(resource_group_name, , database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil)
  begin_create_update_sql_trigger_async(resource_group_name, , database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers).value!
end

#begin_create_update_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers: nil) ⇒ SqlUserDefinedFunctionGetResults

Create or update an Azure Cosmos DB SQL userDefinedFunction

name.

SqlUserDefinedFunctionCreateUpdateParameters

The parameters to provide for

the current SQL userDefinedFunction. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • user_defined_function_name (String)

    Cosmos DB userDefinedFunction

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

    A hash of custom headers that

Returns:

  • (SqlUserDefinedFunctionGetResults)

    operation results.



2839
2840
2841
2842
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2839

def begin_create_update_sql_user_defined_function(resource_group_name, , database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil)
  response = begin_create_update_sql_user_defined_function_async(resource_group_name, , database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Create or update an Azure Cosmos DB SQL userDefinedFunction

name.

SqlUserDefinedFunctionCreateUpdateParameters

The parameters to provide for

the current SQL userDefinedFunction. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • user_defined_function_name (String)

    Cosmos DB userDefinedFunction

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

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2882

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


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

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

  # Serialize Request
  request_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::Models::SqlUserDefinedFunctionCreateUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  create_update_sql_user_defined_function_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}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}'

  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' => ,'databaseName' => database_name,'containerName' => container_name,'userDefinedFunctionName' => user_defined_function_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

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

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

    result
  end

  promise.execute
end

#begin_create_update_sql_user_defined_function_with_http_info(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update an Azure Cosmos DB SQL userDefinedFunction

name.

SqlUserDefinedFunctionCreateUpdateParameters

The parameters to provide for

the current SQL userDefinedFunction. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • user_defined_function_name (String)

    Cosmos DB userDefinedFunction

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2861
2862
2863
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2861

def begin_create_update_sql_user_defined_function_with_http_info(resource_group_name, , database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil)
  begin_create_update_sql_user_defined_function_async(resource_group_name, , database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers).value!
end

#begin_delete_sql_container(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ Object

Deletes an existing Azure Cosmos DB SQL container.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that



2384
2385
2386
2387
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2384

def begin_delete_sql_container(resource_group_name, , database_name, container_name, custom_headers:nil)
  response = begin_delete_sql_container_async(resource_group_name, , database_name, container_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes an existing Azure Cosmos DB SQL container.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2417

def begin_delete_sql_container_async(resource_group_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 .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, '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}/sqlDatabases/{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' => ,'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

#begin_delete_sql_container_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes an existing Azure Cosmos DB SQL container.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2401
2402
2403
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2401

def begin_delete_sql_container_with_http_info(resource_group_name, , database_name, container_name, custom_headers:nil)
  begin_delete_sql_container_async(resource_group_name, , database_name, container_name, custom_headers:custom_headers).value!
end

#begin_delete_sql_database(resource_group_name, account_name, database_name, custom_headers: nil) ⇒ Object

Deletes an existing Azure Cosmos DB SQL database.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

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

    A hash of custom headers that



2047
2048
2049
2050
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2047

def begin_delete_sql_database(resource_group_name, , database_name, custom_headers:nil)
  response = begin_delete_sql_database_async(resource_group_name, , database_name, custom_headers:custom_headers).value!
  nil
end

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

Deletes an existing Azure Cosmos DB SQL database.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2078

def begin_delete_sql_database_async(resource_group_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 .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, '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}/sqlDatabases/{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' => ,'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

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

Deletes an existing Azure Cosmos DB SQL database.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2063
2064
2065
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2063

def begin_delete_sql_database_with_http_info(resource_group_name, , database_name, custom_headers:nil)
  begin_delete_sql_database_async(resource_group_name, , database_name, custom_headers:custom_headers).value!
end

#begin_delete_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers: nil) ⇒ Object

Deletes an existing Azure Cosmos DB SQL storedProcedure.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • stored_procedure_name (String)

    Cosmos DB storedProcedure name.

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

    A hash of custom headers that



2733
2734
2735
2736
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2733

def begin_delete_sql_stored_procedure(resource_group_name, , database_name, container_name, stored_procedure_name, custom_headers:nil)
  response = begin_delete_sql_stored_procedure_async(resource_group_name, , database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes an existing Azure Cosmos DB SQL storedProcedure.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • stored_procedure_name (String)

    Cosmos DB storedProcedure name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2768

def begin_delete_sql_stored_procedure_async(resource_group_name, , database_name, container_name, stored_procedure_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, 'stored_procedure_name is nil' if stored_procedure_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}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}'

  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' => ,'databaseName' => database_name,'containerName' => container_name,'storedProcedureName' => stored_procedure_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

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

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

    result
  end

  promise.execute
end

#begin_delete_sql_stored_procedure_with_http_info(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes an existing Azure Cosmos DB SQL storedProcedure.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • stored_procedure_name (String)

    Cosmos DB storedProcedure name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2751
2752
2753
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2751

def begin_delete_sql_stored_procedure_with_http_info(resource_group_name, , database_name, container_name, stored_procedure_name, custom_headers:nil)
  begin_delete_sql_stored_procedure_async(resource_group_name, , database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value!
end

#begin_delete_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers: nil) ⇒ Object

Deletes an existing Azure Cosmos DB SQL trigger.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • trigger_name (String)

    Cosmos DB trigger name.

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

    A hash of custom headers that



3199
3200
3201
3202
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 3199

def begin_delete_sql_trigger(resource_group_name, , database_name, container_name, trigger_name, custom_headers:nil)
  response = begin_delete_sql_trigger_async(resource_group_name, , database_name, container_name, trigger_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes an existing Azure Cosmos DB SQL trigger.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • trigger_name (String)

    Cosmos DB trigger name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 3234

def begin_delete_sql_trigger_async(resource_group_name, , database_name, container_name, trigger_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, 'trigger_name is nil' if trigger_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}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}'

  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' => ,'databaseName' => database_name,'containerName' => container_name,'triggerName' => trigger_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

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

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

    result
  end

  promise.execute
end

#begin_delete_sql_trigger_with_http_info(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes an existing Azure Cosmos DB SQL trigger.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • trigger_name (String)

    Cosmos DB trigger name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3217
3218
3219
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 3217

def begin_delete_sql_trigger_with_http_info(resource_group_name, , database_name, container_name, trigger_name, custom_headers:nil)
  begin_delete_sql_trigger_async(resource_group_name, , database_name, container_name, trigger_name, custom_headers:custom_headers).value!
end

#begin_delete_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers: nil) ⇒ Object

Deletes an existing Azure Cosmos DB SQL userDefinedFunction.

name. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • user_defined_function_name (String)

    Cosmos DB userDefinedFunction

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

    A hash of custom headers that



2967
2968
2969
2970
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2967

def begin_delete_sql_user_defined_function(resource_group_name, , database_name, container_name, user_defined_function_name, custom_headers:nil)
  response = begin_delete_sql_user_defined_function_async(resource_group_name, , database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes an existing Azure Cosmos DB SQL userDefinedFunction.

name. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • user_defined_function_name (String)

    Cosmos DB userDefinedFunction

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 3004

def begin_delete_sql_user_defined_function_async(resource_group_name, , database_name, container_name, user_defined_function_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, 'user_defined_function_name is nil' if user_defined_function_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}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}'

  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' => ,'databaseName' => database_name,'containerName' => container_name,'userDefinedFunctionName' => user_defined_function_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

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

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

    result
  end

  promise.execute
end

#begin_delete_sql_user_defined_function_with_http_info(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes an existing Azure Cosmos DB SQL userDefinedFunction.

name. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • user_defined_function_name (String)

    Cosmos DB userDefinedFunction

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2986
2987
2988
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2986

def begin_delete_sql_user_defined_function_with_http_info(resource_group_name, , database_name, container_name, user_defined_function_name, custom_headers:nil)
  begin_delete_sql_user_defined_function_async(resource_group_name, , database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value!
end

#begin_update_sql_container_throughput(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Update RUs per second of an Azure Cosmos DB SQL container

parameters to provide for the RUs per second of the current SQL container. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



2484
2485
2486
2487
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2484

def begin_update_sql_container_throughput(resource_group_name, , database_name, container_name, update_throughput_parameters, custom_headers:nil)
  response = begin_update_sql_container_throughput_async(resource_group_name, , database_name, container_name, update_throughput_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Update RUs per second of an Azure Cosmos DB SQL container

parameters to provide for the RUs per second of the current SQL container. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2521

def begin_update_sql_container_throughput_async(resource_group_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 .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, '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::V2019_12_12::Models::ThroughputSettingsUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  update_throughput_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => ,'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::V2019_12_12::Models::ThroughputSettingsGetResults.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_update_sql_container_throughput_with_http_info(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Update RUs per second of an Azure Cosmos DB SQL container

parameters to provide for the RUs per second of the current SQL container. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2503
2504
2505
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2503

def begin_update_sql_container_throughput_with_http_info(resource_group_name, , database_name, container_name, update_throughput_parameters, custom_headers:nil)
  begin_update_sql_container_throughput_async(resource_group_name, , database_name, container_name, update_throughput_parameters, custom_headers:custom_headers).value!
end

#begin_update_sql_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Update RUs per second of an Azure Cosmos DB SQL database

parameters to provide for the RUs per second of the current SQL database. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



2143
2144
2145
2146
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2143

def begin_update_sql_database_throughput(resource_group_name, , database_name, update_throughput_parameters, custom_headers:nil)
  response = begin_update_sql_database_throughput_async(resource_group_name, , database_name, update_throughput_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Update RUs per second of an Azure Cosmos DB SQL database

parameters to provide for the RUs per second of the current SQL database. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2178

def begin_update_sql_database_throughput_async(resource_group_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 .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, '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::V2019_12_12::Models::ThroughputSettingsUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  update_throughput_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => ,'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::V2019_12_12::Models::ThroughputSettingsGetResults.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_update_sql_database_throughput_with_http_info(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Update RUs per second of an Azure Cosmos DB SQL database

parameters to provide for the RUs per second of the current SQL database. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2161
2162
2163
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 2161

def begin_update_sql_database_throughput_with_http_info(resource_group_name, , database_name, update_throughput_parameters, custom_headers:nil)
  begin_update_sql_database_throughput_async(resource_group_name, , database_name, update_throughput_parameters, custom_headers:custom_headers).value!
end

#create_update_sql_container(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers: nil) ⇒ SqlContainerGetResults

Create or update an Azure Cosmos DB SQL container

SqlContainerCreateUpdateParameters

The parameters to provide for the

current SQL container. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (SqlContainerGetResults)

    operation results.



703
704
705
706
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 703

def create_update_sql_container(resource_group_name, , database_name, container_name, create_update_sql_container_parameters, custom_headers:nil)
  response = create_update_sql_container_async(resource_group_name, , database_name, container_name, create_update_sql_container_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_update_sql_container_async(resource_group_name, account_name, database_name, container_name, create_update_sql_container_parameters, custom_headers: nil) ⇒ Concurrent::Promise

SqlContainerCreateUpdateParameters

The parameters to provide for the

current SQL container. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 722

def create_update_sql_container_async(resource_group_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, , 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::V2019_12_12::Models::SqlContainerGetResults.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

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

  promise
end

#create_update_sql_database(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers: nil) ⇒ SqlDatabaseGetResults

Create or update an Azure Cosmos DB SQL database

SqlDatabaseCreateUpdateParameters

The parameters to provide for the current

SQL database. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

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

    A hash of custom headers that

Returns:

  • (SqlDatabaseGetResults)

    operation results.



245
246
247
248
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 245

def create_update_sql_database(resource_group_name, , database_name, create_update_sql_database_parameters, custom_headers:nil)
  response = create_update_sql_database_async(resource_group_name, , database_name, create_update_sql_database_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_update_sql_database_async(resource_group_name, account_name, database_name, create_update_sql_database_parameters, custom_headers: nil) ⇒ Concurrent::Promise

SqlDatabaseCreateUpdateParameters

The parameters to provide for the current

SQL database. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 263

def create_update_sql_database_async(resource_group_name, , database_name, create_update_sql_database_parameters, custom_headers:nil)
  # Send request
  promise = begin_create_update_sql_database_async(resource_group_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::V2019_12_12::Models::SqlDatabaseGetResults.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

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

  promise
end

#create_update_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers: nil) ⇒ SqlStoredProcedureGetResults

Create or update an Azure Cosmos DB SQL storedProcedure

SqlStoredProcedureCreateUpdateParameters

The parameters to provide for the

current SQL storedProcedure. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • stored_procedure_name (String)

    Cosmos DB storedProcedure name.

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

    A hash of custom headers that

Returns:

  • (SqlStoredProcedureGetResults)

    operation results.



1185
1186
1187
1188
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1185

def create_update_sql_stored_procedure(resource_group_name, , database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil)
  response = create_update_sql_stored_procedure_async(resource_group_name, , database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_update_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers: nil) ⇒ Concurrent::Promise

SqlStoredProcedureCreateUpdateParameters

The parameters to provide for the

current SQL storedProcedure. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • stored_procedure_name (String)

    Cosmos DB storedProcedure name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1205

def create_update_sql_stored_procedure_async(resource_group_name, , database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:nil)
  # Send request
  promise = begin_create_update_sql_stored_procedure_async(resource_group_name, , database_name, container_name, stored_procedure_name, create_update_sql_stored_procedure_parameters, custom_headers:custom_headers)

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

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

  promise
end

#create_update_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers: nil) ⇒ SqlTriggerGetResults

Create or update an Azure Cosmos DB SQL trigger

SqlTriggerCreateUpdateParameters

The parameters to provide for the current

SQL trigger. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • trigger_name (String)

    Cosmos DB trigger name.

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

    A hash of custom headers that

Returns:

  • (SqlTriggerGetResults)

    operation results.



1834
1835
1836
1837
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1834

def create_update_sql_trigger(resource_group_name, , database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil)
  response = create_update_sql_trigger_async(resource_group_name, , database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_update_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers: nil) ⇒ Concurrent::Promise

SqlTriggerCreateUpdateParameters

The parameters to provide for the current

SQL trigger. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • trigger_name (String)

    Cosmos DB trigger name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1854

def create_update_sql_trigger_async(resource_group_name, , database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:nil)
  # Send request
  promise = begin_create_update_sql_trigger_async(resource_group_name, , database_name, container_name, trigger_name, create_update_sql_trigger_parameters, custom_headers:custom_headers)

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

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

  promise
end

#create_update_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers: nil) ⇒ SqlUserDefinedFunctionGetResults

Create or update an Azure Cosmos DB SQL userDefinedFunction

name.

SqlUserDefinedFunctionCreateUpdateParameters

The parameters to provide for

the current SQL userDefinedFunction. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • user_defined_function_name (String)

    Cosmos DB userDefinedFunction

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

    A hash of custom headers that

Returns:

  • (SqlUserDefinedFunctionGetResults)

    operation results.



1513
1514
1515
1516
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1513

def create_update_sql_user_defined_function(resource_group_name, , database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil)
  response = create_update_sql_user_defined_function_async(resource_group_name, , database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_update_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers: nil) ⇒ Concurrent::Promise

name.

SqlUserDefinedFunctionCreateUpdateParameters

The parameters to provide for

the current SQL userDefinedFunction. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • user_defined_function_name (String)

    Cosmos DB userDefinedFunction

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1534

def create_update_sql_user_defined_function_async(resource_group_name, , database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:nil)
  # Send request
  promise = begin_create_update_sql_user_defined_function_async(resource_group_name, , database_name, container_name, user_defined_function_name, create_update_sql_user_defined_function_parameters, custom_headers:custom_headers)

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

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

  promise
end

#delete_sql_container(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ Object

Deletes an existing Azure Cosmos DB SQL container.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that



750
751
752
753
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 750

def delete_sql_container(resource_group_name, , database_name, container_name, custom_headers:nil)
  response = delete_sql_container_async(resource_group_name, , database_name, container_name, custom_headers:custom_headers).value!
  nil
end

#delete_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 766

def delete_sql_container_async(resource_group_name, , database_name, container_name, custom_headers:nil)
  # Send request
  promise = begin_delete_sql_container_async(resource_group_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

#delete_sql_database(resource_group_name, account_name, database_name, custom_headers: nil) ⇒ Object

Deletes an existing Azure Cosmos DB SQL database.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

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

    A hash of custom headers that



290
291
292
293
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 290

def delete_sql_database(resource_group_name, , database_name, custom_headers:nil)
  response = delete_sql_database_async(resource_group_name, , database_name, custom_headers:custom_headers).value!
  nil
end

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

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 305

def delete_sql_database_async(resource_group_name, , database_name, custom_headers:nil)
  # Send request
  promise = begin_delete_sql_database_async(resource_group_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

#delete_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers: nil) ⇒ Object

Deletes an existing Azure Cosmos DB SQL storedProcedure.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • stored_procedure_name (String)

    Cosmos DB storedProcedure name.

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

    A hash of custom headers that



1234
1235
1236
1237
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1234

def delete_sql_stored_procedure(resource_group_name, , database_name, container_name, stored_procedure_name, custom_headers:nil)
  response = delete_sql_stored_procedure_async(resource_group_name, , database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value!
  nil
end

#delete_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • stored_procedure_name (String)

    Cosmos DB storedProcedure name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1251

def delete_sql_stored_procedure_async(resource_group_name, , database_name, container_name, stored_procedure_name, custom_headers:nil)
  # Send request
  promise = begin_delete_sql_stored_procedure_async(resource_group_name, , database_name, container_name, stored_procedure_name, custom_headers:custom_headers)

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

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

  promise
end

#delete_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers: nil) ⇒ Object

Deletes an existing Azure Cosmos DB SQL trigger.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • trigger_name (String)

    Cosmos DB trigger name.

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

    A hash of custom headers that



1883
1884
1885
1886
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1883

def delete_sql_trigger(resource_group_name, , database_name, container_name, trigger_name, custom_headers:nil)
  response = delete_sql_trigger_async(resource_group_name, , database_name, container_name, trigger_name, custom_headers:custom_headers).value!
  nil
end

#delete_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • trigger_name (String)

    Cosmos DB trigger name.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1900

def delete_sql_trigger_async(resource_group_name, , database_name, container_name, trigger_name, custom_headers:nil)
  # Send request
  promise = begin_delete_sql_trigger_async(resource_group_name, , database_name, container_name, trigger_name, custom_headers:custom_headers)

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

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

  promise
end

#delete_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers: nil) ⇒ Object

Deletes an existing Azure Cosmos DB SQL userDefinedFunction.

name. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • user_defined_function_name (String)

    Cosmos DB userDefinedFunction

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

    A hash of custom headers that



1564
1565
1566
1567
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1564

def delete_sql_user_defined_function(resource_group_name, , database_name, container_name, user_defined_function_name, custom_headers:nil)
  response = delete_sql_user_defined_function_async(resource_group_name, , database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value!
  nil
end

#delete_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers: nil) ⇒ Concurrent::Promise

name. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • user_defined_function_name (String)

    Cosmos DB userDefinedFunction

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1582

def delete_sql_user_defined_function_async(resource_group_name, , database_name, container_name, user_defined_function_name, custom_headers:nil)
  # Send request
  promise = begin_delete_sql_user_defined_function_async(resource_group_name, , database_name, container_name, user_defined_function_name, custom_headers:custom_headers)

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

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

  promise
end

#get_sql_container(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ SqlContainerGetResults

Gets the SQL container under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (SqlContainerGetResults)

    operation results.



592
593
594
595
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 592

def get_sql_container(resource_group_name, , database_name, container_name, custom_headers:nil)
  response = get_sql_container_async(resource_group_name, , database_name, container_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_sql_container_async(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the SQL container under an existing Azure Cosmos DB database account.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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

def get_sql_container_async(resource_group_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 .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, '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}/sqlDatabases/{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' => ,'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::V2019_12_12::Models::SqlContainerGetResults.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_sql_container_throughput(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



795
796
797
798
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 795

def get_sql_container_throughput(resource_group_name, , database_name, container_name, custom_headers:nil)
  response = get_sql_container_throughput_async(resource_group_name, , database_name, container_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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

def get_sql_container_throughput_async(resource_group_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 .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, '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}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => ,'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::V2019_12_12::Models::ThroughputSettingsGetResults.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_sql_container_throughput_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



813
814
815
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 813

def get_sql_container_throughput_with_http_info(resource_group_name, , database_name, container_name, custom_headers:nil)
  get_sql_container_throughput_async(resource_group_name, , database_name, container_name, custom_headers:custom_headers).value!
end

#get_sql_container_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the SQL container under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



609
610
611
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 609

def get_sql_container_with_http_info(resource_group_name, , database_name, container_name, custom_headers:nil)
  get_sql_container_async(resource_group_name, , database_name, container_name, custom_headers:custom_headers).value!
end

#get_sql_database(resource_group_name, account_name, database_name, custom_headers: nil) ⇒ SqlDatabaseGetResults

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

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

    A hash of custom headers that

Returns:

  • (SqlDatabaseGetResults)

    operation results.



136
137
138
139
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 136

def get_sql_database(resource_group_name, , database_name, custom_headers:nil)
  response = get_sql_database_async(resource_group_name, , database_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

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

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 169

def get_sql_database_async(resource_group_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 .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, '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}/sqlDatabases/{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' => ,'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::V2019_12_12::Models::SqlDatabaseGetResults.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_sql_database_throughput(resource_group_name, account_name, database_name, custom_headers: nil) ⇒ ThroughputSettingsGetResults

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



333
334
335
336
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 333

def get_sql_database_throughput(resource_group_name, , database_name, custom_headers:nil)
  response = get_sql_database_throughput_async(resource_group_name, , database_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

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

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 366

def get_sql_database_throughput_async(resource_group_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 .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, '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}/sqlDatabases/{databaseName}/throughputSettings/default'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => ,'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::V2019_12_12::Models::ThroughputSettingsGetResults.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

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

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



350
351
352
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 350

def get_sql_database_throughput_with_http_info(resource_group_name, , database_name, custom_headers:nil)
  get_sql_database_throughput_async(resource_group_name, , database_name, custom_headers:custom_headers).value!
end

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

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



153
154
155
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 153

def get_sql_database_with_http_info(resource_group_name, , database_name, custom_headers:nil)
  get_sql_database_async(resource_group_name, , database_name, custom_headers:custom_headers).value!
end

#get_sql_stored_procedure(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers: nil) ⇒ SqlStoredProcedureGetResults

Gets the SQL storedProcedure under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • stored_procedure_name (String)

    Cosmos DB storedProcedure name.

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

    A hash of custom headers that

Returns:

  • (SqlStoredProcedureGetResults)

    operation results.



1068
1069
1070
1071
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1068

def get_sql_stored_procedure(resource_group_name, , database_name, container_name, stored_procedure_name, custom_headers:nil)
  response = get_sql_stored_procedure_async(resource_group_name, , database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_sql_stored_procedure_async(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the SQL storedProcedure under an existing Azure Cosmos DB database account.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • stored_procedure_name (String)

    Cosmos DB storedProcedure name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1105

def get_sql_stored_procedure_async(resource_group_name, , database_name, container_name, stored_procedure_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, 'stored_procedure_name is nil' if stored_procedure_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}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}'

  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' => ,'databaseName' => database_name,'containerName' => container_name,'storedProcedureName' => stored_procedure_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

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

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

    result
  end

  promise.execute
end

#get_sql_stored_procedure_with_http_info(resource_group_name, account_name, database_name, container_name, stored_procedure_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the SQL storedProcedure under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • stored_procedure_name (String)

    Cosmos DB storedProcedure name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1087
1088
1089
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1087

def get_sql_stored_procedure_with_http_info(resource_group_name, , database_name, container_name, stored_procedure_name, custom_headers:nil)
  get_sql_stored_procedure_async(resource_group_name, , database_name, container_name, stored_procedure_name, custom_headers:custom_headers).value!
end

#get_sql_trigger(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers: nil) ⇒ SqlTriggerGetResults

Gets the SQL trigger under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • trigger_name (String)

    Cosmos DB trigger name.

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

    A hash of custom headers that

Returns:

  • (SqlTriggerGetResults)

    operation results.



1719
1720
1721
1722
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1719

def get_sql_trigger(resource_group_name, , database_name, container_name, trigger_name, custom_headers:nil)
  response = get_sql_trigger_async(resource_group_name, , database_name, container_name, trigger_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_sql_trigger_async(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the SQL trigger under an existing Azure Cosmos DB database account.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • trigger_name (String)

    Cosmos DB trigger name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1754

def get_sql_trigger_async(resource_group_name, , database_name, container_name, trigger_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, 'trigger_name is nil' if trigger_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}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}'

  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' => ,'databaseName' => database_name,'containerName' => container_name,'triggerName' => trigger_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

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

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

    result
  end

  promise.execute
end

#get_sql_trigger_with_http_info(resource_group_name, account_name, database_name, container_name, trigger_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the SQL trigger under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • trigger_name (String)

    Cosmos DB trigger name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1737
1738
1739
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1737

def get_sql_trigger_with_http_info(resource_group_name, , database_name, container_name, trigger_name, custom_headers:nil)
  get_sql_trigger_async(resource_group_name, , database_name, container_name, trigger_name, custom_headers:custom_headers).value!
end

#get_sql_user_defined_function(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers: nil) ⇒ SqlUserDefinedFunctionGetResults

Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account.

name. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • user_defined_function_name (String)

    Cosmos DB userDefinedFunction

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

    A hash of custom headers that

Returns:

  • (SqlUserDefinedFunctionGetResults)

    operation results.



1393
1394
1395
1396
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1393

def get_sql_user_defined_function(resource_group_name, , database_name, container_name, user_defined_function_name, custom_headers:nil)
  response = get_sql_user_defined_function_async(resource_group_name, , database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_sql_user_defined_function_async(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account.

name. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • user_defined_function_name (String)

    Cosmos DB userDefinedFunction

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1432

def get_sql_user_defined_function_async(resource_group_name, , database_name, container_name, user_defined_function_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, 'container_name is nil' if container_name.nil?
  fail ArgumentError, 'user_defined_function_name is nil' if user_defined_function_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}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}'

  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' => ,'databaseName' => database_name,'containerName' => container_name,'userDefinedFunctionName' => user_defined_function_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

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

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

    result
  end

  promise.execute
end

#get_sql_user_defined_function_with_http_info(resource_group_name, account_name, database_name, container_name, user_defined_function_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account.

name. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • user_defined_function_name (String)

    Cosmos DB userDefinedFunction

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1413
1414
1415
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1413

def get_sql_user_defined_function_with_http_info(resource_group_name, , database_name, container_name, user_defined_function_name, custom_headers:nil)
  get_sql_user_defined_function_async(resource_group_name, , database_name, container_name, user_defined_function_name, custom_headers:custom_headers).value!
end

#list_sql_containers(resource_group_name, account_name, database_name, custom_headers: nil) ⇒ SqlContainerListResult

Lists the SQL container under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

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

    A hash of custom headers that

Returns:

  • (SqlContainerListResult)

    operation results.



487
488
489
490
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 487

def list_sql_containers(resource_group_name, , database_name, custom_headers:nil)
  response = list_sql_containers_async(resource_group_name, , database_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Lists the SQL container under an existing Azure Cosmos DB database account.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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

def list_sql_containers_async(resource_group_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 .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, '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}/sqlDatabases/{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' => ,'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::V2019_12_12::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

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

Lists the SQL container under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



503
504
505
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 503

def list_sql_containers_with_http_info(resource_group_name, , database_name, custom_headers:nil)
  list_sql_containers_async(resource_group_name, , database_name, custom_headers:custom_headers).value!
end

#list_sql_databases(resource_group_name, account_name, custom_headers: nil) ⇒ SqlDatabaseListResult

Lists the SQL databases under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

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

    A hash of custom headers that

Returns:

  • (SqlDatabaseListResult)

    operation results.



34
35
36
37
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 34

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

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

Lists the SQL databases under an existing Azure Cosmos DB database account.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 63

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Cosmosdb::Mgmt::V2019_12_12::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

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

Lists the SQL databases under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



49
50
51
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 49

def list_sql_databases_with_http_info(resource_group_name, , custom_headers:nil)
  list_sql_databases_async(resource_group_name, , custom_headers:custom_headers).value!
end

#list_sql_stored_procedures(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ SqlStoredProcedureListResult

Lists the SQL storedProcedure under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (SqlStoredProcedureListResult)

    operation results.



956
957
958
959
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 956

def list_sql_stored_procedures(resource_group_name, , database_name, container_name, custom_headers:nil)
  response = list_sql_stored_procedures_async(resource_group_name, , database_name, container_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_sql_stored_procedures_async(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ Concurrent::Promise

Lists the SQL storedProcedure under an existing Azure Cosmos DB database account.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 991

def list_sql_stored_procedures_async(resource_group_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 .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, '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}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures'

  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' => ,'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::V2019_12_12::Models::SqlStoredProcedureListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_sql_stored_procedures_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the SQL storedProcedure under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



974
975
976
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 974

def list_sql_stored_procedures_with_http_info(resource_group_name, , database_name, container_name, custom_headers:nil)
  list_sql_stored_procedures_async(resource_group_name, , database_name, container_name, custom_headers:custom_headers).value!
end

#list_sql_triggers(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ SqlTriggerListResult

Lists the SQL trigger under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (SqlTriggerListResult)

    operation results.



1610
1611
1612
1613
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1610

def list_sql_triggers(resource_group_name, , database_name, container_name, custom_headers:nil)
  response = list_sql_triggers_async(resource_group_name, , database_name, container_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_sql_triggers_async(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ Concurrent::Promise

Lists the SQL trigger under an existing Azure Cosmos DB database account.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1643

def list_sql_triggers_async(resource_group_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 .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, '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}/sqlDatabases/{databaseName}/containers/{containerName}/triggers'

  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' => ,'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::V2019_12_12::Models::SqlTriggerListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_sql_triggers_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the SQL trigger under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1627
1628
1629
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1627

def list_sql_triggers_with_http_info(resource_group_name, , database_name, container_name, custom_headers:nil)
  list_sql_triggers_async(resource_group_name, , database_name, container_name, custom_headers:custom_headers).value!
end

#list_sql_user_defined_functions(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ SqlUserDefinedFunctionListResult

Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (SqlUserDefinedFunctionListResult)

    operation results.



1280
1281
1282
1283
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1280

def list_sql_user_defined_functions(resource_group_name, , database_name, container_name, custom_headers:nil)
  response = list_sql_user_defined_functions_async(resource_group_name, , database_name, container_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_sql_user_defined_functions_async(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ Concurrent::Promise

Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1315

def list_sql_user_defined_functions_async(resource_group_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 .nil?
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !.nil? && .length > 50
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !.nil? && .length < 3
  fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !.nil? && .match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
  fail ArgumentError, '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}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions'

  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' => ,'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::V2019_12_12::Models::SqlUserDefinedFunctionListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_sql_user_defined_functions_with_http_info(resource_group_name, account_name, database_name, container_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1298
1299
1300
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 1298

def list_sql_user_defined_functions_with_http_info(resource_group_name, , database_name, container_name, custom_headers:nil)
  list_sql_user_defined_functions_async(resource_group_name, , database_name, container_name, custom_headers:custom_headers).value!
end

#update_sql_container_throughput(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Update RUs per second of an Azure Cosmos DB SQL container

parameters to provide for the RUs per second of the current SQL container. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



907
908
909
910
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 907

def update_sql_container_throughput(resource_group_name, , database_name, container_name, update_throughput_parameters, custom_headers:nil)
  response = update_sql_container_throughput_async(resource_group_name, , database_name, container_name, update_throughput_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_sql_container_throughput_async(resource_group_name, account_name, database_name, container_name, update_throughput_parameters, custom_headers: nil) ⇒ Concurrent::Promise

parameters to provide for the RUs per second of the current SQL container. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • container_name (String)

    Cosmos DB container name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 925

def update_sql_container_throughput_async(resource_group_name, , database_name, container_name, update_throughput_parameters, custom_headers:nil)
  # Send request
  promise = begin_update_sql_container_throughput_async(resource_group_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::V2019_12_12::Models::ThroughputSettingsGetResults.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

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

  promise
end

#update_sql_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers: nil) ⇒ ThroughputSettingsGetResults

Update RUs per second of an Azure Cosmos DB SQL database

parameters to provide for the RUs per second of the current SQL database. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (ThroughputSettingsGetResults)

    operation results.



441
442
443
444
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 441

def update_sql_database_throughput(resource_group_name, , database_name, update_throughput_parameters, custom_headers:nil)
  response = update_sql_database_throughput_async(resource_group_name, , database_name, update_throughput_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_sql_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers: nil) ⇒ Concurrent::Promise

parameters to provide for the RUs per second of the current SQL database. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • account_name (String)

    Cosmos DB database account name.

  • database_name (String)

    Cosmos DB database name.

  • update_throughput_parameters (ThroughputSettingsUpdateParameters)

    The

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/2019-12-12/generated/azure_mgmt_cosmosdb/sql_resources.rb', line 458

def update_sql_database_throughput_async(resource_group_name, , database_name, update_throughput_parameters, custom_headers:nil)
  # Send request
  promise = begin_update_sql_database_throughput_async(resource_group_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::V2019_12_12::Models::ThroughputSettingsGetResults.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

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

  promise
end