azure_mgmt_resource_health 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health.rb +45 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/availability_statuses.rb +856 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/child_availability_statuses.rb +384 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/child_resources.rb +271 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/availability_state_values.rb +17 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/availability_status.rb +93 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/availability_status_list_result.rb +100 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/availability_status_properties.rb +212 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/availability_status_properties_recently_resolved_state.rb +73 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/error_response.rb +71 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/operation.rb +58 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/operation_display.rb +79 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/operation_list_result.rb +56 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/reason_chronicity_types.rb +16 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/recommended_action.rb +70 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/service_impacting_event.rb +95 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/service_impacting_event_incident_properties.rb +79 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/service_impacting_event_status.rb +46 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/module_definition.rb +9 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/operations.rb +109 -0
- data/lib/2015-01-01/generated/azure_mgmt_resource_health/resource_health_client.rb +145 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health.rb +45 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/availability_statuses.rb +863 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/child_availability_statuses.rb +384 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/child_resources.rb +271 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/availability_state_values.rb +17 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/availability_status.rb +93 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/availability_status_list_result.rb +100 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/availability_status_properties.rb +253 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/availability_status_properties_recently_resolved_state.rb +73 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/error_response.rb +71 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/operation.rb +58 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/operation_display.rb +79 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/operation_list_result.rb +56 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/reason_chronicity_types.rb +16 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/recommended_action.rb +70 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event.rb +95 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event_incident_properties.rb +79 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event_status.rb +46 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/module_definition.rb +9 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/operations.rb +109 -0
- data/lib/2017-07-01/generated/azure_mgmt_resource_health/resource_health_client.rb +145 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health.rb +74 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/availability_statuses.rb +842 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/events_operations.rb +463 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/impacted_resources.rb +240 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/metadata.rb +318 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/availability_state_values.rb +18 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/availability_status.rb +93 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/availability_status_list_result.rb +100 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/availability_status_properties.rb +251 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/availability_status_properties_recently_resolved.rb +73 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/azure_entity_resource.rb +75 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/error_response.rb +71 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event.rb +336 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_level_values.rb +17 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_properties_article.rb +46 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_properties_recommended_actions.rb +79 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_properties_recommended_actions_actions_item.rb +59 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_source_values.rb +16 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_status_values.rb +16 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_type_values.rb +18 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/events.rb +99 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/faq.rb +68 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/impact.rb +67 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/impacted_resource_list_result.rb +100 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/impacted_resource_status.rb +123 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/impacted_service_region.rb +110 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/level_values.rb +16 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/link.rb +95 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/link_display_text.rb +57 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/link_type_values.rb +16 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/metadata_entity.rb +134 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/metadata_entity_list_result.rb +98 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/metadata_supported_value_detail.rb +57 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/operation.rb +58 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/operation_display.rb +79 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/operation_list_result.rb +56 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/proxy_resource.rb +63 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/reason_chronicity_types.rb +16 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/reason_type_values.rb +17 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/recommended_action.rb +70 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/resource.rb +83 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/scenario.rb +15 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/service_impacting_event.rb +95 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/service_impacting_event_incident_properties.rb +79 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/service_impacting_event_status.rb +46 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/tracked_resource.rb +92 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/update.rb +59 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/module_definition.rb +9 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/operations.rb +109 -0
- data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/resource_health_client.rb +152 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health.rb +69 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/availability_statuses.rb +842 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/events_operations.rb +463 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/availability_state_values.rb +18 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/availability_status.rb +93 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/availability_status_list_result.rb +100 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/availability_status_properties.rb +251 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/availability_status_properties_recently_resolved.rb +73 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/azure_entity_resource.rb +75 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/error_response.rb +71 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event.rb +336 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_level_values.rb +17 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_properties_article.rb +46 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_properties_recommended_actions.rb +79 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_properties_recommended_actions_actions_item.rb +59 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_source_values.rb +16 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_status_values.rb +16 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_type_values.rb +18 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/events.rb +99 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/faq.rb +68 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/impact.rb +67 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/impacted_service_region.rb +110 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/level_values.rb +16 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/link.rb +95 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/link_display_text.rb +57 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/link_type_values.rb +16 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/metadata_entity.rb +134 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/metadata_entity_list_result.rb +66 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/metadata_supported_value_detail.rb +57 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/operation.rb +58 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/operation_display.rb +79 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/operation_list_result.rb +56 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/proxy_resource.rb +63 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/reason_chronicity_types.rb +16 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/recommended_action.rb +70 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/resource.rb +83 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/scenario.rb +15 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event.rb +95 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event_incident_properties.rb +79 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event_status.rb +46 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/tracked_resource.rb +92 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/update.rb +59 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/module_definition.rb +9 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/operations.rb +109 -0
- data/lib/2018-07-01/generated/azure_mgmt_resource_health/resource_health_client.rb +147 -0
- data/lib/azure_mgmt_resource_health.rb +9 -0
- data/lib/module_definition.rb +7 -0
- data/lib/profiles/latest/modules/resourcehealth_profile_module.rb +123 -0
- data/lib/profiles/latest/resourcehealth_latest_profile_client.rb +40 -0
- data/lib/profiles/latest/resourcehealth_module_definition.rb +8 -0
- data/lib/version.rb +7 -0
- metadata +261 -0
@@ -0,0 +1,463 @@
|
|
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::ResourceHealth::Mgmt::V2018_07_01
|
7
|
+
#
|
8
|
+
# The Resource Health Client.
|
9
|
+
#
|
10
|
+
class EventsOperations
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the EventsOperations class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [ResourceHealthClient] reference to the ResourceHealthClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Lists current service health events in the subscription.
|
26
|
+
#
|
27
|
+
# @param filter [String] The filter to apply on the operation. For more
|
28
|
+
# information please see
|
29
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
30
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
31
|
+
# will be added to the HTTP request.
|
32
|
+
#
|
33
|
+
# @return [Array<Event>] operation results.
|
34
|
+
#
|
35
|
+
def list_by_subscription_id(filter:nil, custom_headers:nil)
|
36
|
+
first_page = list_by_subscription_id_as_lazy(filter:filter, custom_headers:custom_headers)
|
37
|
+
first_page.get_all_items
|
38
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# Lists current service health events in the subscription.
|
42
|
+
#
|
43
|
+
# @param filter [String] The filter to apply on the operation. For more
|
44
|
+
# information please see
|
45
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
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 list_by_subscription_id_with_http_info(filter:nil, custom_headers:nil)
|
52
|
+
list_by_subscription_id_async(filter:filter, custom_headers:custom_headers).value!
|
53
|
+
end
|
54
|
+
|
55
|
+
#
|
56
|
+
# Lists current service health events in the subscription.
|
57
|
+
#
|
58
|
+
# @param filter [String] The filter to apply on the operation. For more
|
59
|
+
# information please see
|
60
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
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 list_by_subscription_id_async(filter:nil, custom_headers:nil)
|
67
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
68
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
69
|
+
|
70
|
+
|
71
|
+
request_headers = {}
|
72
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
73
|
+
|
74
|
+
# Set Headers
|
75
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
76
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
77
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events'
|
78
|
+
|
79
|
+
request_url = @base_url || @client.base_url
|
80
|
+
|
81
|
+
options = {
|
82
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
83
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
84
|
+
query_params: {'api-version' => @client.api_version,'$filter' => filter,'view' => @client.view},
|
85
|
+
headers: request_headers.merge(custom_headers || {}),
|
86
|
+
base_url: request_url
|
87
|
+
}
|
88
|
+
promise = @client.make_request_async(:get, path_template, options)
|
89
|
+
|
90
|
+
promise = promise.then do |result|
|
91
|
+
http_response = result.response
|
92
|
+
status_code = http_response.status
|
93
|
+
response_content = http_response.body
|
94
|
+
unless status_code == 200
|
95
|
+
error_model = JSON.load(response_content)
|
96
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
97
|
+
end
|
98
|
+
|
99
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
100
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
101
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
102
|
+
# Deserialize Response
|
103
|
+
if status_code == 200
|
104
|
+
begin
|
105
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
106
|
+
result_mapper = Azure::ResourceHealth::Mgmt::V2018_07_01::Models::Events.mapper()
|
107
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
108
|
+
rescue Exception => e
|
109
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
result
|
114
|
+
end
|
115
|
+
|
116
|
+
promise.execute
|
117
|
+
end
|
118
|
+
|
119
|
+
#
|
120
|
+
# Lists current service health events for given resource.
|
121
|
+
#
|
122
|
+
# @param resource_uri [String] The fully qualified ID of the resource,
|
123
|
+
# including the resource name and resource type. Currently the API support not
|
124
|
+
# nested and one nesting level resource types :
|
125
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
126
|
+
# and
|
127
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
128
|
+
# @param filter [String] The filter to apply on the operation. For more
|
129
|
+
# information please see
|
130
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
131
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
132
|
+
# will be added to the HTTP request.
|
133
|
+
#
|
134
|
+
# @return [Array<Event>] operation results.
|
135
|
+
#
|
136
|
+
def list_by_single_resource(resource_uri, filter:nil, custom_headers:nil)
|
137
|
+
first_page = list_by_single_resource_as_lazy(resource_uri, filter:filter, custom_headers:custom_headers)
|
138
|
+
first_page.get_all_items
|
139
|
+
end
|
140
|
+
|
141
|
+
#
|
142
|
+
# Lists current service health events for given resource.
|
143
|
+
#
|
144
|
+
# @param resource_uri [String] The fully qualified ID of the resource,
|
145
|
+
# including the resource name and resource type. Currently the API support not
|
146
|
+
# nested and one nesting level resource types :
|
147
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
148
|
+
# and
|
149
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
150
|
+
# @param filter [String] The filter to apply on the operation. For more
|
151
|
+
# information please see
|
152
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
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 list_by_single_resource_with_http_info(resource_uri, filter:nil, custom_headers:nil)
|
159
|
+
list_by_single_resource_async(resource_uri, filter:filter, custom_headers:custom_headers).value!
|
160
|
+
end
|
161
|
+
|
162
|
+
#
|
163
|
+
# Lists current service health events for given resource.
|
164
|
+
#
|
165
|
+
# @param resource_uri [String] The fully qualified ID of the resource,
|
166
|
+
# including the resource name and resource type. Currently the API support not
|
167
|
+
# nested and one nesting level resource types :
|
168
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
169
|
+
# and
|
170
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
171
|
+
# @param filter [String] The filter to apply on the operation. For more
|
172
|
+
# information please see
|
173
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
174
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
175
|
+
# to the HTTP request.
|
176
|
+
#
|
177
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
178
|
+
#
|
179
|
+
def list_by_single_resource_async(resource_uri, filter:nil, custom_headers:nil)
|
180
|
+
fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
|
181
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
182
|
+
|
183
|
+
|
184
|
+
request_headers = {}
|
185
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
186
|
+
|
187
|
+
# Set Headers
|
188
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
189
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
190
|
+
path_template = '{resourceUri}/providers/Microsoft.ResourceHealth/events'
|
191
|
+
|
192
|
+
request_url = @base_url || @client.base_url
|
193
|
+
|
194
|
+
options = {
|
195
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
196
|
+
skip_encoding_path_params: {'resourceUri' => resource_uri},
|
197
|
+
query_params: {'api-version' => @client.api_version,'$filter' => filter,'view' => @client.view},
|
198
|
+
headers: request_headers.merge(custom_headers || {}),
|
199
|
+
base_url: request_url
|
200
|
+
}
|
201
|
+
promise = @client.make_request_async(:get, path_template, options)
|
202
|
+
|
203
|
+
promise = promise.then do |result|
|
204
|
+
http_response = result.response
|
205
|
+
status_code = http_response.status
|
206
|
+
response_content = http_response.body
|
207
|
+
unless status_code == 200
|
208
|
+
error_model = JSON.load(response_content)
|
209
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
210
|
+
end
|
211
|
+
|
212
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
213
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
214
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
215
|
+
# Deserialize Response
|
216
|
+
if status_code == 200
|
217
|
+
begin
|
218
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
219
|
+
result_mapper = Azure::ResourceHealth::Mgmt::V2018_07_01::Models::Events.mapper()
|
220
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
221
|
+
rescue Exception => e
|
222
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
result
|
227
|
+
end
|
228
|
+
|
229
|
+
promise.execute
|
230
|
+
end
|
231
|
+
|
232
|
+
#
|
233
|
+
# Lists current service health events in the subscription.
|
234
|
+
#
|
235
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
236
|
+
# to List operation.
|
237
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
238
|
+
# will be added to the HTTP request.
|
239
|
+
#
|
240
|
+
# @return [Events] operation results.
|
241
|
+
#
|
242
|
+
def list_by_subscription_id_next(next_page_link, custom_headers:nil)
|
243
|
+
response = list_by_subscription_id_next_async(next_page_link, custom_headers:custom_headers).value!
|
244
|
+
response.body unless response.nil?
|
245
|
+
end
|
246
|
+
|
247
|
+
#
|
248
|
+
# Lists current service health events in the subscription.
|
249
|
+
#
|
250
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
251
|
+
# to List operation.
|
252
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
253
|
+
# will be added to the HTTP request.
|
254
|
+
#
|
255
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
256
|
+
#
|
257
|
+
def list_by_subscription_id_next_with_http_info(next_page_link, custom_headers:nil)
|
258
|
+
list_by_subscription_id_next_async(next_page_link, custom_headers:custom_headers).value!
|
259
|
+
end
|
260
|
+
|
261
|
+
#
|
262
|
+
# Lists current service health events in the subscription.
|
263
|
+
#
|
264
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
265
|
+
# to List operation.
|
266
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
267
|
+
# to the HTTP request.
|
268
|
+
#
|
269
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
270
|
+
#
|
271
|
+
def list_by_subscription_id_next_async(next_page_link, custom_headers:nil)
|
272
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
273
|
+
|
274
|
+
|
275
|
+
request_headers = {}
|
276
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
277
|
+
|
278
|
+
# Set Headers
|
279
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
280
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
281
|
+
path_template = '{nextLink}'
|
282
|
+
|
283
|
+
request_url = @base_url || @client.base_url
|
284
|
+
|
285
|
+
options = {
|
286
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
287
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
288
|
+
headers: request_headers.merge(custom_headers || {}),
|
289
|
+
base_url: request_url
|
290
|
+
}
|
291
|
+
promise = @client.make_request_async(:get, path_template, options)
|
292
|
+
|
293
|
+
promise = promise.then do |result|
|
294
|
+
http_response = result.response
|
295
|
+
status_code = http_response.status
|
296
|
+
response_content = http_response.body
|
297
|
+
unless status_code == 200
|
298
|
+
error_model = JSON.load(response_content)
|
299
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
300
|
+
end
|
301
|
+
|
302
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
303
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
304
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
305
|
+
# Deserialize Response
|
306
|
+
if status_code == 200
|
307
|
+
begin
|
308
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
309
|
+
result_mapper = Azure::ResourceHealth::Mgmt::V2018_07_01::Models::Events.mapper()
|
310
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
311
|
+
rescue Exception => e
|
312
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
313
|
+
end
|
314
|
+
end
|
315
|
+
|
316
|
+
result
|
317
|
+
end
|
318
|
+
|
319
|
+
promise.execute
|
320
|
+
end
|
321
|
+
|
322
|
+
#
|
323
|
+
# Lists current service health events for given resource.
|
324
|
+
#
|
325
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
326
|
+
# to List operation.
|
327
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
328
|
+
# will be added to the HTTP request.
|
329
|
+
#
|
330
|
+
# @return [Events] operation results.
|
331
|
+
#
|
332
|
+
def list_by_single_resource_next(next_page_link, custom_headers:nil)
|
333
|
+
response = list_by_single_resource_next_async(next_page_link, custom_headers:custom_headers).value!
|
334
|
+
response.body unless response.nil?
|
335
|
+
end
|
336
|
+
|
337
|
+
#
|
338
|
+
# Lists current service health events for given resource.
|
339
|
+
#
|
340
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
341
|
+
# to List operation.
|
342
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
343
|
+
# will be added to the HTTP request.
|
344
|
+
#
|
345
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
346
|
+
#
|
347
|
+
def list_by_single_resource_next_with_http_info(next_page_link, custom_headers:nil)
|
348
|
+
list_by_single_resource_next_async(next_page_link, custom_headers:custom_headers).value!
|
349
|
+
end
|
350
|
+
|
351
|
+
#
|
352
|
+
# Lists current service health events for given resource.
|
353
|
+
#
|
354
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
355
|
+
# to List operation.
|
356
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
357
|
+
# to the HTTP request.
|
358
|
+
#
|
359
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
360
|
+
#
|
361
|
+
def list_by_single_resource_next_async(next_page_link, custom_headers:nil)
|
362
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
363
|
+
|
364
|
+
|
365
|
+
request_headers = {}
|
366
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
367
|
+
|
368
|
+
# Set Headers
|
369
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
370
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
371
|
+
path_template = '{nextLink}'
|
372
|
+
|
373
|
+
request_url = @base_url || @client.base_url
|
374
|
+
|
375
|
+
options = {
|
376
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
377
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
378
|
+
headers: request_headers.merge(custom_headers || {}),
|
379
|
+
base_url: request_url
|
380
|
+
}
|
381
|
+
promise = @client.make_request_async(:get, path_template, options)
|
382
|
+
|
383
|
+
promise = promise.then do |result|
|
384
|
+
http_response = result.response
|
385
|
+
status_code = http_response.status
|
386
|
+
response_content = http_response.body
|
387
|
+
unless status_code == 200
|
388
|
+
error_model = JSON.load(response_content)
|
389
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
390
|
+
end
|
391
|
+
|
392
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
393
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
394
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
395
|
+
# Deserialize Response
|
396
|
+
if status_code == 200
|
397
|
+
begin
|
398
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
399
|
+
result_mapper = Azure::ResourceHealth::Mgmt::V2018_07_01::Models::Events.mapper()
|
400
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
401
|
+
rescue Exception => e
|
402
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
403
|
+
end
|
404
|
+
end
|
405
|
+
|
406
|
+
result
|
407
|
+
end
|
408
|
+
|
409
|
+
promise.execute
|
410
|
+
end
|
411
|
+
|
412
|
+
#
|
413
|
+
# Lists current service health events in the subscription.
|
414
|
+
#
|
415
|
+
# @param filter [String] The filter to apply on the operation. For more
|
416
|
+
# information please see
|
417
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
418
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
419
|
+
# will be added to the HTTP request.
|
420
|
+
#
|
421
|
+
# @return [Events] which provide lazy access to pages of the response.
|
422
|
+
#
|
423
|
+
def list_by_subscription_id_as_lazy(filter:nil, custom_headers:nil)
|
424
|
+
response = list_by_subscription_id_async(filter:filter, custom_headers:custom_headers).value!
|
425
|
+
unless response.nil?
|
426
|
+
page = response.body
|
427
|
+
page.next_method = Proc.new do |next_page_link|
|
428
|
+
list_by_subscription_id_next_async(next_page_link, custom_headers:custom_headers)
|
429
|
+
end
|
430
|
+
page
|
431
|
+
end
|
432
|
+
end
|
433
|
+
|
434
|
+
#
|
435
|
+
# Lists current service health events for given resource.
|
436
|
+
#
|
437
|
+
# @param resource_uri [String] The fully qualified ID of the resource,
|
438
|
+
# including the resource name and resource type. Currently the API support not
|
439
|
+
# nested and one nesting level resource types :
|
440
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
441
|
+
# and
|
442
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
443
|
+
# @param filter [String] The filter to apply on the operation. For more
|
444
|
+
# information please see
|
445
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
446
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
447
|
+
# will be added to the HTTP request.
|
448
|
+
#
|
449
|
+
# @return [Events] which provide lazy access to pages of the response.
|
450
|
+
#
|
451
|
+
def list_by_single_resource_as_lazy(resource_uri, filter:nil, custom_headers:nil)
|
452
|
+
response = list_by_single_resource_async(resource_uri, filter:filter, custom_headers:custom_headers).value!
|
453
|
+
unless response.nil?
|
454
|
+
page = response.body
|
455
|
+
page.next_method = Proc.new do |next_page_link|
|
456
|
+
list_by_single_resource_next_async(next_page_link, custom_headers:custom_headers)
|
457
|
+
end
|
458
|
+
page
|
459
|
+
end
|
460
|
+
end
|
461
|
+
|
462
|
+
end
|
463
|
+
end
|