azure_mgmt_monitor 0.17.6 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-04-01/generated/azure_mgmt_monitor.rb +11 -8
  3. data/lib/2015-04-01/generated/azure_mgmt_monitor/activity_logs.rb +24 -19
  4. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/metric_trigger.rb +35 -1
  5. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/recurrence.rb +9 -9
  6. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/recurrence_frequency.rb +22 -0
  7. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/recurrent_schedule.rb +1 -1
  8. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/scale_rule_metric_dimension.rb +80 -0
  9. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/scale_rule_metric_dimension_operation_type.rb +16 -0
  10. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/time_aggregation_type.rb +1 -0
  11. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/time_window.rb +1 -1
  12. data/lib/2015-04-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  13. data/lib/2015-05-01/generated/azure_mgmt_monitor/application_insights_management_client.rb +1 -1
  14. data/lib/2016-03-01/generated/azure_mgmt_monitor.rb +14 -14
  15. data/lib/2016-03-01/generated/azure_mgmt_monitor/alert_rules.rb +21 -21
  16. data/lib/2016-03-01/generated/azure_mgmt_monitor/monitor_management_client.rb +5 -5
  17. data/lib/2016-09-01/generated/azure_mgmt_monitor/monitor_client.rb +1 -1
  18. data/lib/2017-04-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  19. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor.rb +16 -11
  20. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/diagnostic_settings_resource.rb +19 -5
  21. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/response.rb +1 -1
  22. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/subscription_diagnostic_settings_resource.rb +150 -0
  23. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/subscription_diagnostic_settings_resource_collection.rb +57 -0
  24. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/subscription_log_settings.rb +59 -0
  25. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/subscription_proxy_only_resource.rb +82 -0
  26. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +10 -5
  27. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/subscription_diagnostic_settings_operations.rb +405 -0
  28. data/lib/2017-10-01-preview/generated/azure_mgmt_monitor/application_insights_management_client.rb +1 -1
  29. data/lib/2017-11-01-preview/generated/azure_mgmt_monitor/models/baseline_response.rb +1 -1
  30. data/lib/2017-11-01-preview/generated/azure_mgmt_monitor/models/calculate_baseline_response.rb +1 -1
  31. data/lib/2017-11-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  32. data/lib/2017-12-01-preview/generated/azure_mgmt_monitor/metric_namespaces.rb +1 -1
  33. data/lib/2017-12-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  34. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/metric.rb +2 -1
  35. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/metric_definition.rb +3 -2
  36. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/metric_value.rb +3 -4
  37. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/response.rb +1 -1
  38. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/unit.rb +4 -0
  39. data/lib/2018-01-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  40. data/lib/2018-03-01/generated/azure_mgmt_monitor.rb +25 -17
  41. data/lib/2018-03-01/generated/azure_mgmt_monitor/metric_alerts.rb +10 -10
  42. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/dynamic_metric_criteria.rb +175 -0
  43. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/dynamic_threshold_failing_periods.rb +61 -0
  44. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/dynamic_threshold_operator.rb +17 -0
  45. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/dynamic_threshold_sensitivity.rb +17 -0
  46. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_action.rb +3 -3
  47. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_criteria.rb +2 -0
  48. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_multiple_resource_multiple_metric_criteria.rb +90 -0
  49. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_resource.rb +27 -1
  50. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_resource_patch.rb +27 -1
  51. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_criteria.rb +56 -31
  52. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_dimension.rb +2 -1
  53. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/multi_metric_criteria.rb +142 -0
  54. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/operator.rb +20 -0
  55. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/webtest_location_availability_criteria.rb +98 -0
  56. data/lib/2018-03-01/generated/azure_mgmt_monitor/monitor_management_client.rb +5 -5
  57. data/lib/2018-04-16/generated/azure_mgmt_monitor.rb +8 -5
  58. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/action.rb +1 -0
  59. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/alerting_action.rb +2 -2
  60. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/az_ns_action_group.rb +1 -1
  61. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/criteria.rb +66 -0
  62. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/dimension.rb +79 -0
  63. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/log_search_rule_resource.rb +4 -3
  64. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/log_to_metric_action.rb +71 -0
  65. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/source.rb +3 -2
  66. data/lib/2018-04-16/generated/azure_mgmt_monitor/monitor_client.rb +1 -1
  67. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  68. data/lib/2018-06-17-preview/generated/azure_mgmt_monitor/application_insights_management_client.rb +1 -1
  69. data/lib/2018-09-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  70. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  71. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/vminsights.rb +1 -1
  72. data/lib/2019-03-01/generated/azure_mgmt_monitor.rb +18 -9
  73. data/lib/2019-03-01/generated/azure_mgmt_monitor/action_groups.rb +1 -1
  74. data/lib/2019-03-01/generated/azure_mgmt_monitor/baselines.rb +186 -0
  75. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/baseline_metadata.rb +57 -0
  76. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/baseline_sensitivity.rb +17 -0
  77. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/metric_baselines_response.rb +55 -0
  78. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/metric_single_dimension.rb +57 -0
  79. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/result_type.rb +16 -0
  80. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/single_baseline.rb +85 -0
  81. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/single_metric_baseline.rb +129 -0
  82. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/time_series_baseline.rb +127 -0
  83. data/lib/2019-03-01/generated/azure_mgmt_monitor/monitor_management_client.rb +5 -1
  84. data/lib/2019-06-01/generated/azure_mgmt_monitor.rb +45 -0
  85. data/lib/2019-06-01/generated/azure_mgmt_monitor/action_groups.rb +707 -0
  86. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/action_group_list.rb +67 -0
  87. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/action_group_patch_body.rb +68 -0
  88. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/action_group_resource.rb +326 -0
  89. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/arm_role_receiver.rb +69 -0
  90. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/automation_runbook_receiver.rb +113 -0
  91. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/azure_app_push_receiver.rb +58 -0
  92. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/azure_function_receiver.rb +91 -0
  93. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/email_receiver.rb +83 -0
  94. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/enable_request.rb +46 -0
  95. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/error_response.rb +57 -0
  96. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/itsm_receiver.rb +94 -0
  97. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/logic_app_receiver.rb +80 -0
  98. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/receiver_status.rb +17 -0
  99. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/resource.rb +110 -0
  100. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/sms_receiver.rb +83 -0
  101. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/voice_receiver.rb +69 -0
  102. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/webhook_receiver.rb +115 -0
  103. data/lib/2019-06-01/generated/azure_mgmt_monitor/module_definition.rb +9 -0
  104. data/lib/2019-06-01/generated/azure_mgmt_monitor/monitor_management_client.rb +131 -0
  105. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor.rb +49 -0
  106. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/azure_monitor_private_link_scope.rb +123 -0
  107. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/azure_monitor_private_link_scope_list_result.rb +102 -0
  108. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/error_additional_info.rb +59 -0
  109. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/error_response.rb +57 -0
  110. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/error_response_common.rb +93 -0
  111. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/operation_status.rb +102 -0
  112. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/private_endpoint_connection.rb +100 -0
  113. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/private_endpoint_connection_list_result.rb +100 -0
  114. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/private_endpoint_property.rb +46 -0
  115. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/private_link_resource.rb +95 -0
  116. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/private_link_resource_list_result.rb +100 -0
  117. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/private_link_scopes_resource.rb +101 -0
  118. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/private_link_service_connection_state_property.rb +71 -0
  119. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/proxy_resource.rb +71 -0
  120. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/scoped_resource.rb +85 -0
  121. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/scoped_resource_list_result.rb +100 -0
  122. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/tags_resource.rb +55 -0
  123. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/module_definition.rb +9 -0
  124. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +148 -0
  125. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/private_endpoint_connections.rb +641 -0
  126. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/private_link_resources.rb +346 -0
  127. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/private_link_scope_operation_status.rb +122 -0
  128. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/private_link_scoped_resources.rb +638 -0
  129. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/private_link_scopes.rb +889 -0
  130. data/lib/azure_mgmt_monitor.rb +13 -11
  131. data/lib/profiles/latest/modules/monitor_profile_module.rb +322 -132
  132. data/lib/profiles/v2019_03_01_hybrid/modules/monitor_profile_module.rb +65 -35
  133. data/lib/version.rb +1 -1
  134. metadata +77 -3
