azure_mgmt_monitor 0.17.6 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,85 @@
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
+ module Models
8
+ #
9
+ # A private link scoped resource
10
+ #
11
+ class ScopedResource < ProxyResource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] The resource id of the scoped Azure monitor resource.
16
+ attr_accessor :linked_resource_id
17
+
18
+ # @return [String] State of the private endpoint connection.
19
+ attr_accessor :provisioning_state
20
+
21
+
22
+ #
23
+ # Mapper for ScopedResource class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ client_side_validation: true,
29
+ required: false,
30
+ serialized_name: 'ScopedResource',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'ScopedResource',
34
+ model_properties: {
35
+ id: {
36
+ client_side_validation: true,
37
+ required: false,
38
+ read_only: true,
39
+ serialized_name: 'id',
40
+ type: {
41
+ name: 'String'
42
+ }
43
+ },
44
+ name: {
45
+ client_side_validation: true,
46
+ required: false,
47
+ read_only: true,
48
+ serialized_name: 'name',
49
+ type: {
50
+ name: 'String'
51
+ }
52
+ },
53
+ type: {
54
+ client_side_validation: true,
55
+ required: false,
56
+ read_only: true,
57
+ serialized_name: 'type',
58
+ type: {
59
+ name: 'String'
60
+ }
61
+ },
62
+ linked_resource_id: {
63
+ client_side_validation: true,
64
+ required: false,
65
+ serialized_name: 'properties.linkedResourceId',
66
+ type: {
67
+ name: 'String'
68
+ }
69
+ },
70
+ provisioning_state: {
71
+ client_side_validation: true,
72
+ required: false,
73
+ read_only: true,
74
+ serialized_name: 'properties.provisioningState',
75
+ type: {
76
+ name: 'String'
77
+ }
78
+ }
79
+ }
80
+ }
81
+ }
82
+ end
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,100 @@
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
+ module Models
8
+ #
9
+ # A list of scoped resources in a private link scope.
10
+ #
11
+ class ScopedResourceListResult
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [Array<ScopedResource>] Array of results.
17
+ attr_accessor :value
18
+
19
+ # @return [String] Link to retrieve next page of results.
20
+ attr_accessor :next_link
21
+
22
+ # return [Proc] with next page method call.
23
+ attr_accessor :next_method
24
+
25
+ #
26
+ # Gets the rest of the items for the request, enabling auto-pagination.
27
+ #
28
+ # @return [Array<ScopedResource>] operation results.
29
+ #
30
+ def get_all_items
31
+ items = @value
32
+ page = self
33
+ while page.next_link != nil && !page.next_link.strip.empty? do
34
+ page = page.get_next_page
35
+ items.concat(page.value)
36
+ end
37
+ items
38
+ end
39
+
40
+ #
41
+ # Gets the next page of results.
42
+ #
43
+ # @return [ScopedResourceListResult] with next page content.
44
+ #
45
+ def get_next_page
46
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
47
+ unless response.nil?
48
+ @next_link = response.body.next_link
49
+ @value = response.body.value
50
+ self
51
+ end
52
+ end
53
+
54
+ #
55
+ # Mapper for ScopedResourceListResult class as Ruby Hash.
56
+ # This will be used for serialization/deserialization.
57
+ #
58
+ def self.mapper()
59
+ {
60
+ client_side_validation: true,
61
+ required: false,
62
+ serialized_name: 'ScopedResourceListResult',
63
+ type: {
64
+ name: 'Composite',
65
+ class_name: 'ScopedResourceListResult',
66
+ model_properties: {
67
+ value: {
68
+ client_side_validation: true,
69
+ required: false,
70
+ read_only: true,
71
+ serialized_name: 'value',
72
+ type: {
73
+ name: 'Sequence',
74
+ element: {
75
+ client_side_validation: true,
76
+ required: false,
77
+ serialized_name: 'ScopedResourceElementType',
78
+ type: {
79
+ name: 'Composite',
80
+ class_name: 'ScopedResource'
81
+ }
82
+ }
83
+ }
84
+ },
85
+ next_link: {
86
+ client_side_validation: true,
87
+ required: false,
88
+ read_only: true,
89
+ serialized_name: 'nextLink',
90
+ type: {
91
+ name: 'String'
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ end
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,55 @@
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
+ module Models
8
+ #
9
+ # A container holding only the Tags for a resource, allowing the user to
10
+ # update the tags on a PrivateLinkScope instance.
11
+ #
12
+ class TagsResource
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [Hash{String => String}] Resource tags
17
+ attr_accessor :tags
18
+
19
+
20
+ #
21
+ # Mapper for TagsResource class as Ruby Hash.
22
+ # This will be used for serialization/deserialization.
23
+ #
24
+ def self.mapper()
25
+ {
26
+ client_side_validation: true,
27
+ required: false,
28
+ serialized_name: 'TagsResource',
29
+ type: {
30
+ name: 'Composite',
31
+ class_name: 'TagsResource',
32
+ model_properties: {
33
+ tags: {
34
+ client_side_validation: true,
35
+ required: false,
36
+ serialized_name: 'tags',
37
+ type: {
38
+ name: 'Dictionary',
39
+ value: {
40
+ client_side_validation: true,
41
+ required: false,
42
+ serialized_name: 'StringElementType',
43
+ type: {
44
+ name: 'String'
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::Monitor end
8
+ module Azure::Monitor::Mgmt end
9
+ module Azure::Monitor::Mgmt::V2019_10_17_preview end
@@ -0,0 +1,148 @@
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
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class MonitorManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] The Azure subscription Id.
21
+ attr_accessor :subscription_id
22
+
23
+ # @return [String] Client Api Version.
24
+ attr_reader :api_version
25
+
26
+ # @return [String] The preferred language for the response.
27
+ attr_accessor :accept_language
28
+
29
+ # @return [Integer] The retry timeout in seconds for Long Running
30
+ # Operations. Default value is 30.
31
+ attr_accessor :long_running_operation_retry_timeout
32
+
33
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
34
+ # generated. When set to true a unique x-ms-client-request-id value is
35
+ # generated and included in each request. Default is true.
36
+ attr_accessor :generate_client_request_id
37
+
38
+ # @return [PrivateLinkScopes] private_link_scopes
39
+ attr_reader :private_link_scopes
40
+
41
+ # @return [PrivateLinkScopeOperationStatus]
42
+ # private_link_scope_operation_status
43
+ attr_reader :private_link_scope_operation_status
44
+
45
+ # @return [PrivateLinkResources] private_link_resources
46
+ attr_reader :private_link_resources
47
+
48
+ # @return [PrivateEndpointConnections] private_endpoint_connections
49
+ attr_reader :private_endpoint_connections
50
+
51
+ # @return [PrivateLinkScopedResources] private_link_scoped_resources
52
+ attr_reader :private_link_scoped_resources
53
+
54
+ #
55
+ # Creates initializes a new instance of the MonitorManagementClient class.
56
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
57
+ # @param base_url [String] the base URI of the service.
58
+ # @param options [Array] filters to be applied to the HTTP requests.
59
+ #
60
+ def initialize(credentials = nil, base_url = nil, options = nil)
61
+ super(credentials, options)
62
+ @base_url = base_url || 'https://management.azure.com'
63
+
64
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
65
+ @credentials = credentials
66
+
67
+ @private_link_scopes = PrivateLinkScopes.new(self)
68
+ @private_link_scope_operation_status = PrivateLinkScopeOperationStatus.new(self)
69
+ @private_link_resources = PrivateLinkResources.new(self)
70
+ @private_endpoint_connections = PrivateEndpointConnections.new(self)
71
+ @private_link_scoped_resources = PrivateLinkScopedResources.new(self)
72
+ @api_version = '2019-10-17-preview'
73
+ @accept_language = 'en-US'
74
+ @long_running_operation_retry_timeout = 30
75
+ @generate_client_request_id = true
76
+ add_telemetry
77
+ end
78
+
79
+ #
80
+ # Makes a request and returns the body of the response.
81
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
82
+ # @param path [String] the path, relative to {base_url}.
83
+ # @param options [Hash{String=>String}] specifying any request options like :body.
84
+ # @return [Hash{String=>String}] containing the body of the response.
85
+ # Example:
86
+ #
87
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
88
+ # path = "/path"
89
+ # options = {
90
+ # body: request_content,
91
+ # query_params: {'api-version' => '2016-02-01'}
92
+ # }
93
+ # result = @client.make_request(:put, path, options)
94
+ #
95
+ def make_request(method, path, options = {})
96
+ result = make_request_with_http_info(method, path, options)
97
+ result.body unless result.nil?
98
+ end
99
+
100
+ #
101
+ # Makes a request and returns the operation response.
102
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
103
+ # @param path [String] the path, relative to {base_url}.
104
+ # @param options [Hash{String=>String}] specifying any request options like :body.
105
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
106
+ #
107
+ def make_request_with_http_info(method, path, options = {})
108
+ result = make_request_async(method, path, options).value!
109
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
110
+ result
111
+ end
112
+
113
+ #
114
+ # Makes a request asynchronously.
115
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
116
+ # @param path [String] the path, relative to {base_url}.
117
+ # @param options [Hash{String=>String}] specifying any request options like :body.
118
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
119
+ #
120
+ def make_request_async(method, path, options = {})
121
+ fail ArgumentError, 'method is nil' if method.nil?
122
+ fail ArgumentError, 'path is nil' if path.nil?
123
+
124
+ request_url = options[:base_url] || @base_url
125
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
126
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
127
+ end
128
+
129
+ request_headers = @request_headers
130
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
131
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
132
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
133
+
134
+ super(request_url, method, path, options)
135
+ end
136
+
137
+
138
+ private
139
+ #
140
+ # Adds telemetry information.
141
+ #
142
+ def add_telemetry
143
+ sdk_information = 'azure_mgmt_monitor'
144
+ sdk_information = "#{sdk_information}/0.18.0"
145
+ add_user_agent_information(sdk_information)
146
+ end
147
+ end
148
+ end
@@ -0,0 +1,641 @@
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 PrivateEndpointConnections
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the PrivateEndpointConnections 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 a private endpoint connection.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
29
+ # resource.
30
+ # @param private_endpoint_connection_name [String] The name of the private
31
+ # endpoint connection.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [PrivateEndpointConnection] operation results.
36
+ #
37
+ def get(resource_group_name, scope_name, private_endpoint_connection_name, custom_headers:nil)
38
+ response = get_async(resource_group_name, scope_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Gets a private endpoint connection.
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 private_endpoint_connection_name [String] The name of the private
49
+ # endpoint connection.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def get_with_http_info(resource_group_name, scope_name, private_endpoint_connection_name, custom_headers:nil)
56
+ get_async(resource_group_name, scope_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Gets a private endpoint connection.
61
+ #
62
+ # @param resource_group_name [String] The name of the resource group.
63
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
64
+ # resource.
65
+ # @param private_endpoint_connection_name [String] The name of the private
66
+ # endpoint connection.
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def get_async(resource_group_name, scope_name, private_endpoint_connection_name, custom_headers:nil)
73
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
74
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
75
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
76
+ fail ArgumentError, 'scope_name is nil' if scope_name.nil?
77
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
78
+
79
+
80
+ request_headers = {}
81
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
82
+
83
+ # Set Headers
84
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
85
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
86
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'
87
+
88
+ request_url = @base_url || @client.base_url
89
+
90
+ options = {
91
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
92
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'scopeName' => scope_name,'privateEndpointConnectionName' => private_endpoint_connection_name},
93
+ query_params: {'api-version' => @client.api_version},
94
+ headers: request_headers.merge(custom_headers || {}),
95
+ base_url: request_url
96
+ }
97
+ promise = @client.make_request_async(:get, path_template, options)
98
+
99
+ promise = promise.then do |result|
100
+ http_response = result.response
101
+ status_code = http_response.status
102
+ response_content = http_response.body
103
+ unless status_code == 200
104
+ error_model = JSON.load(response_content)
105
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
106
+ end
107
+
108
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
109
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
110
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
111
+ # Deserialize Response
112
+ if status_code == 200
113
+ begin
114
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
115
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::PrivateEndpointConnection.mapper()
116
+ result.body = @client.deserialize(result_mapper, parsed_response)
117
+ rescue Exception => e
118
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
119
+ end
120
+ end
121
+
122
+ result
123
+ end
124
+
125
+ promise.execute
126
+ end
127
+
128
+ #
129
+ # Approve or reject a private endpoint connection with a given name.
130
+ #
131
+ # @param resource_group_name [String] The name of the resource group.
132
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
133
+ # resource.
134
+ # @param private_endpoint_connection_name [String] The name of the private
135
+ # endpoint connection.
136
+ # @param parameters [PrivateEndpointConnection]
137
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
138
+ # will be added to the HTTP request.
139
+ #
140
+ # @return [PrivateEndpointConnection] operation results.
141
+ #
142
+ def create_or_update(resource_group_name, scope_name, private_endpoint_connection_name, parameters, custom_headers:nil)
143
+ response = create_or_update_async(resource_group_name, scope_name, private_endpoint_connection_name, parameters, custom_headers:custom_headers).value!
144
+ response.body unless response.nil?
145
+ end
146
+
147
+ #
148
+ # @param resource_group_name [String] The name of the resource group.
149
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
150
+ # resource.
151
+ # @param private_endpoint_connection_name [String] The name of the private
152
+ # endpoint connection.
153
+ # @param parameters [PrivateEndpointConnection]
154
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
155
+ # will be added to the HTTP request.
156
+ #
157
+ # @return [Concurrent::Promise] promise which provides async access to http
158
+ # response.
159
+ #
160
+ def create_or_update_async(resource_group_name, scope_name, private_endpoint_connection_name, parameters, custom_headers:nil)
161
+ # Send request
162
+ promise = begin_create_or_update_async(resource_group_name, scope_name, private_endpoint_connection_name, parameters, custom_headers:custom_headers)
163
+
164
+ promise = promise.then do |response|
165
+ # Defining deserialization method.
166
+ deserialize_method = lambda do |parsed_response|
167
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::PrivateEndpointConnection.mapper()
168
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
169
+ end
170
+
171
+ # Waiting for response.
172
+ @client.get_long_running_operation_result(response, deserialize_method)
173
+ end
174
+
175
+ promise
176
+ end
177
+
178
+ #
179
+ # Deletes a private endpoint connection with a given name.
180
+ #
181
+ # @param resource_group_name [String] The name of the resource group.
182
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
183
+ # resource.
184
+ # @param private_endpoint_connection_name [String] The name of the private
185
+ # endpoint connection.
186
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
187
+ # will be added to the HTTP request.
188
+ #
189
+ def delete(resource_group_name, scope_name, private_endpoint_connection_name, custom_headers:nil)
190
+ response = delete_async(resource_group_name, scope_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
191
+ nil
192
+ end
193
+
194
+ #
195
+ # @param resource_group_name [String] The name of the resource group.
196
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
197
+ # resource.
198
+ # @param private_endpoint_connection_name [String] The name of the private
199
+ # endpoint connection.
200
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
201
+ # will be added to the HTTP request.
202
+ #
203
+ # @return [Concurrent::Promise] promise which provides async access to http
204
+ # response.
205
+ #
206
+ def delete_async(resource_group_name, scope_name, private_endpoint_connection_name, custom_headers:nil)
207
+ # Send request
208
+ promise = begin_delete_async(resource_group_name, scope_name, private_endpoint_connection_name, custom_headers:custom_headers)
209
+
210
+ promise = promise.then do |response|
211
+ # Defining deserialization method.
212
+ deserialize_method = lambda do |parsed_response|
213
+ end
214
+
215
+ # Waiting for response.
216
+ @client.get_long_running_operation_result(response, deserialize_method)
217
+ end
218
+
219
+ promise
220
+ end
221
+
222
+ #
223
+ # Gets all private endpoint connections on a private link scope.
224
+ #
225
+ # @param resource_group_name [String] The name of the resource group.
226
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
227
+ # resource.
228
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
229
+ # will be added to the HTTP request.
230
+ #
231
+ # @return [Array<PrivateEndpointConnection>] operation results.
232
+ #
233
+ def list_by_private_link_scope(resource_group_name, scope_name, custom_headers:nil)
234
+ first_page = list_by_private_link_scope_as_lazy(resource_group_name, scope_name, custom_headers:custom_headers)
235
+ first_page.get_all_items
236
+ end
237
+
238
+ #
239
+ # Gets all private endpoint connections on a private link scope.
240
+ #
241
+ # @param resource_group_name [String] The name of the resource group.
242
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
243
+ # resource.
244
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
245
+ # will be added to the HTTP request.
246
+ #
247
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
248
+ #
249
+ def list_by_private_link_scope_with_http_info(resource_group_name, scope_name, custom_headers:nil)
250
+ list_by_private_link_scope_async(resource_group_name, scope_name, custom_headers:custom_headers).value!
251
+ end
252
+
253
+ #
254
+ # Gets all private endpoint connections on a private link scope.
255
+ #
256
+ # @param resource_group_name [String] The name of the resource group.
257
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
258
+ # resource.
259
+ # @param [Hash{String => String}] A hash of custom headers that will be added
260
+ # to the HTTP request.
261
+ #
262
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
263
+ #
264
+ def list_by_private_link_scope_async(resource_group_name, scope_name, custom_headers:nil)
265
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
266
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
267
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
268
+ fail ArgumentError, 'scope_name is nil' if scope_name.nil?
269
+
270
+
271
+ request_headers = {}
272
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
273
+
274
+ # Set Headers
275
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
276
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
277
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections'
278
+
279
+ request_url = @base_url || @client.base_url
280
+
281
+ options = {
282
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
283
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'scopeName' => scope_name},
284
+ query_params: {'api-version' => @client.api_version},
285
+ headers: request_headers.merge(custom_headers || {}),
286
+ base_url: request_url
287
+ }
288
+ promise = @client.make_request_async(:get, path_template, options)
289
+
290
+ promise = promise.then do |result|
291
+ http_response = result.response
292
+ status_code = http_response.status
293
+ response_content = http_response.body
294
+ unless status_code == 200
295
+ error_model = JSON.load(response_content)
296
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
297
+ end
298
+
299
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
300
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
301
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
302
+ # Deserialize Response
303
+ if status_code == 200
304
+ begin
305
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
306
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::PrivateEndpointConnectionListResult.mapper()
307
+ result.body = @client.deserialize(result_mapper, parsed_response)
308
+ rescue Exception => e
309
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
310
+ end
311
+ end
312
+
313
+ result
314
+ end
315
+
316
+ promise.execute
317
+ end
318
+
319
+ #
320
+ # Approve or reject a private endpoint connection with a given name.
321
+ #
322
+ # @param resource_group_name [String] The name of the resource group.
323
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
324
+ # resource.
325
+ # @param private_endpoint_connection_name [String] The name of the private
326
+ # endpoint connection.
327
+ # @param parameters [PrivateEndpointConnection]
328
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
329
+ # will be added to the HTTP request.
330
+ #
331
+ # @return [PrivateEndpointConnection] operation results.
332
+ #
333
+ def begin_create_or_update(resource_group_name, scope_name, private_endpoint_connection_name, parameters, custom_headers:nil)
334
+ response = begin_create_or_update_async(resource_group_name, scope_name, private_endpoint_connection_name, parameters, custom_headers:custom_headers).value!
335
+ response.body unless response.nil?
336
+ end
337
+
338
+ #
339
+ # Approve or reject a private endpoint connection with a given name.
340
+ #
341
+ # @param resource_group_name [String] The name of the resource group.
342
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
343
+ # resource.
344
+ # @param private_endpoint_connection_name [String] The name of the private
345
+ # endpoint connection.
346
+ # @param parameters [PrivateEndpointConnection]
347
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
348
+ # will be added to the HTTP request.
349
+ #
350
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
351
+ #
352
+ def begin_create_or_update_with_http_info(resource_group_name, scope_name, private_endpoint_connection_name, parameters, custom_headers:nil)
353
+ begin_create_or_update_async(resource_group_name, scope_name, private_endpoint_connection_name, parameters, custom_headers:custom_headers).value!
354
+ end
355
+
356
+ #
357
+ # Approve or reject a private endpoint connection with a given name.
358
+ #
359
+ # @param resource_group_name [String] The name of the resource group.
360
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
361
+ # resource.
362
+ # @param private_endpoint_connection_name [String] The name of the private
363
+ # endpoint connection.
364
+ # @param parameters [PrivateEndpointConnection]
365
+ # @param [Hash{String => String}] A hash of custom headers that will be added
366
+ # to the HTTP request.
367
+ #
368
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
369
+ #
370
+ def begin_create_or_update_async(resource_group_name, scope_name, private_endpoint_connection_name, parameters, custom_headers:nil)
371
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
372
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
373
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
374
+ fail ArgumentError, 'scope_name is nil' if scope_name.nil?
375
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
376
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
377
+
378
+
379
+ request_headers = {}
380
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
381
+
382
+ # Set Headers
383
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
384
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
385
+
386
+ # Serialize Request
387
+ request_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::PrivateEndpointConnection.mapper()
388
+ request_content = @client.serialize(request_mapper, parameters)
389
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
390
+
391
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'
392
+
393
+ request_url = @base_url || @client.base_url
394
+
395
+ options = {
396
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
397
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'scopeName' => scope_name,'privateEndpointConnectionName' => private_endpoint_connection_name},
398
+ query_params: {'api-version' => @client.api_version},
399
+ body: request_content,
400
+ headers: request_headers.merge(custom_headers || {}),
401
+ base_url: request_url
402
+ }
403
+ promise = @client.make_request_async(:put, path_template, options)
404
+
405
+ promise = promise.then do |result|
406
+ http_response = result.response
407
+ status_code = http_response.status
408
+ response_content = http_response.body
409
+ unless status_code == 200 || status_code == 202
410
+ error_model = JSON.load(response_content)
411
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
412
+ end
413
+
414
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
415
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
416
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
417
+ # Deserialize Response
418
+ if status_code == 200
419
+ begin
420
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
421
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::PrivateEndpointConnection.mapper()
422
+ result.body = @client.deserialize(result_mapper, parsed_response)
423
+ rescue Exception => e
424
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
425
+ end
426
+ end
427
+
428
+ result
429
+ end
430
+
431
+ promise.execute
432
+ end
433
+
434
+ #
435
+ # Deletes a private endpoint connection with a given name.
436
+ #
437
+ # @param resource_group_name [String] The name of the resource group.
438
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
439
+ # resource.
440
+ # @param private_endpoint_connection_name [String] The name of the private
441
+ # endpoint connection.
442
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
443
+ # will be added to the HTTP request.
444
+ #
445
+ #
446
+ def begin_delete(resource_group_name, scope_name, private_endpoint_connection_name, custom_headers:nil)
447
+ response = begin_delete_async(resource_group_name, scope_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
448
+ nil
449
+ end
450
+
451
+ #
452
+ # Deletes a private endpoint connection with a given name.
453
+ #
454
+ # @param resource_group_name [String] The name of the resource group.
455
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
456
+ # resource.
457
+ # @param private_endpoint_connection_name [String] The name of the private
458
+ # endpoint connection.
459
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
460
+ # will be added to the HTTP request.
461
+ #
462
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
463
+ #
464
+ def begin_delete_with_http_info(resource_group_name, scope_name, private_endpoint_connection_name, custom_headers:nil)
465
+ begin_delete_async(resource_group_name, scope_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
466
+ end
467
+
468
+ #
469
+ # Deletes a private endpoint connection with a given name.
470
+ #
471
+ # @param resource_group_name [String] The name of the resource group.
472
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
473
+ # resource.
474
+ # @param private_endpoint_connection_name [String] The name of the private
475
+ # endpoint connection.
476
+ # @param [Hash{String => String}] A hash of custom headers that will be added
477
+ # to the HTTP request.
478
+ #
479
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
480
+ #
481
+ def begin_delete_async(resource_group_name, scope_name, private_endpoint_connection_name, custom_headers:nil)
482
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
483
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
484
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
485
+ fail ArgumentError, 'scope_name is nil' if scope_name.nil?
486
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
487
+
488
+
489
+ request_headers = {}
490
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
491
+
492
+ # Set Headers
493
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
494
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
495
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'
496
+
497
+ request_url = @base_url || @client.base_url
498
+
499
+ options = {
500
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
501
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'scopeName' => scope_name,'privateEndpointConnectionName' => private_endpoint_connection_name},
502
+ query_params: {'api-version' => @client.api_version},
503
+ headers: request_headers.merge(custom_headers || {}),
504
+ base_url: request_url
505
+ }
506
+ promise = @client.make_request_async(:delete, path_template, options)
507
+
508
+ promise = promise.then do |result|
509
+ http_response = result.response
510
+ status_code = http_response.status
511
+ response_content = http_response.body
512
+ unless status_code == 200 || status_code == 202 || status_code == 204
513
+ error_model = JSON.load(response_content)
514
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
515
+ end
516
+
517
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
518
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
519
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
520
+
521
+ result
522
+ end
523
+
524
+ promise.execute
525
+ end
526
+
527
+ #
528
+ # Gets all private endpoint connections on a private link scope.
529
+ #
530
+ # @param next_page_link [String] The NextLink from the previous successful call
531
+ # to List operation.
532
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
533
+ # will be added to the HTTP request.
534
+ #
535
+ # @return [PrivateEndpointConnectionListResult] operation results.
536
+ #
537
+ def list_by_private_link_scope_next(next_page_link, custom_headers:nil)
538
+ response = list_by_private_link_scope_next_async(next_page_link, custom_headers:custom_headers).value!
539
+ response.body unless response.nil?
540
+ end
541
+
542
+ #
543
+ # Gets all private endpoint connections on a private link scope.
544
+ #
545
+ # @param next_page_link [String] The NextLink from the previous successful call
546
+ # to List operation.
547
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
548
+ # will be added to the HTTP request.
549
+ #
550
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
551
+ #
552
+ def list_by_private_link_scope_next_with_http_info(next_page_link, custom_headers:nil)
553
+ list_by_private_link_scope_next_async(next_page_link, custom_headers:custom_headers).value!
554
+ end
555
+
556
+ #
557
+ # Gets all private endpoint connections on a private link scope.
558
+ #
559
+ # @param next_page_link [String] The NextLink from the previous successful call
560
+ # to List operation.
561
+ # @param [Hash{String => String}] A hash of custom headers that will be added
562
+ # to the HTTP request.
563
+ #
564
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
565
+ #
566
+ def list_by_private_link_scope_next_async(next_page_link, custom_headers:nil)
567
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
568
+
569
+
570
+ request_headers = {}
571
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
572
+
573
+ # Set Headers
574
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
575
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
576
+ path_template = '{nextLink}'
577
+
578
+ request_url = @base_url || @client.base_url
579
+
580
+ options = {
581
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
582
+ skip_encoding_path_params: {'nextLink' => next_page_link},
583
+ headers: request_headers.merge(custom_headers || {}),
584
+ base_url: request_url
585
+ }
586
+ promise = @client.make_request_async(:get, path_template, options)
587
+
588
+ promise = promise.then do |result|
589
+ http_response = result.response
590
+ status_code = http_response.status
591
+ response_content = http_response.body
592
+ unless status_code == 200
593
+ error_model = JSON.load(response_content)
594
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
595
+ end
596
+
597
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
598
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
599
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
600
+ # Deserialize Response
601
+ if status_code == 200
602
+ begin
603
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
604
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::PrivateEndpointConnectionListResult.mapper()
605
+ result.body = @client.deserialize(result_mapper, parsed_response)
606
+ rescue Exception => e
607
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
608
+ end
609
+ end
610
+
611
+ result
612
+ end
613
+
614
+ promise.execute
615
+ end
616
+
617
+ #
618
+ # Gets all private endpoint connections on a private link scope.
619
+ #
620
+ # @param resource_group_name [String] The name of the resource group.
621
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
622
+ # resource.
623
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
624
+ # will be added to the HTTP request.
625
+ #
626
+ # @return [PrivateEndpointConnectionListResult] which provide lazy access to
627
+ # pages of the response.
628
+ #
629
+ def list_by_private_link_scope_as_lazy(resource_group_name, scope_name, custom_headers:nil)
630
+ response = list_by_private_link_scope_async(resource_group_name, scope_name, custom_headers:custom_headers).value!
631
+ unless response.nil?
632
+ page = response.body
633
+ page.next_method = Proc.new do |next_page_link|
634
+ list_by_private_link_scope_next_async(next_page_link, custom_headers:custom_headers)
635
+ end
636
+ page
637
+ end
638
+ end
639
+
640
+ end
641
+ end