azure_mgmt_container_service 0.21.0 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-03-30/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  3. data/lib/2016-09-30/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  4. data/lib/2017-01-31/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  5. data/lib/2017-07-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  6. data/lib/2017-08-31/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  7. data/lib/2017-09-30/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  8. data/lib/2018-03-31/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  9. data/lib/2018-08-01-preview/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  10. data/lib/2018-09-30-preview/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  11. data/lib/2019-02-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  12. data/lib/2019-04-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  13. data/lib/2019-04-30/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  14. data/lib/2019-06-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  15. data/lib/2019-08-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  16. data/lib/2019-09-30-preview/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  17. data/lib/2019-10-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  18. data/lib/2020-02-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  19. data/lib/2020-06-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  20. data/lib/2020-07-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  21. data/lib/2020-09-01/generated/azure_mgmt_container_service/container_service_client.rb +1 -1
  22. data/lib/2020-12-01/generated/azure_mgmt_container_service.rb +126 -0
  23. data/lib/2020-12-01/generated/azure_mgmt_container_service/agent_pools.rb +1054 -0
  24. data/lib/2020-12-01/generated/azure_mgmt_container_service/container_service_client.rb +157 -0
  25. data/lib/2020-12-01/generated/azure_mgmt_container_service/maintenance_configurations.rb +589 -0
  26. data/lib/2020-12-01/generated/azure_mgmt_container_service/managed_clusters.rb +2309 -0
  27. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool.rb +533 -0
  28. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_available_versions.rb +93 -0
  29. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_available_versions_properties_agent_pool_versions_item.rb +71 -0
  30. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_list_result.rb +99 -0
  31. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_mode.rb +16 -0
  32. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_type.rb +16 -0
  33. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_upgrade_profile.rb +129 -0
  34. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_upgrade_profile_properties_upgrades_item.rb +59 -0
  35. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/agent_pool_upgrade_settings.rb +47 -0
  36. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/code.rb +16 -0
  37. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/connection_status.rb +18 -0
  38. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_diagnostics_profile.rb +48 -0
  39. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_linux_profile.rb +62 -0
  40. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_master_profile.rb +188 -0
  41. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_network_profile.rb +179 -0
  42. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_ssh_configuration.rb +57 -0
  43. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_ssh_public_key.rb +48 -0
  44. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_storage_profile_types.rb +16 -0
  45. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_vmdiagnostics.rb +60 -0
  46. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/container_service_vmsize_types.rb +188 -0
  47. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/created_by_type.rb +18 -0
  48. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/credential_result.rb +59 -0
  49. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/credential_results.rb +57 -0
  50. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/expander.rb +18 -0
  51. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/kubelet_config.rb +174 -0
  52. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/kubelet_disk_type.rb +15 -0
  53. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/license_type.rb +16 -0
  54. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/linux_osconfig.rb +81 -0
  55. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/load_balancer_sku.rb +16 -0
  56. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/maintenance_configuration.rb +115 -0
  57. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/maintenance_configuration_list_result.rb +101 -0
  58. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster.rb +428 -0
  59. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_aadprofile.rb +123 -0
  60. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_access_profile.rb +97 -0
  61. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_addon_profile.rb +80 -0
  62. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_addon_profile_identity.rb +59 -0
  63. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_agent_pool_profile.rb +340 -0
  64. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_agent_pool_profile_properties.rb +506 -0
  65. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_apiserver_access_profile.rb +77 -0
  66. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_auto_upgrade_profile.rb +47 -0
  67. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_identity.rb +104 -0
  68. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_identity_user_assigned_identities_value.rb +61 -0
  69. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_list_result.rb +100 -0
  70. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile.rb +132 -0
  71. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile_managed_outbound_ips.rb +55 -0
  72. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile_outbound_ipprefixes.rb +57 -0
  73. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_load_balancer_profile_outbound_ips.rb +56 -0
  74. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_pod_identity.rb +98 -0
  75. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_pod_identity_exception.rb +77 -0
  76. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_pod_identity_profile.rb +89 -0
  77. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_pod_identity_provisioning_info.rb +49 -0
  78. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_pod_identity_provisioning_state.rb +18 -0
  79. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_pool_upgrade_profile.rb +92 -0
  80. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_pool_upgrade_profile_upgrades_item.rb +59 -0
  81. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_properties_auto_scaler_profile.rb +224 -0
  82. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_properties_identity_profile_value.rb +61 -0
  83. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_service_principal_profile.rb +59 -0
  84. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_sku.rb +60 -0
  85. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_skuname.rb +15 -0
  86. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_skutier.rb +16 -0
  87. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_upgrade_profile.rb +105 -0
  88. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/managed_cluster_windows_profile.rb +84 -0
  89. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/network_mode.rb +16 -0
  90. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/network_plugin.rb +16 -0
  91. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/network_policy.rb +16 -0
  92. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/operation_list_result.rb +56 -0
  93. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/operation_value.rb +108 -0
  94. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/osdisk_type.rb +16 -0
  95. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/ostype.rb +16 -0
  96. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/outbound_type.rb +16 -0
  97. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/power_state.rb +47 -0
  98. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/private_endpoint.rb +46 -0
  99. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/private_endpoint_connection.rb +111 -0
  100. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/private_endpoint_connection_list_result.rb +55 -0
  101. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/private_endpoint_connection_provisioning_state.rb +18 -0
  102. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/private_link_resource.rb +111 -0
  103. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/private_link_resources_list_result.rb +55 -0
  104. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/private_link_service_connection_state.rb +59 -0
  105. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/resource.rb +110 -0
  106. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/resource_identity_type.rb +17 -0
  107. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/resource_reference.rb +46 -0
  108. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/scale_set_eviction_policy.rb +16 -0
  109. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/scale_set_priority.rb +16 -0
  110. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/sub_resource.rb +72 -0
  111. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/sysctl_config.rb +343 -0
  112. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/system_data.rb +106 -0
  113. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/tags_object.rb +54 -0
  114. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/time_in_week.rb +66 -0
  115. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/time_span.rb +57 -0
  116. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/upgrade_channel.rb +18 -0
  117. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/user_assigned_identity.rb +69 -0
  118. data/lib/2020-12-01/generated/azure_mgmt_container_service/models/week_day.rb +21 -0
  119. data/lib/2020-12-01/generated/azure_mgmt_container_service/module_definition.rb +9 -0
  120. data/lib/2020-12-01/generated/azure_mgmt_container_service/operations.rb +109 -0
  121. data/lib/2020-12-01/generated/azure_mgmt_container_service/private_endpoint_connections.rb +515 -0
  122. data/lib/2020-12-01/generated/azure_mgmt_container_service/private_link_resources.rb +132 -0
  123. data/lib/2020-12-01/generated/azure_mgmt_container_service/resolve_private_link_service_id.rb +143 -0
  124. data/lib/azure_mgmt_container_service.rb +1 -0
  125. data/lib/profiles/latest/modules/containerservice_profile_module.rb +268 -194
  126. data/lib/version.rb +1 -1
  127. metadata +104 -2
