azure_mgmt_resource_health 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2015-01-01/generated/azure_mgmt_resource_health.rb +45 -0
  4. data/lib/2015-01-01/generated/azure_mgmt_resource_health/availability_statuses.rb +856 -0
  5. data/lib/2015-01-01/generated/azure_mgmt_resource_health/child_availability_statuses.rb +384 -0
  6. data/lib/2015-01-01/generated/azure_mgmt_resource_health/child_resources.rb +271 -0
  7. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/availability_state_values.rb +17 -0
  8. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/availability_status.rb +93 -0
  9. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/availability_status_list_result.rb +100 -0
  10. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/availability_status_properties.rb +212 -0
  11. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/availability_status_properties_recently_resolved_state.rb +73 -0
  12. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/error_response.rb +71 -0
  13. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/operation.rb +58 -0
  14. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/operation_display.rb +79 -0
  15. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/operation_list_result.rb +56 -0
  16. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/reason_chronicity_types.rb +16 -0
  17. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/recommended_action.rb +70 -0
  18. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/service_impacting_event.rb +95 -0
  19. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/service_impacting_event_incident_properties.rb +79 -0
  20. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/service_impacting_event_status.rb +46 -0
  21. data/lib/2015-01-01/generated/azure_mgmt_resource_health/module_definition.rb +9 -0
  22. data/lib/2015-01-01/generated/azure_mgmt_resource_health/operations.rb +109 -0
  23. data/lib/2015-01-01/generated/azure_mgmt_resource_health/resource_health_client.rb +145 -0
  24. data/lib/2017-07-01/generated/azure_mgmt_resource_health.rb +45 -0
  25. data/lib/2017-07-01/generated/azure_mgmt_resource_health/availability_statuses.rb +863 -0
  26. data/lib/2017-07-01/generated/azure_mgmt_resource_health/child_availability_statuses.rb +384 -0
  27. data/lib/2017-07-01/generated/azure_mgmt_resource_health/child_resources.rb +271 -0
  28. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/availability_state_values.rb +17 -0
  29. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/availability_status.rb +93 -0
  30. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/availability_status_list_result.rb +100 -0
  31. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/availability_status_properties.rb +253 -0
  32. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/availability_status_properties_recently_resolved_state.rb +73 -0
  33. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/error_response.rb +71 -0
  34. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/operation.rb +58 -0
  35. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/operation_display.rb +79 -0
  36. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/operation_list_result.rb +56 -0
  37. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/reason_chronicity_types.rb +16 -0
  38. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/recommended_action.rb +70 -0
  39. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event.rb +95 -0
  40. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event_incident_properties.rb +79 -0
  41. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event_status.rb +46 -0
  42. data/lib/2017-07-01/generated/azure_mgmt_resource_health/module_definition.rb +9 -0
  43. data/lib/2017-07-01/generated/azure_mgmt_resource_health/operations.rb +109 -0
  44. data/lib/2017-07-01/generated/azure_mgmt_resource_health/resource_health_client.rb +145 -0
  45. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health.rb +74 -0
  46. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/availability_statuses.rb +842 -0
  47. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/events_operations.rb +463 -0
  48. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/impacted_resources.rb +240 -0
  49. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/metadata.rb +318 -0
  50. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/availability_state_values.rb +18 -0
  51. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/availability_status.rb +93 -0
  52. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/availability_status_list_result.rb +100 -0
  53. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/availability_status_properties.rb +251 -0
  54. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/availability_status_properties_recently_resolved.rb +73 -0
  55. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/azure_entity_resource.rb +75 -0
  56. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/error_response.rb +71 -0
  57. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event.rb +336 -0
  58. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_level_values.rb +17 -0
  59. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_properties_article.rb +46 -0
  60. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_properties_recommended_actions.rb +79 -0
  61. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_properties_recommended_actions_actions_item.rb +59 -0
  62. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_source_values.rb +16 -0
  63. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_status_values.rb +16 -0
  64. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_type_values.rb +18 -0
  65. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/events.rb +99 -0
  66. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/faq.rb +68 -0
  67. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/impact.rb +67 -0
  68. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/impacted_resource_list_result.rb +100 -0
  69. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/impacted_resource_status.rb +123 -0
  70. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/impacted_service_region.rb +110 -0
  71. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/level_values.rb +16 -0
  72. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/link.rb +95 -0
  73. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/link_display_text.rb +57 -0
  74. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/link_type_values.rb +16 -0
  75. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/metadata_entity.rb +134 -0
  76. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/metadata_entity_list_result.rb +98 -0
  77. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/metadata_supported_value_detail.rb +57 -0
  78. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/operation.rb +58 -0
  79. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/operation_display.rb +79 -0
  80. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/operation_list_result.rb +56 -0
  81. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/proxy_resource.rb +63 -0
  82. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/reason_chronicity_types.rb +16 -0
  83. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/reason_type_values.rb +17 -0
  84. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/recommended_action.rb +70 -0
  85. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/resource.rb +83 -0
  86. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/scenario.rb +15 -0
  87. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/service_impacting_event.rb +95 -0
  88. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/service_impacting_event_incident_properties.rb +79 -0
  89. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/service_impacting_event_status.rb +46 -0
  90. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/tracked_resource.rb +92 -0
  91. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/update.rb +59 -0
  92. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/module_definition.rb +9 -0
  93. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/operations.rb +109 -0
  94. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/resource_health_client.rb +152 -0
  95. data/lib/2018-07-01/generated/azure_mgmt_resource_health.rb +69 -0
  96. data/lib/2018-07-01/generated/azure_mgmt_resource_health/availability_statuses.rb +842 -0
  97. data/lib/2018-07-01/generated/azure_mgmt_resource_health/events_operations.rb +463 -0
  98. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/availability_state_values.rb +18 -0
  99. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/availability_status.rb +93 -0
  100. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/availability_status_list_result.rb +100 -0
  101. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/availability_status_properties.rb +251 -0
  102. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/availability_status_properties_recently_resolved.rb +73 -0
  103. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/azure_entity_resource.rb +75 -0
  104. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/error_response.rb +71 -0
  105. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event.rb +336 -0
  106. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_level_values.rb +17 -0
  107. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_properties_article.rb +46 -0
  108. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_properties_recommended_actions.rb +79 -0
  109. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_properties_recommended_actions_actions_item.rb +59 -0
  110. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_source_values.rb +16 -0
  111. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_status_values.rb +16 -0
  112. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_type_values.rb +18 -0
  113. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/events.rb +99 -0
  114. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/faq.rb +68 -0
  115. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/impact.rb +67 -0
  116. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/impacted_service_region.rb +110 -0
  117. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/level_values.rb +16 -0
  118. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/link.rb +95 -0
  119. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/link_display_text.rb +57 -0
  120. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/link_type_values.rb +16 -0
  121. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/metadata_entity.rb +134 -0
  122. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/metadata_entity_list_result.rb +66 -0
  123. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/metadata_supported_value_detail.rb +57 -0
  124. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/operation.rb +58 -0
  125. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/operation_display.rb +79 -0
  126. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/operation_list_result.rb +56 -0
  127. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/proxy_resource.rb +63 -0
  128. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/reason_chronicity_types.rb +16 -0
  129. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/recommended_action.rb +70 -0
  130. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/resource.rb +83 -0
  131. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/scenario.rb +15 -0
  132. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event.rb +95 -0
  133. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event_incident_properties.rb +79 -0
  134. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event_status.rb +46 -0
  135. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/tracked_resource.rb +92 -0
  136. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/update.rb +59 -0
  137. data/lib/2018-07-01/generated/azure_mgmt_resource_health/module_definition.rb +9 -0
  138. data/lib/2018-07-01/generated/azure_mgmt_resource_health/operations.rb +109 -0
  139. data/lib/2018-07-01/generated/azure_mgmt_resource_health/resource_health_client.rb +147 -0
  140. data/lib/azure_mgmt_resource_health.rb +9 -0
  141. data/lib/module_definition.rb +7 -0
  142. data/lib/profiles/latest/modules/resourcehealth_profile_module.rb +123 -0
  143. data/lib/profiles/latest/resourcehealth_latest_profile_client.rb +40 -0
  144. data/lib/profiles/latest/resourcehealth_module_definition.rb +8 -0
  145. data/lib/version.rb +7 -0
  146. 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::V2015_01_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::V2015_01_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::V2015_01_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::V2015_01_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::V2015_01_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::V2015_01_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::V2015_01_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