Class: Azure::OperationalInsights::Mgmt::V2020_08_01::Workspaces
- Inherits:
-
Object
- Object
- Azure::OperationalInsights::Mgmt::V2020_08_01::Workspaces
- Includes:
- MsRestAzure
- Defined in:
- lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb
Overview
Operational Insights Client
Instance Attribute Summary collapse
-
#client ⇒ OperationalInsightsManagementClient
readonly
Reference to the OperationalInsightsManagementClient.
Instance Method Summary collapse
-
#begin_create_or_update(resource_group_name, workspace_name, parameters, custom_headers: nil) ⇒ Workspace
Create or update a workspace.
-
#begin_create_or_update_async(resource_group_name, workspace_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Create or update a workspace.
-
#begin_create_or_update_with_http_info(resource_group_name, workspace_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Create or update a workspace.
-
#begin_delete(resource_group_name, workspace_name, force: nil, custom_headers: nil) ⇒ Object
Deletes a workspace resource.
-
#begin_delete_async(resource_group_name, workspace_name, force: nil, custom_headers: nil) ⇒ Concurrent::Promise
Deletes a workspace resource.
-
#begin_delete_with_http_info(resource_group_name, workspace_name, force: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes a workspace resource.
-
#create_or_update(resource_group_name, workspace_name, parameters, custom_headers: nil) ⇒ Workspace
Create or update a workspace.
-
#create_or_update_async(resource_group_name, workspace_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
is case insensitive.
-
#delete(resource_group_name, workspace_name, force: nil, custom_headers: nil) ⇒ Object
Deletes a workspace resource.
-
#delete_async(resource_group_name, workspace_name, force: nil, custom_headers: nil) ⇒ Concurrent::Promise
is case insensitive.
-
#get(resource_group_name, workspace_name, custom_headers: nil) ⇒ Workspace
Gets a workspace instance.
-
#get_async(resource_group_name, workspace_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets a workspace instance.
-
#get_with_http_info(resource_group_name, workspace_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a workspace instance.
-
#initialize(client) ⇒ Workspaces
constructor
Creates and initializes a new instance of the Workspaces class.
-
#list(custom_headers: nil) ⇒ WorkspaceListResult
Gets the workspaces in a subscription.
-
#list_async(custom_headers: nil) ⇒ Concurrent::Promise
Gets the workspaces in a subscription.
-
#list_by_resource_group(resource_group_name, custom_headers: nil) ⇒ WorkspaceListResult
Gets workspaces in a resource group.
-
#list_by_resource_group_async(resource_group_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets workspaces in a resource group.
-
#list_by_resource_group_with_http_info(resource_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets workspaces in a resource group.
-
#list_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the workspaces in a subscription.
-
#update(resource_group_name, workspace_name, parameters, custom_headers: nil) ⇒ Workspace
Updates a workspace.
-
#update_async(resource_group_name, workspace_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Updates a workspace.
-
#update_with_http_info(resource_group_name, workspace_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Updates a workspace.
Constructor Details
#initialize(client) ⇒ Workspaces
Creates and initializes a new instance of the Workspaces class.
17 18 19 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 17 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ OperationalInsightsManagementClient (readonly)
Returns reference to the OperationalInsightsManagementClient.
22 23 24 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 22 def client @client end |
Instance Method Details
#begin_create_or_update(resource_group_name, workspace_name, parameters, custom_headers: nil) ⇒ Workspace
Create or update a workspace.
is case insensitive. workspace. will be added to the HTTP request.
542 543 544 545 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 542 def begin_create_or_update(resource_group_name, workspace_name, parameters, custom_headers:nil) response = begin_create_or_update_async(resource_group_name, workspace_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end |
#begin_create_or_update_async(resource_group_name, workspace_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Create or update a workspace.
is case insensitive. workspace. to the HTTP request.
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 618 619 620 621 622 623 624 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 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 577 def begin_create_or_update_async(resource_group_name, workspace_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'workspace_name is nil' if workspace_name.nil? fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '63'" if !workspace_name.nil? && workspace_name.length > 63 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '4'" if !workspace_name.nil? && workspace_name.length < 4 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'" if !workspace_name.nil? && workspace_name.match(Regexp.new('^^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.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, '@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 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::OperationalInsights::Mgmt::V2020_08_01::Models::Workspace.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'subscriptionId' => @client.subscription_id}, 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 || status_code == 201 || status_code == 202 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::OperationalInsights::Mgmt::V2020_08_01::Models::Workspace.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 # Deserialize Response if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::OperationalInsights::Mgmt::V2020_08_01::Models::Workspace.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, workspace_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Create or update a workspace.
is case insensitive. workspace. will be added to the HTTP request.
560 561 562 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 560 def begin_create_or_update_with_http_info(resource_group_name, workspace_name, parameters, custom_headers:nil) begin_create_or_update_async(resource_group_name, workspace_name, parameters, custom_headers:custom_headers).value! end |
#begin_delete(resource_group_name, workspace_name, force: nil, custom_headers: nil) ⇒ Object
Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag.
is case insensitive. workspace that was deleted with this flag cannot be recovered. will be added to the HTTP request.
673 674 675 676 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 673 def begin_delete(resource_group_name, workspace_name, force:nil, custom_headers:nil) response = begin_delete_async(resource_group_name, workspace_name, force:force, custom_headers:custom_headers).value! nil end |
#begin_delete_async(resource_group_name, workspace_name, force: nil, custom_headers: nil) ⇒ Concurrent::Promise
Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag.
is case insensitive. workspace that was deleted with this flag cannot be recovered. to the HTTP request.
714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 714 def begin_delete_async(resource_group_name, workspace_name, force:nil, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'workspace_name is nil' if workspace_name.nil? fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '63'" if !workspace_name.nil? && workspace_name.length > 63 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '4'" if !workspace_name.nil? && workspace_name.length < 4 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'" if !workspace_name.nil? && workspace_name.match(Regexp.new('^^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 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 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.OperationalInsights/workspaces/{workspaceName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version,'force' => force}, 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 == 200 || 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_with_http_info(resource_group_name, workspace_name, force: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag.
is case insensitive. workspace that was deleted with this flag cannot be recovered. will be added to the HTTP request.
694 695 696 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 694 def begin_delete_with_http_info(resource_group_name, workspace_name, force:nil, custom_headers:nil) begin_delete_async(resource_group_name, workspace_name, force:force, custom_headers:custom_headers).value! end |
#create_or_update(resource_group_name, workspace_name, parameters, custom_headers: nil) ⇒ Workspace
Create or update a workspace.
is case insensitive. workspace. will be added to the HTTP request.
223 224 225 226 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 223 def create_or_update(resource_group_name, workspace_name, parameters, custom_headers:nil) response = create_or_update_async(resource_group_name, workspace_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end |
#create_or_update_async(resource_group_name, workspace_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
is case insensitive. workspace. will be added to the HTTP request.
response.
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 240 def create_or_update_async(resource_group_name, workspace_name, parameters, custom_headers:nil) # Send request promise = begin_create_or_update_async(resource_group_name, workspace_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::OperationalInsights::Mgmt::V2020_08_01::Models::Workspace.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, workspace_name, force: nil, custom_headers: nil) ⇒ Object
Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag.
is case insensitive. workspace that was deleted with this flag cannot be recovered. will be added to the HTTP request.
272 273 274 275 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 272 def delete(resource_group_name, workspace_name, force:nil, custom_headers:nil) response = delete_async(resource_group_name, workspace_name, force:force, custom_headers:custom_headers).value! nil end |
#delete_async(resource_group_name, workspace_name, force: nil, custom_headers: nil) ⇒ Concurrent::Promise
is case insensitive. workspace that was deleted with this flag cannot be recovered. will be added to the HTTP request.
response.
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 289 def delete_async(resource_group_name, workspace_name, force:nil, custom_headers:nil) # Send request promise = begin_delete_async(resource_group_name, workspace_name, force:force, 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, workspace_name, custom_headers: nil) ⇒ Workspace
Gets a workspace instance.
is case insensitive. will be added to the HTTP request.
316 317 318 319 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 316 def get(resource_group_name, workspace_name, custom_headers:nil) response = get_async(resource_group_name, workspace_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_async(resource_group_name, workspace_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets a workspace instance.
is case insensitive. to the HTTP request.
347 348 349 350 351 352 353 354 355 356 357 358 359 360 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 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 347 def get_async(resource_group_name, workspace_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'workspace_name is nil' if workspace_name.nil? fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '63'" if !workspace_name.nil? && workspace_name.length > 63 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '4'" if !workspace_name.nil? && workspace_name.length < 4 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'" if !workspace_name.nil? && workspace_name.match(Regexp.new('^^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 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 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.OperationalInsights/workspaces/{workspaceName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) 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::OperationalInsights::Mgmt::V2020_08_01::Models::Workspace.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, workspace_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a workspace instance.
is case insensitive. will be added to the HTTP request.
332 333 334 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 332 def get_with_http_info(resource_group_name, workspace_name, custom_headers:nil) get_async(resource_group_name, workspace_name, custom_headers:custom_headers).value! end |
#list(custom_headers: nil) ⇒ WorkspaceListResult
Gets the workspaces in a subscription.
will be added to the HTTP request.
32 33 34 35 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 32 def list(custom_headers:nil) response = list_async(custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_async(custom_headers: nil) ⇒ Concurrent::Promise
Gets the workspaces in a subscription.
to the HTTP request.
57 58 59 60 61 62 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 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 57 def list_async(custom_headers: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, '@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 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/workspaces' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) 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::OperationalInsights::Mgmt::V2020_08_01::Models::WorkspaceListResult.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_resource_group(resource_group_name, custom_headers: nil) ⇒ WorkspaceListResult
Gets workspaces in a resource group.
is case insensitive. will be added to the HTTP request.
122 123 124 125 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 122 def list_by_resource_group(resource_group_name, custom_headers:nil) response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_by_resource_group_async(resource_group_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets workspaces in a resource group.
is case insensitive. to the HTTP request.
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 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 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 151 def list_by_resource_group_async(resource_group_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1 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 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.OperationalInsights/workspaces' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) 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::OperationalInsights::Mgmt::V2020_08_01::Models::WorkspaceListResult.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_resource_group_with_http_info(resource_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets workspaces in a resource group.
is case insensitive. will be added to the HTTP request.
137 138 139 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 137 def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil) list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value! end |
#list_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the workspaces in a subscription.
will be added to the HTTP request.
45 46 47 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 45 def list_with_http_info(custom_headers:nil) list_async(custom_headers:custom_headers).value! end |
#update(resource_group_name, workspace_name, parameters, custom_headers: nil) ⇒ Workspace
Updates a workspace.
is case insensitive. workspace. will be added to the HTTP request.
423 424 425 426 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 423 def update(resource_group_name, workspace_name, parameters, custom_headers:nil) response = update_async(resource_group_name, workspace_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end |
#update_async(resource_group_name, workspace_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Updates a workspace.
is case insensitive. workspace. to the HTTP request.
458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 458 def update_async(resource_group_name, workspace_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil? fail ArgumentError, 'workspace_name is nil' if workspace_name.nil? fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '63'" if !workspace_name.nil? && workspace_name.length > 63 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '4'" if !workspace_name.nil? && workspace_name.length < 4 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'" if !workspace_name.nil? && workspace_name.match(Regexp.new('^^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.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, '@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 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::OperationalInsights::Mgmt::V2020_08_01::Models::WorkspacePatch.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:patch, path_template, ) 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::OperationalInsights::Mgmt::V2020_08_01::Models::Workspace.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 |
#update_with_http_info(resource_group_name, workspace_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Updates a workspace.
is case insensitive. workspace. will be added to the HTTP request.
441 442 443 |
# File 'lib/2020-08-01/generated/azure_mgmt_operational_insights/workspaces.rb', line 441 def update_with_http_info(resource_group_name, workspace_name, parameters, custom_headers:nil) update_async(resource_group_name, workspace_name, parameters, custom_headers:custom_headers).value! end |