Class: Azure::Cosmosdb::Mgmt::V2021_01_15::NotebookWorkspaces
- Inherits:
-
Object
- Object
- Azure::Cosmosdb::Mgmt::V2021_01_15::NotebookWorkspaces
- Includes:
- MsRestAzure
- Defined in:
- lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb
Overview
Azure Cosmos DB Database Service Resource Provider REST API
Instance Attribute Summary collapse
-
#client ⇒ CosmosDBManagementClient
readonly
Reference to the CosmosDBManagementClient.
Instance Method Summary collapse
-
#begin_create_or_update(resource_group_name, account_name, custom_headers: nil) ⇒ NotebookWorkspace
Creates the notebook workspace for a Cosmos DB account.
-
#begin_create_or_update_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
Creates the notebook workspace for a Cosmos DB account.
-
#begin_create_or_update_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Creates the notebook workspace for a Cosmos DB account.
-
#begin_delete(resource_group_name, account_name, custom_headers: nil) ⇒ Object
Deletes the notebook workspace for a Cosmos DB account.
-
#begin_delete_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
Deletes the notebook workspace for a Cosmos DB account.
-
#begin_delete_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes the notebook workspace for a Cosmos DB account.
-
#begin_regenerate_auth_token(resource_group_name, account_name, custom_headers: nil) ⇒ Object
Regenerates the auth token for the notebook workspace.
-
#begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
Regenerates the auth token for the notebook workspace.
-
#begin_regenerate_auth_token_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Regenerates the auth token for the notebook workspace.
-
#begin_start(resource_group_name, account_name, custom_headers: nil) ⇒ Object
Starts the notebook workspace.
-
#begin_start_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
Starts the notebook workspace.
-
#begin_start_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Starts the notebook workspace.
-
#create_or_update(resource_group_name, account_name, custom_headers: nil) ⇒ NotebookWorkspace
Creates the notebook workspace for a Cosmos DB account.
-
#create_or_update_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
is case insensitive.
-
#delete(resource_group_name, account_name, custom_headers: nil) ⇒ Object
Deletes the notebook workspace for a Cosmos DB account.
-
#delete_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
is case insensitive.
-
#get(resource_group_name, account_name, custom_headers: nil) ⇒ NotebookWorkspace
Gets the notebook workspace for a Cosmos DB account.
-
#get_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets the notebook workspace for a Cosmos DB account.
-
#get_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the notebook workspace for a Cosmos DB account.
-
#initialize(client) ⇒ NotebookWorkspaces
constructor
Creates and initializes a new instance of the NotebookWorkspaces class.
-
#list_by_database_account(resource_group_name, account_name, custom_headers: nil) ⇒ NotebookWorkspaceListResult
Gets the notebook workspace resources of an existing Cosmos DB account.
-
#list_by_database_account_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets the notebook workspace resources of an existing Cosmos DB account.
-
#list_by_database_account_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the notebook workspace resources of an existing Cosmos DB account.
-
#list_connection_info(resource_group_name, account_name, custom_headers: nil) ⇒ NotebookWorkspaceConnectionInfoResult
Retrieves the connection info for the notebook workspace.
-
#list_connection_info_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
Retrieves the connection info for the notebook workspace.
-
#list_connection_info_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Retrieves the connection info for the notebook workspace.
-
#regenerate_auth_token(resource_group_name, account_name, custom_headers: nil) ⇒ Object
Regenerates the auth token for the notebook workspace.
-
#regenerate_auth_token_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
is case insensitive.
-
#start(resource_group_name, account_name, custom_headers: nil) ⇒ Object
Starts the notebook workspace.
-
#start_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
is case insensitive.
Constructor Details
#initialize(client) ⇒ NotebookWorkspaces
Creates and initializes a new instance of the NotebookWorkspaces class.
17 18 19 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 17 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ CosmosDBManagementClient (readonly)
Returns reference to the CosmosDBManagementClient.
22 23 24 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 22 def client @client end |
Instance Method Details
#begin_create_or_update(resource_group_name, account_name, custom_headers: nil) ⇒ NotebookWorkspace
Creates the notebook workspace for a Cosmos DB account.
is case insensitive. will be added to the HTTP request.
516 517 518 519 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 516 def begin_create_or_update(resource_group_name, account_name, custom_headers:nil) response = begin_create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#begin_create_or_update_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
Creates the notebook workspace for a Cosmos DB account.
is case insensitive. to the HTTP request.
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 547 def begin_create_or_update_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? notebook_workspace_name = 'default' notebook_create_update_parameters = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::NotebookWorkspaceCreateUpdateParameters.new 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::V2021_01_15::Models::NotebookWorkspaceCreateUpdateParameters.mapper() request_content = @client.serialize(request_mapper, notebook_create_update_parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_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, ) 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 MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::NotebookWorkspace.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#begin_create_or_update_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Creates the notebook workspace for a Cosmos DB account.
is case insensitive. will be added to the HTTP request.
532 533 534 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 532 def begin_create_or_update_with_http_info(resource_group_name, account_name, custom_headers:nil) begin_create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers).value! end |
#begin_delete(resource_group_name, account_name, custom_headers: nil) ⇒ Object
Deletes the notebook workspace for a Cosmos DB account.
is case insensitive. will be added to the HTTP request.
629 630 631 632 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 629 def begin_delete(resource_group_name, account_name, custom_headers:nil) response = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! nil end |
#begin_delete_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
Deletes the notebook workspace for a Cosmos DB account.
is case insensitive. to the HTTP request.
660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 660 def begin_delete_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? notebook_workspace_name = 'default' 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}/notebookWorkspaces/{notebookWorkspaceName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_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, ) 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 MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end |
#begin_delete_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes the notebook workspace for a Cosmos DB account.
is case insensitive. will be added to the HTTP request.
645 646 647 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 645 def begin_delete_with_http_info(resource_group_name, account_name, custom_headers:nil) begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! end |
#begin_regenerate_auth_token(resource_group_name, account_name, custom_headers: nil) ⇒ Object
Regenerates the auth token for the notebook workspace
is case insensitive. will be added to the HTTP request.
724 725 726 727 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 724 def begin_regenerate_auth_token(resource_group_name, account_name, custom_headers:nil) response = begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers).value! nil end |
#begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
Regenerates the auth token for the notebook workspace
is case insensitive. to the HTTP request.
755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 755 def begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? notebook_workspace_name = 'default' 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}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end |
#begin_regenerate_auth_token_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Regenerates the auth token for the notebook workspace
is case insensitive. will be added to the HTTP request.
740 741 742 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 740 def begin_regenerate_auth_token_with_http_info(resource_group_name, account_name, custom_headers:nil) begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers).value! end |
#begin_start(resource_group_name, account_name, custom_headers: nil) ⇒ Object
Starts the notebook workspace
is case insensitive. will be added to the HTTP request.
819 820 821 822 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 819 def begin_start(resource_group_name, account_name, custom_headers:nil) response = begin_start_async(resource_group_name, account_name, custom_headers:custom_headers).value! nil end |
#begin_start_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
Starts the notebook workspace
is case insensitive. to the HTTP request.
850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 850 def begin_start_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? notebook_workspace_name = 'default' 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}/notebookWorkspaces/{notebookWorkspaceName}/start' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end |
#begin_start_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Starts the notebook workspace
is case insensitive. will be added to the HTTP request.
835 836 837 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 835 def begin_start_with_http_info(resource_group_name, account_name, custom_headers:nil) begin_start_async(resource_group_name, account_name, custom_headers:custom_headers).value! end |
#create_or_update(resource_group_name, account_name, custom_headers: nil) ⇒ NotebookWorkspace
Creates the notebook workspace for a Cosmos DB account.
is case insensitive. will be added to the HTTP request.
246 247 248 249 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 246 def create_or_update(resource_group_name, account_name, custom_headers:nil) response = create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#create_or_update_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
is case insensitive. will be added to the HTTP request.
response.
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 261 def create_or_update_async(resource_group_name, account_name, custom_headers:nil) # Send request promise = begin_create_or_update_async(resource_group_name, account_name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::NotebookWorkspace.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(resource_group_name, account_name, custom_headers: nil) ⇒ Object
Deletes the notebook workspace for a Cosmos DB account.
is case insensitive. will be added to the HTTP request.
288 289 290 291 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 288 def delete(resource_group_name, account_name, custom_headers:nil) response = delete_async(resource_group_name, account_name, custom_headers:custom_headers).value! nil end |
#delete_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
is case insensitive. will be added to the HTTP request.
response.
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 303 def delete_async(resource_group_name, account_name, custom_headers:nil) # Send request promise = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#get(resource_group_name, account_name, custom_headers: nil) ⇒ NotebookWorkspace
Gets the notebook workspace for a Cosmos DB account.
is case insensitive. will be added to the HTTP request.
140 141 142 143 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 140 def get(resource_group_name, account_name, custom_headers:nil) response = get_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets the notebook workspace for a Cosmos DB account.
is case insensitive. to the HTTP request.
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 230 231 232 233 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 171 def get_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? notebook_workspace_name = 'default' 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}/notebookWorkspaces/{notebookWorkspaceName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_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, ) 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 MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::NotebookWorkspace.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the notebook workspace for a Cosmos DB account.
is case insensitive. will be added to the HTTP request.
156 157 158 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 156 def get_with_http_info(resource_group_name, account_name, custom_headers:nil) get_async(resource_group_name, account_name, custom_headers:custom_headers).value! end |
#list_by_database_account(resource_group_name, account_name, custom_headers: nil) ⇒ NotebookWorkspaceListResult
Gets the notebook workspace resources of an existing Cosmos DB account.
is case insensitive. will be added to the HTTP request.
35 36 37 38 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 35 def list_by_database_account(resource_group_name, account_name, custom_headers:nil) response = list_by_database_account_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_by_database_account_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets the notebook workspace resources of an existing Cosmos DB account.
is case insensitive. to the HTTP request.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 66 def list_by_database_account_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? 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}/notebookWorkspaces' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) 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 MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::NotebookWorkspaceListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_database_account_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the notebook workspace resources of an existing Cosmos DB account.
is case insensitive. will be added to the HTTP request.
51 52 53 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 51 def list_by_database_account_with_http_info(resource_group_name, account_name, custom_headers:nil) list_by_database_account_async(resource_group_name, account_name, custom_headers:custom_headers).value! end |
#list_connection_info(resource_group_name, account_name, custom_headers: nil) ⇒ NotebookWorkspaceConnectionInfoResult
Retrieves the connection info for the notebook workspace
is case insensitive. will be added to the HTTP request.
330 331 332 333 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 330 def list_connection_info(resource_group_name, account_name, custom_headers:nil) response = list_connection_info_async(resource_group_name, account_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_connection_info_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
Retrieves the connection info for the notebook workspace
is case insensitive. to the HTTP request.
361 362 363 364 365 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 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 361 def list_connection_info_async(resource_group_name, account_name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1 fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil? notebook_workspace_name = 'default' 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}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'notebookWorkspaceName' => notebook_workspace_name}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, ) 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 MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::NotebookWorkspaceConnectionInfoResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_connection_info_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Retrieves the connection info for the notebook workspace
is case insensitive. will be added to the HTTP request.
346 347 348 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 346 def list_connection_info_with_http_info(resource_group_name, account_name, custom_headers:nil) list_connection_info_async(resource_group_name, account_name, custom_headers:custom_headers).value! end |
#regenerate_auth_token(resource_group_name, account_name, custom_headers: nil) ⇒ Object
Regenerates the auth token for the notebook workspace
is case insensitive. will be added to the HTTP request.
434 435 436 437 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 434 def regenerate_auth_token(resource_group_name, account_name, custom_headers:nil) response = regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers).value! nil end |
#regenerate_auth_token_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
is case insensitive. will be added to the HTTP request.
response.
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 449 def regenerate_auth_token_async(resource_group_name, account_name, custom_headers:nil) # Send request promise = begin_regenerate_auth_token_async(resource_group_name, account_name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#start(resource_group_name, account_name, custom_headers: nil) ⇒ Object
Starts the notebook workspace
is case insensitive. will be added to the HTTP request.
474 475 476 477 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 474 def start(resource_group_name, account_name, custom_headers:nil) response = start_async(resource_group_name, account_name, custom_headers:custom_headers).value! nil end |
#start_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise
is case insensitive. will be added to the HTTP request.
response.
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 |
# File 'lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb', line 489 def start_async(resource_group_name, account_name, custom_headers:nil) # Send request promise = begin_start_async(resource_group_name, account_name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |