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,384 @@
|
|
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::V2017_07_01
|
7
|
+
#
|
8
|
+
# The Resource Health Client.
|
9
|
+
#
|
10
|
+
class ChildAvailabilityStatuses
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the ChildAvailabilityStatuses 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
|
+
# Gets current availability status for a single resource
|
26
|
+
#
|
27
|
+
# @param resource_uri [String] The fully qualified ID of the resource,
|
28
|
+
# including the resource name and resource type. Currently the API only support
|
29
|
+
# one nesting level resource types :
|
30
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
31
|
+
# @param filter [String] The filter to apply on the operation. For more
|
32
|
+
# information please see
|
33
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
34
|
+
# @param expand [String] Setting $expand=recommendedactions in url query
|
35
|
+
# expands the recommendedactions in the response.
|
36
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
37
|
+
# will be added to the HTTP request.
|
38
|
+
#
|
39
|
+
# @return [AvailabilityStatus] operation results.
|
40
|
+
#
|
41
|
+
def get_by_resource(resource_uri, filter:nil, expand:nil, custom_headers:nil)
|
42
|
+
response = get_by_resource_async(resource_uri, filter:filter, expand:expand, custom_headers:custom_headers).value!
|
43
|
+
response.body unless response.nil?
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# Gets current availability status for a single resource
|
48
|
+
#
|
49
|
+
# @param resource_uri [String] The fully qualified ID of the resource,
|
50
|
+
# including the resource name and resource type. Currently the API only support
|
51
|
+
# one nesting level resource types :
|
52
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
53
|
+
# @param filter [String] The filter to apply on the operation. For more
|
54
|
+
# information please see
|
55
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
56
|
+
# @param expand [String] Setting $expand=recommendedactions in url query
|
57
|
+
# expands the recommendedactions in the response.
|
58
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
59
|
+
# will be added to the HTTP request.
|
60
|
+
#
|
61
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
62
|
+
#
|
63
|
+
def get_by_resource_with_http_info(resource_uri, filter:nil, expand:nil, custom_headers:nil)
|
64
|
+
get_by_resource_async(resource_uri, filter:filter, expand:expand, custom_headers:custom_headers).value!
|
65
|
+
end
|
66
|
+
|
67
|
+
#
|
68
|
+
# Gets current availability status for a single resource
|
69
|
+
#
|
70
|
+
# @param resource_uri [String] The fully qualified ID of the resource,
|
71
|
+
# including the resource name and resource type. Currently the API only support
|
72
|
+
# one nesting level resource types :
|
73
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
74
|
+
# @param filter [String] The filter to apply on the operation. For more
|
75
|
+
# information please see
|
76
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
77
|
+
# @param expand [String] Setting $expand=recommendedactions in url query
|
78
|
+
# expands the recommendedactions in the response.
|
79
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
80
|
+
# to the HTTP request.
|
81
|
+
#
|
82
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
83
|
+
#
|
84
|
+
def get_by_resource_async(resource_uri, filter:nil, expand:nil, custom_headers:nil)
|
85
|
+
fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
|
86
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
87
|
+
|
88
|
+
|
89
|
+
request_headers = {}
|
90
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
91
|
+
|
92
|
+
# Set Headers
|
93
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
94
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
95
|
+
path_template = '{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses/current'
|
96
|
+
|
97
|
+
request_url = @base_url || @client.base_url
|
98
|
+
|
99
|
+
options = {
|
100
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
101
|
+
skip_encoding_path_params: {'resourceUri' => resource_uri},
|
102
|
+
query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand},
|
103
|
+
headers: request_headers.merge(custom_headers || {}),
|
104
|
+
base_url: request_url
|
105
|
+
}
|
106
|
+
promise = @client.make_request_async(:get, path_template, options)
|
107
|
+
|
108
|
+
promise = promise.then do |result|
|
109
|
+
http_response = result.response
|
110
|
+
status_code = http_response.status
|
111
|
+
response_content = http_response.body
|
112
|
+
unless status_code == 200
|
113
|
+
error_model = JSON.load(response_content)
|
114
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
115
|
+
end
|
116
|
+
|
117
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
118
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
119
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
120
|
+
# Deserialize Response
|
121
|
+
if status_code == 200
|
122
|
+
begin
|
123
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
124
|
+
result_mapper = Azure::ResourceHealth::Mgmt::V2017_07_01::Models::AvailabilityStatus.mapper()
|
125
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
126
|
+
rescue Exception => e
|
127
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
result
|
132
|
+
end
|
133
|
+
|
134
|
+
promise.execute
|
135
|
+
end
|
136
|
+
|
137
|
+
#
|
138
|
+
# Lists the historical availability statuses for a single child resource. Use
|
139
|
+
# the nextLink property in the response to get the next page of availability
|
140
|
+
# status
|
141
|
+
#
|
142
|
+
# @param resource_uri [String] The fully qualified ID of the resource,
|
143
|
+
# including the resource name and resource type. Currently the API only support
|
144
|
+
# one nesting level resource types :
|
145
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
146
|
+
# @param filter [String] The filter to apply on the operation. For more
|
147
|
+
# information please see
|
148
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
149
|
+
# @param expand [String] Setting $expand=recommendedactions in url query
|
150
|
+
# expands the recommendedactions in the response.
|
151
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
152
|
+
# will be added to the HTTP request.
|
153
|
+
#
|
154
|
+
# @return [Array<AvailabilityStatus>] operation results.
|
155
|
+
#
|
156
|
+
def list(resource_uri, filter:nil, expand:nil, custom_headers:nil)
|
157
|
+
first_page = list_as_lazy(resource_uri, filter:filter, expand:expand, custom_headers:custom_headers)
|
158
|
+
first_page.get_all_items
|
159
|
+
end
|
160
|
+
|
161
|
+
#
|
162
|
+
# Lists the historical availability statuses for a single child resource. Use
|
163
|
+
# the nextLink property in the response to get the next page of availability
|
164
|
+
# status
|
165
|
+
#
|
166
|
+
# @param resource_uri [String] The fully qualified ID of the resource,
|
167
|
+
# including the resource name and resource type. Currently the API only support
|
168
|
+
# one nesting level resource types :
|
169
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
170
|
+
# @param filter [String] The filter to apply on the operation. For more
|
171
|
+
# information please see
|
172
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
173
|
+
# @param expand [String] Setting $expand=recommendedactions in url query
|
174
|
+
# expands the recommendedactions in the response.
|
175
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
176
|
+
# will be added to the HTTP request.
|
177
|
+
#
|
178
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
179
|
+
#
|
180
|
+
def list_with_http_info(resource_uri, filter:nil, expand:nil, custom_headers:nil)
|
181
|
+
list_async(resource_uri, filter:filter, expand:expand, custom_headers:custom_headers).value!
|
182
|
+
end
|
183
|
+
|
184
|
+
#
|
185
|
+
# Lists the historical availability statuses for a single child resource. Use
|
186
|
+
# the nextLink property in the response to get the next page of availability
|
187
|
+
# status
|
188
|
+
#
|
189
|
+
# @param resource_uri [String] The fully qualified ID of the resource,
|
190
|
+
# including the resource name and resource type. Currently the API only support
|
191
|
+
# one nesting level resource types :
|
192
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
193
|
+
# @param filter [String] The filter to apply on the operation. For more
|
194
|
+
# information please see
|
195
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
196
|
+
# @param expand [String] Setting $expand=recommendedactions in url query
|
197
|
+
# expands the recommendedactions in the response.
|
198
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
199
|
+
# to the HTTP request.
|
200
|
+
#
|
201
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
202
|
+
#
|
203
|
+
def list_async(resource_uri, filter:nil, expand:nil, custom_headers:nil)
|
204
|
+
fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
|
205
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
206
|
+
|
207
|
+
|
208
|
+
request_headers = {}
|
209
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
210
|
+
|
211
|
+
# Set Headers
|
212
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
213
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
214
|
+
path_template = '{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses'
|
215
|
+
|
216
|
+
request_url = @base_url || @client.base_url
|
217
|
+
|
218
|
+
options = {
|
219
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
220
|
+
skip_encoding_path_params: {'resourceUri' => resource_uri},
|
221
|
+
query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand},
|
222
|
+
headers: request_headers.merge(custom_headers || {}),
|
223
|
+
base_url: request_url
|
224
|
+
}
|
225
|
+
promise = @client.make_request_async(:get, path_template, options)
|
226
|
+
|
227
|
+
promise = promise.then do |result|
|
228
|
+
http_response = result.response
|
229
|
+
status_code = http_response.status
|
230
|
+
response_content = http_response.body
|
231
|
+
unless status_code == 200
|
232
|
+
error_model = JSON.load(response_content)
|
233
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
234
|
+
end
|
235
|
+
|
236
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
237
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
238
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
239
|
+
# Deserialize Response
|
240
|
+
if status_code == 200
|
241
|
+
begin
|
242
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
243
|
+
result_mapper = Azure::ResourceHealth::Mgmt::V2017_07_01::Models::AvailabilityStatusListResult.mapper()
|
244
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
245
|
+
rescue Exception => e
|
246
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
result
|
251
|
+
end
|
252
|
+
|
253
|
+
promise.execute
|
254
|
+
end
|
255
|
+
|
256
|
+
#
|
257
|
+
# Lists the historical availability statuses for a single child resource. Use
|
258
|
+
# the nextLink property in the response to get the next page of availability
|
259
|
+
# status
|
260
|
+
#
|
261
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
262
|
+
# to List operation.
|
263
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
264
|
+
# will be added to the HTTP request.
|
265
|
+
#
|
266
|
+
# @return [AvailabilityStatusListResult] operation results.
|
267
|
+
#
|
268
|
+
def list_next(next_page_link, custom_headers:nil)
|
269
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
270
|
+
response.body unless response.nil?
|
271
|
+
end
|
272
|
+
|
273
|
+
#
|
274
|
+
# Lists the historical availability statuses for a single child resource. Use
|
275
|
+
# the nextLink property in the response to get the next page of availability
|
276
|
+
# status
|
277
|
+
#
|
278
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
279
|
+
# to List operation.
|
280
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
281
|
+
# will be added to the HTTP request.
|
282
|
+
#
|
283
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
284
|
+
#
|
285
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
286
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
287
|
+
end
|
288
|
+
|
289
|
+
#
|
290
|
+
# Lists the historical availability statuses for a single child resource. Use
|
291
|
+
# the nextLink property in the response to get the next page of availability
|
292
|
+
# status
|
293
|
+
#
|
294
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
295
|
+
# to List operation.
|
296
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
297
|
+
# to the HTTP request.
|
298
|
+
#
|
299
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
300
|
+
#
|
301
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
302
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
303
|
+
|
304
|
+
|
305
|
+
request_headers = {}
|
306
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
307
|
+
|
308
|
+
# Set Headers
|
309
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
310
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
311
|
+
path_template = '{nextLink}'
|
312
|
+
|
313
|
+
request_url = @base_url || @client.base_url
|
314
|
+
|
315
|
+
options = {
|
316
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
317
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
318
|
+
headers: request_headers.merge(custom_headers || {}),
|
319
|
+
base_url: request_url
|
320
|
+
}
|
321
|
+
promise = @client.make_request_async(:get, path_template, options)
|
322
|
+
|
323
|
+
promise = promise.then do |result|
|
324
|
+
http_response = result.response
|
325
|
+
status_code = http_response.status
|
326
|
+
response_content = http_response.body
|
327
|
+
unless status_code == 200
|
328
|
+
error_model = JSON.load(response_content)
|
329
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
330
|
+
end
|
331
|
+
|
332
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
333
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
334
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
335
|
+
# Deserialize Response
|
336
|
+
if status_code == 200
|
337
|
+
begin
|
338
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
339
|
+
result_mapper = Azure::ResourceHealth::Mgmt::V2017_07_01::Models::AvailabilityStatusListResult.mapper()
|
340
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
341
|
+
rescue Exception => e
|
342
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
343
|
+
end
|
344
|
+
end
|
345
|
+
|
346
|
+
result
|
347
|
+
end
|
348
|
+
|
349
|
+
promise.execute
|
350
|
+
end
|
351
|
+
|
352
|
+
#
|
353
|
+
# Lists the historical availability statuses for a single child resource. Use
|
354
|
+
# the nextLink property in the response to get the next page of availability
|
355
|
+
# status
|
356
|
+
#
|
357
|
+
# @param resource_uri [String] The fully qualified ID of the resource,
|
358
|
+
# including the resource name and resource type. Currently the API only support
|
359
|
+
# one nesting level resource types :
|
360
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
361
|
+
# @param filter [String] The filter to apply on the operation. For more
|
362
|
+
# information please see
|
363
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
364
|
+
# @param expand [String] Setting $expand=recommendedactions in url query
|
365
|
+
# expands the recommendedactions in the response.
|
366
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
367
|
+
# will be added to the HTTP request.
|
368
|
+
#
|
369
|
+
# @return [AvailabilityStatusListResult] which provide lazy access to pages of
|
370
|
+
# the response.
|
371
|
+
#
|
372
|
+
def list_as_lazy(resource_uri, filter:nil, expand:nil, custom_headers:nil)
|
373
|
+
response = list_async(resource_uri, filter:filter, expand:expand, custom_headers:custom_headers).value!
|
374
|
+
unless response.nil?
|
375
|
+
page = response.body
|
376
|
+
page.next_method = Proc.new do |next_page_link|
|
377
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
378
|
+
end
|
379
|
+
page
|
380
|
+
end
|
381
|
+
end
|
382
|
+
|
383
|
+
end
|
384
|
+
end
|
@@ -0,0 +1,271 @@
|
|
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::V2017_07_01
|
7
|
+
#
|
8
|
+
# The Resource Health Client.
|
9
|
+
#
|
10
|
+
class ChildResources
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the ChildResources 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 the all the children and its current health status for a parent
|
26
|
+
# resource. Use the nextLink property in the response to get the next page of
|
27
|
+
# children current health
|
28
|
+
#
|
29
|
+
# @param resource_uri [String] The fully qualified ID of the resource,
|
30
|
+
# including the resource name and resource type. Currently the API only support
|
31
|
+
# not nested parent resource type:
|
32
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
33
|
+
# @param filter [String] The filter to apply on the operation. For more
|
34
|
+
# information please see
|
35
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
36
|
+
# @param expand [String] Setting $expand=recommendedactions in url query
|
37
|
+
# expands the recommendedactions in the response.
|
38
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
39
|
+
# will be added to the HTTP request.
|
40
|
+
#
|
41
|
+
# @return [Array<AvailabilityStatus>] operation results.
|
42
|
+
#
|
43
|
+
def list(resource_uri, filter:nil, expand:nil, custom_headers:nil)
|
44
|
+
first_page = list_as_lazy(resource_uri, filter:filter, expand:expand, custom_headers:custom_headers)
|
45
|
+
first_page.get_all_items
|
46
|
+
end
|
47
|
+
|
48
|
+
#
|
49
|
+
# Lists the all the children and its current health status for a parent
|
50
|
+
# resource. Use the nextLink property in the response to get the next page of
|
51
|
+
# children current health
|
52
|
+
#
|
53
|
+
# @param resource_uri [String] The fully qualified ID of the resource,
|
54
|
+
# including the resource name and resource type. Currently the API only support
|
55
|
+
# not nested parent resource type:
|
56
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
57
|
+
# @param filter [String] The filter to apply on the operation. For more
|
58
|
+
# information please see
|
59
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
60
|
+
# @param expand [String] Setting $expand=recommendedactions in url query
|
61
|
+
# expands the recommendedactions in the response.
|
62
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
63
|
+
# will be added to the HTTP request.
|
64
|
+
#
|
65
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
66
|
+
#
|
67
|
+
def list_with_http_info(resource_uri, filter:nil, expand:nil, custom_headers:nil)
|
68
|
+
list_async(resource_uri, filter:filter, expand:expand, custom_headers:custom_headers).value!
|
69
|
+
end
|
70
|
+
|
71
|
+
#
|
72
|
+
# Lists the all the children and its current health status for a parent
|
73
|
+
# resource. Use the nextLink property in the response to get the next page of
|
74
|
+
# children current health
|
75
|
+
#
|
76
|
+
# @param resource_uri [String] The fully qualified ID of the resource,
|
77
|
+
# including the resource name and resource type. Currently the API only support
|
78
|
+
# not nested parent resource type:
|
79
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
80
|
+
# @param filter [String] The filter to apply on the operation. For more
|
81
|
+
# information please see
|
82
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
83
|
+
# @param expand [String] Setting $expand=recommendedactions in url query
|
84
|
+
# expands the recommendedactions in the response.
|
85
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
86
|
+
# to the HTTP request.
|
87
|
+
#
|
88
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
89
|
+
#
|
90
|
+
def list_async(resource_uri, filter:nil, expand:nil, custom_headers:nil)
|
91
|
+
fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
|
92
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
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
|
+
path_template = '{resourceUri}/providers/Microsoft.ResourceHealth/childResources'
|
102
|
+
|
103
|
+
request_url = @base_url || @client.base_url
|
104
|
+
|
105
|
+
options = {
|
106
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
107
|
+
skip_encoding_path_params: {'resourceUri' => resource_uri},
|
108
|
+
query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand},
|
109
|
+
headers: request_headers.merge(custom_headers || {}),
|
110
|
+
base_url: request_url
|
111
|
+
}
|
112
|
+
promise = @client.make_request_async(:get, path_template, options)
|
113
|
+
|
114
|
+
promise = promise.then do |result|
|
115
|
+
http_response = result.response
|
116
|
+
status_code = http_response.status
|
117
|
+
response_content = http_response.body
|
118
|
+
unless status_code == 200
|
119
|
+
error_model = JSON.load(response_content)
|
120
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
121
|
+
end
|
122
|
+
|
123
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
124
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
125
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
126
|
+
# Deserialize Response
|
127
|
+
if status_code == 200
|
128
|
+
begin
|
129
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
130
|
+
result_mapper = Azure::ResourceHealth::Mgmt::V2017_07_01::Models::AvailabilityStatusListResult.mapper()
|
131
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
132
|
+
rescue Exception => e
|
133
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
result
|
138
|
+
end
|
139
|
+
|
140
|
+
promise.execute
|
141
|
+
end
|
142
|
+
|
143
|
+
#
|
144
|
+
# Lists the all the children and its current health status for a parent
|
145
|
+
# resource. Use the nextLink property in the response to get the next page of
|
146
|
+
# children current health
|
147
|
+
#
|
148
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
149
|
+
# to List operation.
|
150
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
151
|
+
# will be added to the HTTP request.
|
152
|
+
#
|
153
|
+
# @return [AvailabilityStatusListResult] operation results.
|
154
|
+
#
|
155
|
+
def list_next(next_page_link, custom_headers:nil)
|
156
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
157
|
+
response.body unless response.nil?
|
158
|
+
end
|
159
|
+
|
160
|
+
#
|
161
|
+
# Lists the all the children and its current health status for a parent
|
162
|
+
# resource. Use the nextLink property in the response to get the next page of
|
163
|
+
# children current health
|
164
|
+
#
|
165
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
166
|
+
# to List operation.
|
167
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
168
|
+
# will be added to the HTTP request.
|
169
|
+
#
|
170
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
171
|
+
#
|
172
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
173
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
174
|
+
end
|
175
|
+
|
176
|
+
#
|
177
|
+
# Lists the all the children and its current health status for a parent
|
178
|
+
# resource. Use the nextLink property in the response to get the next page of
|
179
|
+
# children current health
|
180
|
+
#
|
181
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
182
|
+
# to List operation.
|
183
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
184
|
+
# to the HTTP request.
|
185
|
+
#
|
186
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
187
|
+
#
|
188
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
189
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
190
|
+
|
191
|
+
|
192
|
+
request_headers = {}
|
193
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
194
|
+
|
195
|
+
# Set Headers
|
196
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
197
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
198
|
+
path_template = '{nextLink}'
|
199
|
+
|
200
|
+
request_url = @base_url || @client.base_url
|
201
|
+
|
202
|
+
options = {
|
203
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
204
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
205
|
+
headers: request_headers.merge(custom_headers || {}),
|
206
|
+
base_url: request_url
|
207
|
+
}
|
208
|
+
promise = @client.make_request_async(:get, path_template, options)
|
209
|
+
|
210
|
+
promise = promise.then do |result|
|
211
|
+
http_response = result.response
|
212
|
+
status_code = http_response.status
|
213
|
+
response_content = http_response.body
|
214
|
+
unless status_code == 200
|
215
|
+
error_model = JSON.load(response_content)
|
216
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
217
|
+
end
|
218
|
+
|
219
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
220
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
221
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
222
|
+
# Deserialize Response
|
223
|
+
if status_code == 200
|
224
|
+
begin
|
225
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
226
|
+
result_mapper = Azure::ResourceHealth::Mgmt::V2017_07_01::Models::AvailabilityStatusListResult.mapper()
|
227
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
228
|
+
rescue Exception => e
|
229
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
result
|
234
|
+
end
|
235
|
+
|
236
|
+
promise.execute
|
237
|
+
end
|
238
|
+
|
239
|
+
#
|
240
|
+
# Lists the all the children and its current health status for a parent
|
241
|
+
# resource. Use the nextLink property in the response to get the next page of
|
242
|
+
# children current health
|
243
|
+
#
|
244
|
+
# @param resource_uri [String] The fully qualified ID of the resource,
|
245
|
+
# including the resource name and resource type. Currently the API only support
|
246
|
+
# not nested parent resource type:
|
247
|
+
# /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
248
|
+
# @param filter [String] The filter to apply on the operation. For more
|
249
|
+
# information please see
|
250
|
+
# https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
|
251
|
+
# @param expand [String] Setting $expand=recommendedactions in url query
|
252
|
+
# expands the recommendedactions in the response.
|
253
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
254
|
+
# will be added to the HTTP request.
|
255
|
+
#
|
256
|
+
# @return [AvailabilityStatusListResult] which provide lazy access to pages of
|
257
|
+
# the response.
|
258
|
+
#
|
259
|
+
def list_as_lazy(resource_uri, filter:nil, expand:nil, custom_headers:nil)
|
260
|
+
response = list_async(resource_uri, filter:filter, expand:expand, custom_headers:custom_headers).value!
|
261
|
+
unless response.nil?
|
262
|
+
page = response.body
|
263
|
+
page.next_method = Proc.new do |next_page_link|
|
264
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
265
|
+
end
|
266
|
+
page
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
end
|
271
|
+
end
|