@@ -0,0 +1,346 @@
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::Monitor::Mgmt::V2019_10_17_preview
7
+ #
8
+ # Monitor Management Client
9
+ #
10
+ class PrivateLinkResources
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the PrivateLinkResources class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [MonitorManagementClient] reference to the MonitorManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets the private link resources that need to be created for a Azure Monitor
26
+ # PrivateLinkScope.
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group.
29
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
30
+ # resource.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Array<PrivateLinkResource>] operation results.
35
+ #
36
+ def list_by_private_link_scope(resource_group_name, scope_name, custom_headers:nil)
37
+ first_page = list_by_private_link_scope_as_lazy(resource_group_name, scope_name, custom_headers:custom_headers)
38
+ first_page.get_all_items
39
+ end
40
+
41
+ #
42
+ # Gets the private link resources that need to be created for a Azure Monitor
43
+ # PrivateLinkScope.
44
+ #
45
+ # @param resource_group_name [String] The name of the resource group.
46
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
47
+ # resource.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def list_by_private_link_scope_with_http_info(resource_group_name, scope_name, custom_headers:nil)
54
+ list_by_private_link_scope_async(resource_group_name, scope_name, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Gets the private link resources that need to be created for a Azure Monitor
59
+ # PrivateLinkScope.
60
+ #
61
+ # @param resource_group_name [String] The name of the resource group.
62
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
63
+ # resource.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def list_by_private_link_scope_async(resource_group_name, scope_name, custom_headers:nil)
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
72
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
73
+ fail ArgumentError, 'scope_name is nil' if scope_name.nil?
74
+
75
+
76
+ request_headers = {}
77
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
78
+
79
+ # Set Headers
80
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
81
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
82
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateLinkResources'
83
+
84
+ request_url = @base_url || @client.base_url
85
+
86
+ options = {
87
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
88
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'scopeName' => scope_name},
89
+ query_params: {'api-version' => @client.api_version},
90
+ headers: request_headers.merge(custom_headers || {}),
91
+ base_url: request_url
92
+ }
93
+ promise = @client.make_request_async(:get, path_template, options)
94
+
95
+ promise = promise.then do |result|
96
+ http_response = result.response
97
+ status_code = http_response.status
98
+ response_content = http_response.body
99
+ unless status_code == 200
100
+ error_model = JSON.load(response_content)
101
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
102
+ end
103
+
104
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
105
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
106
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
107
+ # Deserialize Response
108
+ if status_code == 200
109
+ begin
110
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
111
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::PrivateLinkResourceListResult.mapper()
112
+ result.body = @client.deserialize(result_mapper, parsed_response)
113
+ rescue Exception => e
114
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
115
+ end
116
+ end
117
+
118
+ result
119
+ end
120
+
121
+ promise.execute
122
+ end
123
+
124
+ #
125
+ # Gets the private link resources that need to be created for a Azure Monitor
126
+ # PrivateLinkScope.
127
+ #
128
+ # @param resource_group_name [String] The name of the resource group.
129
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
130
+ # resource.
131
+ # @param group_name [String] The name of the private link resource.
132
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
133
+ # will be added to the HTTP request.
134
+ #
135
+ # @return [PrivateLinkResource] operation results.
136
+ #
137
+ def get(resource_group_name, scope_name, group_name, custom_headers:nil)
138
+ response = get_async(resource_group_name, scope_name, group_name, custom_headers:custom_headers).value!
139
+ response.body unless response.nil?
140
+ end
141
+
142
+ #
143
+ # Gets the private link resources that need to be created for a Azure Monitor
144
+ # PrivateLinkScope.
145
+ #
146
+ # @param resource_group_name [String] The name of the resource group.
147
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
148
+ # resource.
149
+ # @param group_name [String] The name of the private link resource.
150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
151
+ # will be added to the HTTP request.
152
+ #
153
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
154
+ #
155
+ def get_with_http_info(resource_group_name, scope_name, group_name, custom_headers:nil)
156
+ get_async(resource_group_name, scope_name, group_name, custom_headers:custom_headers).value!
157
+ end
158
+
159
+ #
160
+ # Gets the private link resources that need to be created for a Azure Monitor
161
+ # PrivateLinkScope.
162
+ #
163
+ # @param resource_group_name [String] The name of the resource group.
164
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
165
+ # resource.
166
+ # @param group_name [String] The name of the private link resource.
167
+ # @param [Hash{String => String}] A hash of custom headers that will be added
168
+ # to the HTTP request.
169
+ #
170
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
171
+ #
172
+ def get_async(resource_group_name, scope_name, group_name, custom_headers:nil)
173
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
174
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
175
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
176
+ fail ArgumentError, 'scope_name is nil' if scope_name.nil?
177
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
178
+
179
+
180
+ request_headers = {}
181
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
182
+
183
+ # Set Headers
184
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
185
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
186
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}'
187
+
188
+ request_url = @base_url || @client.base_url
189
+
190
+ options = {
191
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
192
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'scopeName' => scope_name,'groupName' => group_name},
193
+ query_params: {'api-version' => @client.api_version},
194
+ headers: request_headers.merge(custom_headers || {}),
195
+ base_url: request_url
196
+ }
197
+ promise = @client.make_request_async(:get, path_template, options)
198
+
199
+ promise = promise.then do |result|
200
+ http_response = result.response
201
+ status_code = http_response.status
202
+ response_content = http_response.body
203
+ unless status_code == 200
204
+ error_model = JSON.load(response_content)
205
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
206
+ end
207
+
208
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
209
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
210
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
211
+ # Deserialize Response
212
+ if status_code == 200
213
+ begin
214
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
215
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::PrivateLinkResource.mapper()
216
+ result.body = @client.deserialize(result_mapper, parsed_response)
217
+ rescue Exception => e
218
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
219
+ end
220
+ end
221
+
222
+ result
223
+ end
224
+
225
+ promise.execute
226
+ end
227
+
228
+ #
229
+ # Gets the private link resources that need to be created for a Azure Monitor
230
+ # PrivateLinkScope.
231
+ #
232
+ # @param next_page_link [String] The NextLink from the previous successful call
233
+ # to List operation.
234
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
235
+ # will be added to the HTTP request.
236
+ #
237
+ # @return [PrivateLinkResourceListResult] operation results.
238
+ #
239
+ def list_by_private_link_scope_next(next_page_link, custom_headers:nil)
240
+ response = list_by_private_link_scope_next_async(next_page_link, custom_headers:custom_headers).value!
241
+ response.body unless response.nil?
242
+ end
243
+
244
+ #
245
+ # Gets the private link resources that need to be created for a Azure Monitor
246
+ # PrivateLinkScope.
247
+ #
248
+ # @param next_page_link [String] The NextLink from the previous successful call
249
+ # to List operation.
250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
+ # will be added to the HTTP request.
252
+ #
253
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
254
+ #
255
+ def list_by_private_link_scope_next_with_http_info(next_page_link, custom_headers:nil)
256
+ list_by_private_link_scope_next_async(next_page_link, custom_headers:custom_headers).value!
257
+ end
258
+
259
+ #
260
+ # Gets the private link resources that need to be created for a Azure Monitor
261
+ # PrivateLinkScope.
262
+ #
263
+ # @param next_page_link [String] The NextLink from the previous successful call
264
+ # to List operation.
265
+ # @param [Hash{String => String}] A hash of custom headers that will be added
266
+ # to the HTTP request.
267
+ #
268
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
269
+ #
270
+ def list_by_private_link_scope_next_async(next_page_link, custom_headers:nil)
271
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
272
+
273
+
274
+ request_headers = {}
275
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
276
+
277
+ # Set Headers
278
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
279
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
280
+ path_template = '{nextLink}'
281
+
282
+ request_url = @base_url || @client.base_url
283
+
284
+ options = {
285
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
286
+ skip_encoding_path_params: {'nextLink' => next_page_link},
287
+ headers: request_headers.merge(custom_headers || {}),
288
+ base_url: request_url
289
+ }
290
+ promise = @client.make_request_async(:get, path_template, options)
291
+
292
+ promise = promise.then do |result|
293
+ http_response = result.response
294
+ status_code = http_response.status
295
+ response_content = http_response.body
296
+ unless status_code == 200
297
+ error_model = JSON.load(response_content)
298
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
299
+ end
300
+
301
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
302
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
303
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
304
+ # Deserialize Response
305
+ if status_code == 200
306
+ begin
307
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
308
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::PrivateLinkResourceListResult.mapper()
309
+ result.body = @client.deserialize(result_mapper, parsed_response)
310
+ rescue Exception => e
311
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
312
+ end
313
+ end
314
+
315
+ result
316
+ end
317
+
318
+ promise.execute
319
+ end
320
+
321
+ #
322
+ # Gets the private link resources that need to be created for a Azure Monitor
323
+ # PrivateLinkScope.
324
+ #
325
+ # @param resource_group_name [String] The name of the resource group.
326
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
327
+ # resource.
328
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
329
+ # will be added to the HTTP request.
330
+ #
331
+ # @return [PrivateLinkResourceListResult] which provide lazy access to pages of
332
+ # the response.
333
+ #
334
+ def list_by_private_link_scope_as_lazy(resource_group_name, scope_name, custom_headers:nil)
335
+ response = list_by_private_link_scope_async(resource_group_name, scope_name, custom_headers:custom_headers).value!
336
+ unless response.nil?
337
+ page = response.body
338
+ page.next_method = Proc.new do |next_page_link|
339
+ list_by_private_link_scope_next_async(next_page_link, custom_headers:custom_headers)
340
+ end
341
+ page
342
+ end
343
+ end
344
+
345
+ end
346
+ end
@@ -0,0 +1,122 @@
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::Monitor::Mgmt::V2019_10_17_preview
7
+ #
8
+ # Monitor Management Client
9
+ #
10
+ class PrivateLinkScopeOperationStatus
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the PrivateLinkScopeOperationStatus class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [MonitorManagementClient] reference to the MonitorManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Get the status of an azure asynchronous operation associated with a private
26
+ # link scope operation.
27
+ #
28
+ # @param async_operation_id [String] The operation Id.
29
+ # @param resource_group_name [String] The name of the resource group.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [OperationStatus] operation results.
34
+ #
35
+ def get(async_operation_id, resource_group_name, custom_headers:nil)
36
+ response = get_async(async_operation_id, resource_group_name, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Get the status of an azure asynchronous operation associated with a private
42
+ # link scope operation.
43
+ #
44
+ # @param async_operation_id [String] The operation Id.
45
+ # @param resource_group_name [String] The name of the resource group.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def get_with_http_info(async_operation_id, resource_group_name, custom_headers:nil)
52
+ get_async(async_operation_id, resource_group_name, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Get the status of an azure asynchronous operation associated with a private
57
+ # link scope operation.
58
+ #
59
+ # @param async_operation_id [String] The operation Id.
60
+ # @param resource_group_name [String] The name of the resource group.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def get_async(async_operation_id, resource_group_name, custom_headers:nil)
67
+ fail ArgumentError, 'async_operation_id is nil' if async_operation_id.nil?
68
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
69
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+
72
+
73
+ request_headers = {}
74
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
75
+
76
+ # Set Headers
77
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
78
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
79
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopeOperationStatuses/{asyncOperationId}'
80
+
81
+ request_url = @base_url || @client.base_url
82
+
83
+ options = {
84
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
85
+ path_params: {'asyncOperationId' => async_operation_id,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
86
+ query_params: {'api-version' => @client.api_version},
87
+ headers: request_headers.merge(custom_headers || {}),
88
+ base_url: request_url
89
+ }
90
+ promise = @client.make_request_async(:get, path_template, options)
91
+
92
+ promise = promise.then do |result|
93
+ http_response = result.response
94
+ status_code = http_response.status
95
+ response_content = http_response.body
96
+ unless status_code == 200
97
+ error_model = JSON.load(response_content)
98
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
99
+ end
100
+
101
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
102
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
103
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
104
+ # Deserialize Response
105
+ if status_code == 200
106
+ begin
107
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
108
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::OperationStatus.mapper()
109
+ result.body = @client.deserialize(result_mapper, parsed_response)
110
+ rescue Exception => e
111
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
112
+ end
113
+ end
114
+
115
+ result
116
+ end
117
+
118
+ promise.execute
119
+ end
120
+
121
+ end
122
+ end