azure_mgmt_operational_insights 0.15.2 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights.rb +18 -10
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/available_service_tier.rb +124 -0
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/core_summary.rb +2 -2
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/operation.rb +59 -0
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/operation_display.rb +68 -0
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/operation_list_result.rb +56 -0
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/purge_state.rb +16 -0
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/resource.rb +9 -0
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/saved_search.rb +37 -13
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/saved_searches_list_result.rb +3 -2
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/search_get_schema_response.rb +1 -1
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/search_metadata.rb +8 -8
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/{search_highlight.rb → shared_keys.rb} +13 -13
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/sku_name_enum.rb +21 -0
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/storage_insight_list_result.rb +2 -3
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/tag.rb +2 -2
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/workspace_purge_body.rb +67 -0
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/workspace_purge_body_filters.rb +85 -0
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/workspace_purge_response.rb +47 -0
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/workspace_purge_status_response.rb +47 -0
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/operational_insights_management_client.rb +24 -10
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/operations.rb +109 -0
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/saved_searches.rb +78 -181
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/storage_insights.rb +69 -82
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/workspaces.rb +476 -119
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights.rb +14 -8
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/data_sources.rb +45 -32
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/linked_services.rb +34 -24
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/models/data_source_list_result.rb +1 -1
- data/lib/{2015-03-20/generated/azure_mgmt_operational_insights/models/search_error.rb → 2015-11-01-preview/generated/azure_mgmt_operational_insights/models/error_response.rb} +11 -11
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/models/intelligence_pack.rb +11 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/models/operation.rb +59 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/models/operation_display.rb +68 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/models/operation_list_result.rb +101 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/models/operation_status.rb +102 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/models/resource.rb +10 -1
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/models/sku.rb +2 -1
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/models/sku_name_enum.rb +2 -1
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/models/workspace.rb +10 -11
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/models/workspace_list_management_groups_result.rb +1 -1
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/operational_insights_management_client.rb +239 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/operations.rb +219 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/workspaces.rb +202 -63
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights.rb +123 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/available_service_tiers.rb +146 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/clusters.rb +959 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/data_exports.rb +523 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/data_sources.rb +603 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/deleted_workspaces.rb +211 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/gateways.rb +123 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/intelligence_packs.rb +351 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/linked_services.rb +577 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/linked_storage_accounts.rb +481 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/management_groups.rb +130 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/available_service_tier.rb +124 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/azure_entity_resource.rb +75 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/cluster.rb +159 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/cluster_entity_status.rb +21 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/cluster_error_response.rb +48 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/cluster_list_result.rb +98 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/cluster_patch.rb +78 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/cluster_sku.rb +58 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/cluster_sku_name_enum.rb +15 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/core_summary.rb +57 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/data_export.rb +174 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/data_export_error_response.rb +48 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/data_export_list_result.rb +56 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/data_ingestion_status.rb +20 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/data_source.rb +130 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/data_source_filter.rb +61 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/data_source_kind.rb +47 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/data_source_list_result.rb +98 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/data_source_type.rb +16 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/error_additional_info.rb +59 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/error_contract.rb +49 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/error_response.rb +113 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/identity.rb +72 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/identity_type.rb +16 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/intelligence_pack.rb +69 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/key_vault_properties.rb +71 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/linked_service.rb +120 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/linked_service_entity_status.rb +18 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/linked_service_list_result.rb +55 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/linked_storage_accounts_list_result.rb +56 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/linked_storage_accounts_resource.rb +95 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/management_group.rb +128 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/metric_name.rb +57 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/operation.rb +59 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/operation_display.rb +79 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/operation_list_result.rb +101 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/operation_status.rb +102 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/private_link_scoped_resource.rb +58 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/proxy_resource.rb +63 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/public_network_access_type.rb +16 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/purge_state.rb +16 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/resource.rb +83 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/saved_search.rb +165 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/saved_searches_list_result.rb +55 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/search_get_schema_response.rb +67 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/search_metadata.rb +241 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/search_metadata_schema.rb +57 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/search_schema_value.rb +123 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/search_sort.rb +58 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/search_sort_enum.rb +16 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/shared_keys.rb +57 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/sku_name_enum.rb +21 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/storage_account.rb +58 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/storage_insight.rb +157 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/storage_insight_list_result.rb +98 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/storage_insight_state.rb +16 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/storage_insight_status.rb +58 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/table.rb +79 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/tables_list_result.rb +55 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/tag.rb +57 -0
- data/lib/{2015-03-20/generated/azure_mgmt_operational_insights/models/search_results_response.rb → 2020-03-01-preview/generated/azure_mgmt_operational_insights/models/tracked_resource.rb} +33 -31
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/type.rb +16 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/usage_metric.rb +103 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/workspace.rb +214 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/workspace_capping.rb +73 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/workspace_entity_status.rb +21 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/workspace_list_management_groups_result.rb +56 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/workspace_list_result.rb +55 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/workspace_list_usages_result.rb +56 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/workspace_patch.rb +207 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/workspace_purge_body.rb +67 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/workspace_purge_body_filters.rb +85 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/workspace_purge_response.rb +47 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/workspace_purge_status_response.rb +47 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/workspace_sku.rb +85 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/models/workspace_sku_name_enum.rb +21 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/module_definition.rb +9 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/operation_statuses.rb +121 -0
- data/lib/{2015-11-01-preview/generated/azure_mgmt_operational_insights/azure_log_analytics.rb → 2020-03-01-preview/generated/azure_mgmt_operational_insights/operational_insights_management_client.rb} +89 -19
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/operations.rb +220 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/saved_searches.rb +457 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/schema.rb +130 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/shared_keys_operations.rb +238 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/storage_insight_configs.rb +592 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/tables.rb +359 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/usages.rb +130 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/workspace_purge.rb +277 -0
- data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/workspaces.rb +768 -0
- data/lib/azure_mgmt_operational_insights.rb +1 -0
- data/lib/profiles/latest/modules/operationalinsights_profile_module.rb +382 -180
- data/lib/profiles/latest/operationalinsights_latest_profile_client.rb +28 -9
- data/lib/profiles/latest/operationalinsights_module_definition.rb +0 -1
- data/lib/version.rb +1 -1
- metadata +123 -10
- data/lib/2015-03-20/generated/azure_mgmt_operational_insights/models/search_parameters.rb +0 -94
@@ -0,0 +1,130 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::OperationalInsights::Mgmt::V2020_03_01_preview
|
7
|
+
#
|
8
|
+
# Operational Insights Client
|
9
|
+
#
|
10
|
+
class Schema
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Schema class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [OperationalInsightsManagementClient] reference to the OperationalInsightsManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Gets the schema for a given workspace.
|
26
|
+
#
|
27
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
28
|
+
# is case insensitive.
|
29
|
+
# @param workspace_name [String] The name of the workspace.
|
30
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
31
|
+
# will be added to the HTTP request.
|
32
|
+
#
|
33
|
+
# @return [SearchGetSchemaResponse] operation results.
|
34
|
+
#
|
35
|
+
def get(resource_group_name, workspace_name, custom_headers:nil)
|
36
|
+
response = get_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
|
37
|
+
response.body unless response.nil?
|
38
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# Gets the schema for a given workspace.
|
42
|
+
#
|
43
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
44
|
+
# is case insensitive.
|
45
|
+
# @param workspace_name [String] The name of the workspace.
|
46
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
47
|
+
# will be added to the HTTP request.
|
48
|
+
#
|
49
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
50
|
+
#
|
51
|
+
def get_with_http_info(resource_group_name, workspace_name, custom_headers:nil)
|
52
|
+
get_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
|
53
|
+
end
|
54
|
+
|
55
|
+
#
|
56
|
+
# Gets the schema for a given workspace.
|
57
|
+
#
|
58
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
59
|
+
# is case insensitive.
|
60
|
+
# @param workspace_name [String] The name of the workspace.
|
61
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
62
|
+
# to the HTTP request.
|
63
|
+
#
|
64
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
65
|
+
#
|
66
|
+
def get_async(resource_group_name, workspace_name, custom_headers:nil)
|
67
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
68
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
69
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
70
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
71
|
+
fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
|
72
|
+
fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '63'" if !workspace_name.nil? && workspace_name.length > 63
|
73
|
+
fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '4'" if !workspace_name.nil? && workspace_name.length < 4
|
74
|
+
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?
|
75
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
76
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
77
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
78
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
79
|
+
|
80
|
+
|
81
|
+
request_headers = {}
|
82
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
83
|
+
|
84
|
+
# Set Headers
|
85
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
86
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
87
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema'
|
88
|
+
|
89
|
+
request_url = @base_url || @client.base_url
|
90
|
+
|
91
|
+
options = {
|
92
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
93
|
+
path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'subscriptionId' => @client.subscription_id},
|
94
|
+
query_params: {'api-version' => @client.api_version},
|
95
|
+
headers: request_headers.merge(custom_headers || {}),
|
96
|
+
base_url: request_url
|
97
|
+
}
|
98
|
+
promise = @client.make_request_async(:post, path_template, options)
|
99
|
+
|
100
|
+
promise = promise.then do |result|
|
101
|
+
http_response = result.response
|
102
|
+
status_code = http_response.status
|
103
|
+
response_content = http_response.body
|
104
|
+
unless status_code == 200
|
105
|
+
error_model = JSON.load(response_content)
|
106
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
107
|
+
end
|
108
|
+
|
109
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
110
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
111
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
112
|
+
# Deserialize Response
|
113
|
+
if status_code == 200
|
114
|
+
begin
|
115
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
116
|
+
result_mapper = Azure::OperationalInsights::Mgmt::V2020_03_01_preview::Models::SearchGetSchemaResponse.mapper()
|
117
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
118
|
+
rescue Exception => e
|
119
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
result
|
124
|
+
end
|
125
|
+
|
126
|
+
promise.execute
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
end
|
data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/shared_keys_operations.rb
ADDED
@@ -0,0 +1,238 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::OperationalInsights::Mgmt::V2020_03_01_preview
|
7
|
+
#
|
8
|
+
# Operational Insights Client
|
9
|
+
#
|
10
|
+
class SharedKeysOperations
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the SharedKeysOperations class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [OperationalInsightsManagementClient] reference to the OperationalInsightsManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Gets the shared keys for a workspace.
|
26
|
+
#
|
27
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
28
|
+
# is case insensitive.
|
29
|
+
# @param workspace_name [String] The name of the workspace.
|
30
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
31
|
+
# will be added to the HTTP request.
|
32
|
+
#
|
33
|
+
# @return [SharedKeys] operation results.
|
34
|
+
#
|
35
|
+
def get_shared_keys(resource_group_name, workspace_name, custom_headers:nil)
|
36
|
+
response = get_shared_keys_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
|
37
|
+
response.body unless response.nil?
|
38
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# Gets the shared keys for a workspace.
|
42
|
+
#
|
43
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
44
|
+
# is case insensitive.
|
45
|
+
# @param workspace_name [String] The name of the workspace.
|
46
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
47
|
+
# will be added to the HTTP request.
|
48
|
+
#
|
49
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
50
|
+
#
|
51
|
+
def get_shared_keys_with_http_info(resource_group_name, workspace_name, custom_headers:nil)
|
52
|
+
get_shared_keys_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
|
53
|
+
end
|
54
|
+
|
55
|
+
#
|
56
|
+
# Gets the shared keys for a workspace.
|
57
|
+
#
|
58
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
59
|
+
# is case insensitive.
|
60
|
+
# @param workspace_name [String] The name of the workspace.
|
61
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
62
|
+
# to the HTTP request.
|
63
|
+
#
|
64
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
65
|
+
#
|
66
|
+
def get_shared_keys_async(resource_group_name, workspace_name, custom_headers:nil)
|
67
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
68
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
69
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
70
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
71
|
+
fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
|
72
|
+
fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '63'" if !workspace_name.nil? && workspace_name.length > 63
|
73
|
+
fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '4'" if !workspace_name.nil? && workspace_name.length < 4
|
74
|
+
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?
|
75
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
76
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
77
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
78
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
79
|
+
|
80
|
+
|
81
|
+
request_headers = {}
|
82
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
83
|
+
|
84
|
+
# Set Headers
|
85
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
86
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
87
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys'
|
88
|
+
|
89
|
+
request_url = @base_url || @client.base_url
|
90
|
+
|
91
|
+
options = {
|
92
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
93
|
+
path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'subscriptionId' => @client.subscription_id},
|
94
|
+
query_params: {'api-version' => @client.api_version},
|
95
|
+
headers: request_headers.merge(custom_headers || {}),
|
96
|
+
base_url: request_url
|
97
|
+
}
|
98
|
+
promise = @client.make_request_async(:post, path_template, options)
|
99
|
+
|
100
|
+
promise = promise.then do |result|
|
101
|
+
http_response = result.response
|
102
|
+
status_code = http_response.status
|
103
|
+
response_content = http_response.body
|
104
|
+
unless status_code == 200
|
105
|
+
error_model = JSON.load(response_content)
|
106
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
107
|
+
end
|
108
|
+
|
109
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
110
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
111
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
112
|
+
# Deserialize Response
|
113
|
+
if status_code == 200
|
114
|
+
begin
|
115
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
116
|
+
result_mapper = Azure::OperationalInsights::Mgmt::V2020_03_01_preview::Models::SharedKeys.mapper()
|
117
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
118
|
+
rescue Exception => e
|
119
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
result
|
124
|
+
end
|
125
|
+
|
126
|
+
promise.execute
|
127
|
+
end
|
128
|
+
|
129
|
+
#
|
130
|
+
# Regenerates the shared keys for a Log Analytics Workspace. These keys are
|
131
|
+
# used to connect Microsoft Operational Insights agents to the workspace.
|
132
|
+
#
|
133
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
134
|
+
# is case insensitive.
|
135
|
+
# @param workspace_name [String] The name of the workspace.
|
136
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
137
|
+
# will be added to the HTTP request.
|
138
|
+
#
|
139
|
+
# @return [SharedKeys] operation results.
|
140
|
+
#
|
141
|
+
def regenerate(resource_group_name, workspace_name, custom_headers:nil)
|
142
|
+
response = regenerate_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
|
143
|
+
response.body unless response.nil?
|
144
|
+
end
|
145
|
+
|
146
|
+
#
|
147
|
+
# Regenerates the shared keys for a Log Analytics Workspace. These keys are
|
148
|
+
# used to connect Microsoft Operational Insights agents to the workspace.
|
149
|
+
#
|
150
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
151
|
+
# is case insensitive.
|
152
|
+
# @param workspace_name [String] The name of the workspace.
|
153
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
154
|
+
# will be added to the HTTP request.
|
155
|
+
#
|
156
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
157
|
+
#
|
158
|
+
def regenerate_with_http_info(resource_group_name, workspace_name, custom_headers:nil)
|
159
|
+
regenerate_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
|
160
|
+
end
|
161
|
+
|
162
|
+
#
|
163
|
+
# Regenerates the shared keys for a Log Analytics Workspace. These keys are
|
164
|
+
# used to connect Microsoft Operational Insights agents to the workspace.
|
165
|
+
#
|
166
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
167
|
+
# is case insensitive.
|
168
|
+
# @param workspace_name [String] The name of the workspace.
|
169
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
170
|
+
# to the HTTP request.
|
171
|
+
#
|
172
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
173
|
+
#
|
174
|
+
def regenerate_async(resource_group_name, workspace_name, custom_headers:nil)
|
175
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
176
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
177
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
178
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
179
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
180
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
181
|
+
fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
|
182
|
+
fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '63'" if !workspace_name.nil? && workspace_name.length > 63
|
183
|
+
fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '4'" if !workspace_name.nil? && workspace_name.length < 4
|
184
|
+
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?
|
185
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
186
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
187
|
+
|
188
|
+
|
189
|
+
request_headers = {}
|
190
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
191
|
+
|
192
|
+
# Set Headers
|
193
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
194
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
195
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey'
|
196
|
+
|
197
|
+
request_url = @base_url || @client.base_url
|
198
|
+
|
199
|
+
options = {
|
200
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
201
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name},
|
202
|
+
query_params: {'api-version' => @client.api_version},
|
203
|
+
headers: request_headers.merge(custom_headers || {}),
|
204
|
+
base_url: request_url
|
205
|
+
}
|
206
|
+
promise = @client.make_request_async(:post, path_template, options)
|
207
|
+
|
208
|
+
promise = promise.then do |result|
|
209
|
+
http_response = result.response
|
210
|
+
status_code = http_response.status
|
211
|
+
response_content = http_response.body
|
212
|
+
unless status_code == 200
|
213
|
+
error_model = JSON.load(response_content)
|
214
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
215
|
+
end
|
216
|
+
|
217
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
218
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
219
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
220
|
+
# Deserialize Response
|
221
|
+
if status_code == 200
|
222
|
+
begin
|
223
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
224
|
+
result_mapper = Azure::OperationalInsights::Mgmt::V2020_03_01_preview::Models::SharedKeys.mapper()
|
225
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
226
|
+
rescue Exception => e
|
227
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
result
|
232
|
+
end
|
233
|
+
|
234
|
+
promise.execute
|
235
|
+
end
|
236
|
+
|
237
|
+
end
|
238
|
+
end
|
data/lib/2020-03-01-preview/generated/azure_mgmt_operational_insights/storage_insight_configs.rb
ADDED
@@ -0,0 +1,592 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::OperationalInsights::Mgmt::V2020_03_01_preview
|
7
|
+
#
|
8
|
+
# Operational Insights Client
|
9
|
+
#
|
10
|
+
class StorageInsightConfigs
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the StorageInsightConfigs class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [OperationalInsightsManagementClient] reference to the OperationalInsightsManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Create or update a storage insight.
|
26
|
+
#
|
27
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
28
|
+
# is case insensitive.
|
29
|
+
# @param workspace_name [String] The name of the workspace.
|
30
|
+
# @param storage_insight_name [String] Name of the storageInsightsConfigs
|
31
|
+
# resource
|
32
|
+
# @param parameters [StorageInsight] The parameters required to create or
|
33
|
+
# update a storage insight.
|
34
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
35
|
+
# will be added to the HTTP request.
|
36
|
+
#
|
37
|
+
# @return [StorageInsight] operation results.
|
38
|
+
#
|
39
|
+
def create_or_update(resource_group_name, workspace_name, storage_insight_name, parameters, custom_headers:nil)
|
40
|
+
response = create_or_update_async(resource_group_name, workspace_name, storage_insight_name, parameters, custom_headers:custom_headers).value!
|
41
|
+
response.body unless response.nil?
|
42
|
+
end
|
43
|
+
|
44
|
+
#
|
45
|
+
# Create or update a storage insight.
|
46
|
+
#
|
47
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
48
|
+
# is case insensitive.
|
49
|
+
# @param workspace_name [String] The name of the workspace.
|
50
|
+
# @param storage_insight_name [String] Name of the storageInsightsConfigs
|
51
|
+
# resource
|
52
|
+
# @param parameters [StorageInsight] The parameters required to create or
|
53
|
+
# update a storage insight.
|
54
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
55
|
+
# will be added to the HTTP request.
|
56
|
+
#
|
57
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
58
|
+
#
|
59
|
+
def create_or_update_with_http_info(resource_group_name, workspace_name, storage_insight_name, parameters, custom_headers:nil)
|
60
|
+
create_or_update_async(resource_group_name, workspace_name, storage_insight_name, parameters, custom_headers:custom_headers).value!
|
61
|
+
end
|
62
|
+
|
63
|
+
#
|
64
|
+
# Create or update a storage insight.
|
65
|
+
#
|
66
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
67
|
+
# is case insensitive.
|
68
|
+
# @param workspace_name [String] The name of the workspace.
|
69
|
+
# @param storage_insight_name [String] Name of the storageInsightsConfigs
|
70
|
+
# resource
|
71
|
+
# @param parameters [StorageInsight] The parameters required to create or
|
72
|
+
# update a storage insight.
|
73
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
74
|
+
# to the HTTP request.
|
75
|
+
#
|
76
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
77
|
+
#
|
78
|
+
def create_or_update_async(resource_group_name, workspace_name, storage_insight_name, parameters, custom_headers:nil)
|
79
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
80
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
81
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
82
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
83
|
+
fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
|
84
|
+
fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '63'" if !workspace_name.nil? && workspace_name.length > 63
|
85
|
+
fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '4'" if !workspace_name.nil? && workspace_name.length < 4
|
86
|
+
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?
|
87
|
+
fail ArgumentError, 'storage_insight_name is nil' if storage_insight_name.nil?
|
88
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
89
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
90
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
91
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
92
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
93
|
+
|
94
|
+
|
95
|
+
request_headers = {}
|
96
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
97
|
+
|
98
|
+
# Set Headers
|
99
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
100
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
101
|
+
|
102
|
+
# Serialize Request
|
103
|
+
request_mapper = Azure::OperationalInsights::Mgmt::V2020_03_01_preview::Models::StorageInsight.mapper()
|
104
|
+
request_content = @client.serialize(request_mapper, parameters)
|
105
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
106
|
+
|
107
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'
|
108
|
+
|
109
|
+
request_url = @base_url || @client.base_url
|
110
|
+
|
111
|
+
options = {
|
112
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
113
|
+
path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'storageInsightName' => storage_insight_name,'subscriptionId' => @client.subscription_id},
|
114
|
+
query_params: {'api-version' => @client.api_version},
|
115
|
+
body: request_content,
|
116
|
+
headers: request_headers.merge(custom_headers || {}),
|
117
|
+
base_url: request_url
|
118
|
+
}
|
119
|
+
promise = @client.make_request_async(:put, path_template, options)
|
120
|
+
|
121
|
+
promise = promise.then do |result|
|
122
|
+
http_response = result.response
|
123
|
+
status_code = http_response.status
|
124
|
+
response_content = http_response.body
|
125
|
+
unless status_code == 201 || status_code == 200
|
126
|
+
error_model = JSON.load(response_content)
|
127
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
128
|
+
end
|
129
|
+
|
130
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
131
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
132
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
133
|
+
# Deserialize Response
|
134
|
+
if status_code == 201
|
135
|
+
begin
|
136
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
137
|
+
result_mapper = Azure::OperationalInsights::Mgmt::V2020_03_01_preview::Models::StorageInsight.mapper()
|
138
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
139
|
+
rescue Exception => e
|
140
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
# Deserialize Response
|
144
|
+
if status_code == 200
|
145
|
+
begin
|
146
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
147
|
+
result_mapper = Azure::OperationalInsights::Mgmt::V2020_03_01_preview::Models::StorageInsight.mapper()
|
148
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
149
|
+
rescue Exception => e
|
150
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
result
|
155
|
+
end
|
156
|
+
|
157
|
+
promise.execute
|
158
|
+
end
|
159
|
+
|
160
|
+
#
|
161
|
+
# Gets a storage insight instance.
|
162
|
+
#
|
163
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
164
|
+
# is case insensitive.
|
165
|
+
# @param workspace_name [String] The name of the workspace.
|
166
|
+
# @param storage_insight_name [String] Name of the storageInsightsConfigs
|
167
|
+
# resource
|
168
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
169
|
+
# will be added to the HTTP request.
|
170
|
+
#
|
171
|
+
# @return [StorageInsight] operation results.
|
172
|
+
#
|
173
|
+
def get(resource_group_name, workspace_name, storage_insight_name, custom_headers:nil)
|
174
|
+
response = get_async(resource_group_name, workspace_name, storage_insight_name, custom_headers:custom_headers).value!
|
175
|
+
response.body unless response.nil?
|
176
|
+
end
|
177
|
+
|
178
|
+
#
|
179
|
+
# Gets a storage insight instance.
|
180
|
+
#
|
181
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
182
|
+
# is case insensitive.
|
183
|
+
# @param workspace_name [String] The name of the workspace.
|
184
|
+
# @param storage_insight_name [String] Name of the storageInsightsConfigs
|
185
|
+
# resource
|
186
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
187
|
+
# will be added to the HTTP request.
|
188
|
+
#
|
189
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
190
|
+
#
|
191
|
+
def get_with_http_info(resource_group_name, workspace_name, storage_insight_name, custom_headers:nil)
|
192
|
+
get_async(resource_group_name, workspace_name, storage_insight_name, custom_headers:custom_headers).value!
|
193
|
+
end
|
194
|
+
|
195
|
+
#
|
196
|
+
# Gets a storage insight instance.
|
197
|
+
#
|
198
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
199
|
+
# is case insensitive.
|
200
|
+
# @param workspace_name [String] The name of the workspace.
|
201
|
+
# @param storage_insight_name [String] Name of the storageInsightsConfigs
|
202
|
+
# resource
|
203
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
204
|
+
# to the HTTP request.
|
205
|
+
#
|
206
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
207
|
+
#
|
208
|
+
def get_async(resource_group_name, workspace_name, storage_insight_name, custom_headers:nil)
|
209
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
210
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
211
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
212
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
213
|
+
fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
|
214
|
+
fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '63'" if !workspace_name.nil? && workspace_name.length > 63
|
215
|
+
fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '4'" if !workspace_name.nil? && workspace_name.length < 4
|
216
|
+
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?
|
217
|
+
fail ArgumentError, 'storage_insight_name is nil' if storage_insight_name.nil?
|
218
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
219
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
220
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
221
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
222
|
+
|
223
|
+
|
224
|
+
request_headers = {}
|
225
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
226
|
+
|
227
|
+
# Set Headers
|
228
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
229
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
230
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'
|
231
|
+
|
232
|
+
request_url = @base_url || @client.base_url
|
233
|
+
|
234
|
+
options = {
|
235
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
236
|
+
path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'storageInsightName' => storage_insight_name,'subscriptionId' => @client.subscription_id},
|
237
|
+
query_params: {'api-version' => @client.api_version},
|
238
|
+
headers: request_headers.merge(custom_headers || {}),
|
239
|
+
base_url: request_url
|
240
|
+
}
|
241
|
+
promise = @client.make_request_async(:get, path_template, options)
|
242
|
+
|
243
|
+
promise = promise.then do |result|
|
244
|
+
http_response = result.response
|
245
|
+
status_code = http_response.status
|
246
|
+
response_content = http_response.body
|
247
|
+
unless status_code == 200
|
248
|
+
error_model = JSON.load(response_content)
|
249
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
250
|
+
end
|
251
|
+
|
252
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
253
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
254
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
255
|
+
# Deserialize Response
|
256
|
+
if status_code == 200
|
257
|
+
begin
|
258
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
259
|
+
result_mapper = Azure::OperationalInsights::Mgmt::V2020_03_01_preview::Models::StorageInsight.mapper()
|
260
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
261
|
+
rescue Exception => e
|
262
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
result
|
267
|
+
end
|
268
|
+
|
269
|
+
promise.execute
|
270
|
+
end
|
271
|
+
|
272
|
+
#
|
273
|
+
# Deletes a storageInsightsConfigs resource
|
274
|
+
#
|
275
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
276
|
+
# is case insensitive.
|
277
|
+
# @param workspace_name [String] The name of the workspace.
|
278
|
+
# @param storage_insight_name [String] Name of the storageInsightsConfigs
|
279
|
+
# resource
|
280
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
281
|
+
# will be added to the HTTP request.
|
282
|
+
#
|
283
|
+
#
|
284
|
+
def delete(resource_group_name, workspace_name, storage_insight_name, custom_headers:nil)
|
285
|
+
response = delete_async(resource_group_name, workspace_name, storage_insight_name, custom_headers:custom_headers).value!
|
286
|
+
nil
|
287
|
+
end
|
288
|
+
|
289
|
+
#
|
290
|
+
# Deletes a storageInsightsConfigs resource
|
291
|
+
#
|
292
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
293
|
+
# is case insensitive.
|
294
|
+
# @param workspace_name [String] The name of the workspace.
|
295
|
+
# @param storage_insight_name [String] Name of the storageInsightsConfigs
|
296
|
+
# resource
|
297
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
298
|
+
# will be added to the HTTP request.
|
299
|
+
#
|
300
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
301
|
+
#
|
302
|
+
def delete_with_http_info(resource_group_name, workspace_name, storage_insight_name, custom_headers:nil)
|
303
|
+
delete_async(resource_group_name, workspace_name, storage_insight_name, custom_headers:custom_headers).value!
|
304
|
+
end
|
305
|
+
|
306
|
+
#
|
307
|
+
# Deletes a storageInsightsConfigs resource
|
308
|
+
#
|
309
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
310
|
+
# is case insensitive.
|
311
|
+
# @param workspace_name [String] The name of the workspace.
|
312
|
+
# @param storage_insight_name [String] Name of the storageInsightsConfigs
|
313
|
+
# resource
|
314
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
315
|
+
# to the HTTP request.
|
316
|
+
#
|
317
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
318
|
+
#
|
319
|
+
def delete_async(resource_group_name, workspace_name, storage_insight_name, custom_headers:nil)
|
320
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
321
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
322
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
323
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
324
|
+
fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
|
325
|
+
fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '63'" if !workspace_name.nil? && workspace_name.length > 63
|
326
|
+
fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '4'" if !workspace_name.nil? && workspace_name.length < 4
|
327
|
+
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?
|
328
|
+
fail ArgumentError, 'storage_insight_name is nil' if storage_insight_name.nil?
|
329
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
330
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
331
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
332
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
333
|
+
|
334
|
+
|
335
|
+
request_headers = {}
|
336
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
337
|
+
|
338
|
+
# Set Headers
|
339
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
340
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
341
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'
|
342
|
+
|
343
|
+
request_url = @base_url || @client.base_url
|
344
|
+
|
345
|
+
options = {
|
346
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
347
|
+
path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'storageInsightName' => storage_insight_name,'subscriptionId' => @client.subscription_id},
|
348
|
+
query_params: {'api-version' => @client.api_version},
|
349
|
+
headers: request_headers.merge(custom_headers || {}),
|
350
|
+
base_url: request_url
|
351
|
+
}
|
352
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
353
|
+
|
354
|
+
promise = promise.then do |result|
|
355
|
+
http_response = result.response
|
356
|
+
status_code = http_response.status
|
357
|
+
response_content = http_response.body
|
358
|
+
unless status_code == 200 || status_code == 204
|
359
|
+
error_model = JSON.load(response_content)
|
360
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
361
|
+
end
|
362
|
+
|
363
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
364
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
365
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
366
|
+
|
367
|
+
result
|
368
|
+
end
|
369
|
+
|
370
|
+
promise.execute
|
371
|
+
end
|
372
|
+
|
373
|
+
#
|
374
|
+
# Lists the storage insight instances within a workspace
|
375
|
+
#
|
376
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
377
|
+
# is case insensitive.
|
378
|
+
# @param workspace_name [String] The name of the workspace.
|
379
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
380
|
+
# will be added to the HTTP request.
|
381
|
+
#
|
382
|
+
# @return [Array<StorageInsight>] operation results.
|
383
|
+
#
|
384
|
+
def list_by_workspace(resource_group_name, workspace_name, custom_headers:nil)
|
385
|
+
first_page = list_by_workspace_as_lazy(resource_group_name, workspace_name, custom_headers:custom_headers)
|
386
|
+
first_page.get_all_items
|
387
|
+
end
|
388
|
+
|
389
|
+
#
|
390
|
+
# Lists the storage insight instances within a workspace
|
391
|
+
#
|
392
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
393
|
+
# is case insensitive.
|
394
|
+
# @param workspace_name [String] The name of the workspace.
|
395
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
396
|
+
# will be added to the HTTP request.
|
397
|
+
#
|
398
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
399
|
+
#
|
400
|
+
def list_by_workspace_with_http_info(resource_group_name, workspace_name, custom_headers:nil)
|
401
|
+
list_by_workspace_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
|
402
|
+
end
|
403
|
+
|
404
|
+
#
|
405
|
+
# Lists the storage insight instances within a workspace
|
406
|
+
#
|
407
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
408
|
+
# is case insensitive.
|
409
|
+
# @param workspace_name [String] The name of the workspace.
|
410
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
411
|
+
# to the HTTP request.
|
412
|
+
#
|
413
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
414
|
+
#
|
415
|
+
def list_by_workspace_async(resource_group_name, workspace_name, custom_headers:nil)
|
416
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
417
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
418
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
419
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
420
|
+
fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
|
421
|
+
fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '63'" if !workspace_name.nil? && workspace_name.length > 63
|
422
|
+
fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '4'" if !workspace_name.nil? && workspace_name.length < 4
|
423
|
+
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?
|
424
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
425
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
426
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
427
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
428
|
+
|
429
|
+
|
430
|
+
request_headers = {}
|
431
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
432
|
+
|
433
|
+
# Set Headers
|
434
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
435
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
436
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs'
|
437
|
+
|
438
|
+
request_url = @base_url || @client.base_url
|
439
|
+
|
440
|
+
options = {
|
441
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
442
|
+
path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'subscriptionId' => @client.subscription_id},
|
443
|
+
query_params: {'api-version' => @client.api_version},
|
444
|
+
headers: request_headers.merge(custom_headers || {}),
|
445
|
+
base_url: request_url
|
446
|
+
}
|
447
|
+
promise = @client.make_request_async(:get, path_template, options)
|
448
|
+
|
449
|
+
promise = promise.then do |result|
|
450
|
+
http_response = result.response
|
451
|
+
status_code = http_response.status
|
452
|
+
response_content = http_response.body
|
453
|
+
unless status_code == 200
|
454
|
+
error_model = JSON.load(response_content)
|
455
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
456
|
+
end
|
457
|
+
|
458
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
459
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
460
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
461
|
+
# Deserialize Response
|
462
|
+
if status_code == 200
|
463
|
+
begin
|
464
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
465
|
+
result_mapper = Azure::OperationalInsights::Mgmt::V2020_03_01_preview::Models::StorageInsightListResult.mapper()
|
466
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
467
|
+
rescue Exception => e
|
468
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
469
|
+
end
|
470
|
+
end
|
471
|
+
|
472
|
+
result
|
473
|
+
end
|
474
|
+
|
475
|
+
promise.execute
|
476
|
+
end
|
477
|
+
|
478
|
+
#
|
479
|
+
# Lists the storage insight instances within a workspace
|
480
|
+
#
|
481
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
482
|
+
# to List operation.
|
483
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
484
|
+
# will be added to the HTTP request.
|
485
|
+
#
|
486
|
+
# @return [StorageInsightListResult] operation results.
|
487
|
+
#
|
488
|
+
def list_by_workspace_next(next_page_link, custom_headers:nil)
|
489
|
+
response = list_by_workspace_next_async(next_page_link, custom_headers:custom_headers).value!
|
490
|
+
response.body unless response.nil?
|
491
|
+
end
|
492
|
+
|
493
|
+
#
|
494
|
+
# Lists the storage insight instances within a workspace
|
495
|
+
#
|
496
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
497
|
+
# to List operation.
|
498
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
499
|
+
# will be added to the HTTP request.
|
500
|
+
#
|
501
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
502
|
+
#
|
503
|
+
def list_by_workspace_next_with_http_info(next_page_link, custom_headers:nil)
|
504
|
+
list_by_workspace_next_async(next_page_link, custom_headers:custom_headers).value!
|
505
|
+
end
|
506
|
+
|
507
|
+
#
|
508
|
+
# Lists the storage insight instances within a workspace
|
509
|
+
#
|
510
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
511
|
+
# to List operation.
|
512
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
513
|
+
# to the HTTP request.
|
514
|
+
#
|
515
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
516
|
+
#
|
517
|
+
def list_by_workspace_next_async(next_page_link, custom_headers:nil)
|
518
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
519
|
+
|
520
|
+
|
521
|
+
request_headers = {}
|
522
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
523
|
+
|
524
|
+
# Set Headers
|
525
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
526
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
527
|
+
path_template = '{nextLink}'
|
528
|
+
|
529
|
+
request_url = @base_url || @client.base_url
|
530
|
+
|
531
|
+
options = {
|
532
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
533
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
534
|
+
headers: request_headers.merge(custom_headers || {}),
|
535
|
+
base_url: request_url
|
536
|
+
}
|
537
|
+
promise = @client.make_request_async(:get, path_template, options)
|
538
|
+
|
539
|
+
promise = promise.then do |result|
|
540
|
+
http_response = result.response
|
541
|
+
status_code = http_response.status
|
542
|
+
response_content = http_response.body
|
543
|
+
unless status_code == 200
|
544
|
+
error_model = JSON.load(response_content)
|
545
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
546
|
+
end
|
547
|
+
|
548
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
549
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
550
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
551
|
+
# Deserialize Response
|
552
|
+
if status_code == 200
|
553
|
+
begin
|
554
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
555
|
+
result_mapper = Azure::OperationalInsights::Mgmt::V2020_03_01_preview::Models::StorageInsightListResult.mapper()
|
556
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
557
|
+
rescue Exception => e
|
558
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
559
|
+
end
|
560
|
+
end
|
561
|
+
|
562
|
+
result
|
563
|
+
end
|
564
|
+
|
565
|
+
promise.execute
|
566
|
+
end
|
567
|
+
|
568
|
+
#
|
569
|
+
# Lists the storage insight instances within a workspace
|
570
|
+
#
|
571
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
572
|
+
# is case insensitive.
|
573
|
+
# @param workspace_name [String] The name of the workspace.
|
574
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
575
|
+
# will be added to the HTTP request.
|
576
|
+
#
|
577
|
+
# @return [StorageInsightListResult] which provide lazy access to pages of the
|
578
|
+
# response.
|
579
|
+
#
|
580
|
+
def list_by_workspace_as_lazy(resource_group_name, workspace_name, custom_headers:nil)
|
581
|
+
response = list_by_workspace_async(resource_group_name, workspace_name, custom_headers:custom_headers).value!
|
582
|
+
unless response.nil?
|
583
|
+
page = response.body
|
584
|
+
page.next_method = Proc.new do |next_page_link|
|
585
|
+
list_by_workspace_next_async(next_page_link, custom_headers:custom_headers)
|
586
|
+
end
|
587
|
+
page
|
588
|
+
end
|
589
|
+
end
|
590
|
+
|
591
|
+
end
|
592
|
+
end
|