@@ -0,0 +1,515 @@
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::ContainerService::Mgmt::V2020_12_01
7
+ #
8
+ # The Container Service 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 [ContainerServiceClient] reference to the ContainerServiceClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets a list of private endpoint connections in the specified managed cluster.
26
+ #
27
+ # Gets a list of private endpoint connections in the specified managed cluster.
28
+ # The operation returns properties of each private endpoint connection.
29
+ #
30
+ # @param resource_group_name [String] The name of the resource group.
31
+ # @param resource_name [String] The name of the managed cluster resource.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [PrivateEndpointConnectionListResult] operation results.
36
+ #
37
+ def list(resource_group_name, resource_name, custom_headers:nil)
38
+ response = list_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Gets a list of private endpoint connections in the specified managed cluster.
44
+ #
45
+ # Gets a list of private endpoint connections in the specified managed cluster.
46
+ # The operation returns properties of each private endpoint connection.
47
+ #
48
+ # @param resource_group_name [String] The name of the resource group.
49
+ # @param resource_name [String] The name of the managed cluster resource.
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 list_with_http_info(resource_group_name, resource_name, custom_headers:nil)
56
+ list_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Gets a list of private endpoint connections in the specified managed cluster.
61
+ #
62
+ # Gets a list of private endpoint connections in the specified managed cluster.
63
+ # The operation returns properties of each private endpoint connection.
64
+ #
65
+ # @param resource_group_name [String] The name of the resource group.
66
+ # @param resource_name [String] The name of the managed cluster resource.
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 list_async(resource_group_name, resource_name, custom_headers:nil)
73
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
74
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
75
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
76
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
77
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
78
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
79
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
80
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
81
+
82
+
83
+ request_headers = {}
84
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
85
+
86
+ # Set Headers
87
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
88
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
89
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'
90
+
91
+ request_url = @base_url || @client.base_url
92
+
93
+ options = {
94
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
95
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
96
+ query_params: {'api-version' => @client.api_version},
97
+ headers: request_headers.merge(custom_headers || {}),
98
+ base_url: request_url
99
+ }
100
+ promise = @client.make_request_async(:get, path_template, options)
101
+
102
+ promise = promise.then do |result|
103
+ http_response = result.response
104
+ status_code = http_response.status
105
+ response_content = http_response.body
106
+ unless status_code == 200
107
+ error_model = JSON.load(response_content)
108
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
109
+ end
110
+
111
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
112
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
113
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
114
+ # Deserialize Response
115
+ if status_code == 200
116
+ begin
117
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
118
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::PrivateEndpointConnectionListResult.mapper()
119
+ result.body = @client.deserialize(result_mapper, parsed_response)
120
+ rescue Exception => e
121
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
122
+ end
123
+ end
124
+
125
+ result
126
+ end
127
+
128
+ promise.execute
129
+ end
130
+
131
+ #
132
+ # Gets the private endpoint connection.
133
+ #
134
+ # Gets the details of the private endpoint connection by managed cluster and
135
+ # resource group.
136
+ #
137
+ # @param resource_group_name [String] The name of the resource group.
138
+ # @param resource_name [String] The name of the managed cluster resource.
139
+ # @param private_endpoint_connection_name [String] The name of the private
140
+ # endpoint connection.
141
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
142
+ # will be added to the HTTP request.
143
+ #
144
+ # @return [PrivateEndpointConnection] operation results.
145
+ #
146
+ def get(resource_group_name, resource_name, private_endpoint_connection_name, custom_headers:nil)
147
+ response = get_async(resource_group_name, resource_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
148
+ response.body unless response.nil?
149
+ end
150
+
151
+ #
152
+ # Gets the private endpoint connection.
153
+ #
154
+ # Gets the details of the private endpoint connection by managed cluster and
155
+ # resource group.
156
+ #
157
+ # @param resource_group_name [String] The name of the resource group.
158
+ # @param resource_name [String] The name of the managed cluster resource.
159
+ # @param private_endpoint_connection_name [String] The name of the private
160
+ # endpoint connection.
161
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
162
+ # will be added to the HTTP request.
163
+ #
164
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
165
+ #
166
+ def get_with_http_info(resource_group_name, resource_name, private_endpoint_connection_name, custom_headers:nil)
167
+ get_async(resource_group_name, resource_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
168
+ end
169
+
170
+ #
171
+ # Gets the private endpoint connection.
172
+ #
173
+ # Gets the details of the private endpoint connection by managed cluster and
174
+ # resource group.
175
+ #
176
+ # @param resource_group_name [String] The name of the resource group.
177
+ # @param resource_name [String] The name of the managed cluster resource.
178
+ # @param private_endpoint_connection_name [String] The name of the private
179
+ # endpoint connection.
180
+ # @param [Hash{String => String}] A hash of custom headers that will be added
181
+ # to the HTTP request.
182
+ #
183
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
184
+ #
185
+ def get_async(resource_group_name, resource_name, private_endpoint_connection_name, custom_headers:nil)
186
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
187
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
188
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
189
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
190
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
191
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
192
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
193
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
194
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
195
+
196
+
197
+ request_headers = {}
198
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
199
+
200
+ # Set Headers
201
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
202
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
203
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'
204
+
205
+ request_url = @base_url || @client.base_url
206
+
207
+ options = {
208
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
209
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'privateEndpointConnectionName' => private_endpoint_connection_name},
210
+ query_params: {'api-version' => @client.api_version},
211
+ headers: request_headers.merge(custom_headers || {}),
212
+ base_url: request_url
213
+ }
214
+ promise = @client.make_request_async(:get, path_template, options)
215
+
216
+ promise = promise.then do |result|
217
+ http_response = result.response
218
+ status_code = http_response.status
219
+ response_content = http_response.body
220
+ unless status_code == 200
221
+ error_model = JSON.load(response_content)
222
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
223
+ end
224
+
225
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
226
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
227
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
228
+ # Deserialize Response
229
+ if status_code == 200
230
+ begin
231
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
232
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::PrivateEndpointConnection.mapper()
233
+ result.body = @client.deserialize(result_mapper, parsed_response)
234
+ rescue Exception => e
235
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
236
+ end
237
+ end
238
+
239
+ result
240
+ end
241
+
242
+ promise.execute
243
+ end
244
+
245
+ #
246
+ # Updates a private endpoint connection.
247
+ #
248
+ # Updates a private endpoint connection in the specified managed cluster.
249
+ #
250
+ # @param resource_group_name [String] The name of the resource group.
251
+ # @param resource_name [String] The name of the managed cluster resource.
252
+ # @param private_endpoint_connection_name [String] The name of the private
253
+ # endpoint connection.
254
+ # @param parameters [PrivateEndpointConnection] Parameters supplied to the
255
+ # Update a private endpoint connection operation.
256
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
257
+ # will be added to the HTTP request.
258
+ #
259
+ # @return [PrivateEndpointConnection] operation results.
260
+ #
261
+ def update(resource_group_name, resource_name, private_endpoint_connection_name, parameters, custom_headers:nil)
262
+ response = update_async(resource_group_name, resource_name, private_endpoint_connection_name, parameters, custom_headers:custom_headers).value!
263
+ response.body unless response.nil?
264
+ end
265
+
266
+ #
267
+ # Updates a private endpoint connection.
268
+ #
269
+ # Updates a private endpoint connection in the specified managed cluster.
270
+ #
271
+ # @param resource_group_name [String] The name of the resource group.
272
+ # @param resource_name [String] The name of the managed cluster resource.
273
+ # @param private_endpoint_connection_name [String] The name of the private
274
+ # endpoint connection.
275
+ # @param parameters [PrivateEndpointConnection] Parameters supplied to the
276
+ # Update a private endpoint connection operation.
277
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
278
+ # will be added to the HTTP request.
279
+ #
280
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
281
+ #
282
+ def update_with_http_info(resource_group_name, resource_name, private_endpoint_connection_name, parameters, custom_headers:nil)
283
+ update_async(resource_group_name, resource_name, private_endpoint_connection_name, parameters, custom_headers:custom_headers).value!
284
+ end
285
+
286
+ #
287
+ # Updates a private endpoint connection.
288
+ #
289
+ # Updates a private endpoint connection in the specified managed cluster.
290
+ #
291
+ # @param resource_group_name [String] The name of the resource group.
292
+ # @param resource_name [String] The name of the managed cluster resource.
293
+ # @param private_endpoint_connection_name [String] The name of the private
294
+ # endpoint connection.
295
+ # @param parameters [PrivateEndpointConnection] Parameters supplied to the
296
+ # Update a private endpoint connection operation.
297
+ # @param [Hash{String => String}] A hash of custom headers that will be added
298
+ # to the HTTP request.
299
+ #
300
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
301
+ #
302
+ def update_async(resource_group_name, resource_name, private_endpoint_connection_name, parameters, custom_headers:nil)
303
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
304
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
305
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
306
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
307
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
308
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
309
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
310
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
311
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
312
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
313
+
314
+
315
+ request_headers = {}
316
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
317
+
318
+ # Set Headers
319
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
320
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
321
+
322
+ # Serialize Request
323
+ request_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::PrivateEndpointConnection.mapper()
324
+ request_content = @client.serialize(request_mapper, parameters)
325
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
326
+
327
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'
328
+
329
+ request_url = @base_url || @client.base_url
330
+
331
+ options = {
332
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
333
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'privateEndpointConnectionName' => private_endpoint_connection_name},
334
+ query_params: {'api-version' => @client.api_version},
335
+ body: request_content,
336
+ headers: request_headers.merge(custom_headers || {}),
337
+ base_url: request_url
338
+ }
339
+ promise = @client.make_request_async(:put, path_template, options)
340
+
341
+ promise = promise.then do |result|
342
+ http_response = result.response
343
+ status_code = http_response.status
344
+ response_content = http_response.body
345
+ unless status_code == 200
346
+ error_model = JSON.load(response_content)
347
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
348
+ end
349
+
350
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
351
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
352
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
353
+ # Deserialize Response
354
+ if status_code == 200
355
+ begin
356
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
357
+ result_mapper = Azure::ContainerService::Mgmt::V2020_12_01::Models::PrivateEndpointConnection.mapper()
358
+ result.body = @client.deserialize(result_mapper, parsed_response)
359
+ rescue Exception => e
360
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
361
+ end
362
+ end
363
+
364
+ result
365
+ end
366
+
367
+ promise.execute
368
+ end
369
+
370
+ #
371
+ # Deletes a private endpoint connection.
372
+ #
373
+ # Deletes the private endpoint connection in the specified managed cluster.
374
+ #
375
+ # @param resource_group_name [String] The name of the resource group.
376
+ # @param resource_name [String] The name of the managed cluster resource.
377
+ # @param private_endpoint_connection_name [String] The name of the private
378
+ # endpoint connection.
379
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
380
+ # will be added to the HTTP request.
381
+ #
382
+ def delete(resource_group_name, resource_name, private_endpoint_connection_name, custom_headers:nil)
383
+ response = delete_async(resource_group_name, resource_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
384
+ nil
385
+ end
386
+
387
+ #
388
+ # @param resource_group_name [String] The name of the resource group.
389
+ # @param resource_name [String] The name of the managed cluster resource.
390
+ # @param private_endpoint_connection_name [String] The name of the private
391
+ # endpoint connection.
392
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
393
+ # will be added to the HTTP request.
394
+ #
395
+ # @return [Concurrent::Promise] promise which provides async access to http
396
+ # response.
397
+ #
398
+ def delete_async(resource_group_name, resource_name, private_endpoint_connection_name, custom_headers:nil)
399
+ # Send request
400
+ promise = begin_delete_async(resource_group_name, resource_name, private_endpoint_connection_name, custom_headers:custom_headers)
401
+
402
+ promise = promise.then do |response|
403
+ # Defining deserialization method.
404
+ deserialize_method = lambda do |parsed_response|
405
+ end
406
+
407
+ # Waiting for response.
408
+ @client.get_long_running_operation_result(response, deserialize_method)
409
+ end
410
+
411
+ promise
412
+ end
413
+
414
+ #
415
+ # Deletes a private endpoint connection.
416
+ #
417
+ # Deletes the private endpoint connection in the specified managed cluster.
418
+ #
419
+ # @param resource_group_name [String] The name of the resource group.
420
+ # @param resource_name [String] The name of the managed cluster resource.
421
+ # @param private_endpoint_connection_name [String] The name of the private
422
+ # endpoint connection.
423
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
424
+ # will be added to the HTTP request.
425
+ #
426
+ #
427
+ def begin_delete(resource_group_name, resource_name, private_endpoint_connection_name, custom_headers:nil)
428
+ response = begin_delete_async(resource_group_name, resource_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
429
+ nil
430
+ end
431
+
432
+ #
433
+ # Deletes a private endpoint connection.
434
+ #
435
+ # Deletes the private endpoint connection in the specified managed cluster.
436
+ #
437
+ # @param resource_group_name [String] The name of the resource group.
438
+ # @param resource_name [String] The name of the managed cluster resource.
439
+ # @param private_endpoint_connection_name [String] The name of the private
440
+ # endpoint connection.
441
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
442
+ # will be added to the HTTP request.
443
+ #
444
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
445
+ #
446
+ def begin_delete_with_http_info(resource_group_name, resource_name, private_endpoint_connection_name, custom_headers:nil)
447
+ begin_delete_async(resource_group_name, resource_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
448
+ end
449
+
450
+ #
451
+ # Deletes a private endpoint connection.
452
+ #
453
+ # Deletes the private endpoint connection in the specified managed cluster.
454
+ #
455
+ # @param resource_group_name [String] The name of the resource group.
456
+ # @param resource_name [String] The name of the managed cluster resource.
457
+ # @param private_endpoint_connection_name [String] The name of the private
458
+ # endpoint connection.
459
+ # @param [Hash{String => String}] A hash of custom headers that will be added
460
+ # to the HTTP request.
461
+ #
462
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
463
+ #
464
+ def begin_delete_async(resource_group_name, resource_name, private_endpoint_connection_name, custom_headers:nil)
465
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
466
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
467
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
468
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
469
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
470
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
471
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '1'" if !resource_name.nil? && resource_name.length < 1
472
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$$')).nil?
473
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
474
+
475
+
476
+ request_headers = {}
477
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
478
+
479
+ # Set Headers
480
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
481
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
482
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'
483
+
484
+ request_url = @base_url || @client.base_url
485
+
486
+ options = {
487
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
488
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'privateEndpointConnectionName' => private_endpoint_connection_name},
489
+ query_params: {'api-version' => @client.api_version},
490
+ headers: request_headers.merge(custom_headers || {}),
491
+ base_url: request_url
492
+ }
493
+ promise = @client.make_request_async(:delete, path_template, options)
494
+
495
+ promise = promise.then do |result|
496
+ http_response = result.response
497
+ status_code = http_response.status
498
+ response_content = http_response.body
499
+ unless status_code == 200 || status_code == 204
500
+ error_model = JSON.load(response_content)
501
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
502
+ end
503
+
504
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
505
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
506
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
507
+
508
+ result
509
+ end
510
+
511
+ promise.execute
512
+ end
513
+
514
+ end
515
+ end