azure_mgmt_cognitive_services 0.18.2 → 0.19.3
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.
- checksums.yaml +5 -5
- data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/cognitive_services_accounts.rb +18 -0
- data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/cognitive_services_management_client.rb +1 -1
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services.rb +42 -13
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/accounts.rb +178 -110
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/cognitive_services_management_client.rb +235 -7
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/azure_entity_resource.rb +75 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/check_domain_availability_parameter.rb +57 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/check_domain_availability_result.rb +79 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/cognitive_services_account.rb +21 -43
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_api_properties.rb +149 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_properties.rb +201 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/encryption.rb +61 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/identity.rb +95 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/identity_type.rb +17 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/ip_rule.rb +49 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/key_source.rb +16 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/key_vault_properties.rb +68 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/network_rule_action.rb +16 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/network_rule_set.rb +89 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_endpoint.rb +47 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_endpoint_connection.rb +74 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_endpoint_connection_list_result.rb +56 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_endpoint_connection_properties.rb +80 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_endpoint_service_connection_status.rb +18 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_link_resource.rb +74 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_link_resource_list_result.rb +55 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_link_resource_properties.rb +100 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_link_service_connection_state.rb +73 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/proxy_resource.rb +63 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/public_network_access.rb +16 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/resource.rb +83 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/sku_capability.rb +57 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/{cognitive_services_account_update_parameters.rb → tracked_resource.rb} +34 -24
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/user_assigned_identity.rb +58 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/user_owned_storage.rb +46 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/virtual_network_rule.rb +69 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/operations.rb +5 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/private_endpoint_connections.rb +481 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/private_link_resources.rb +133 -0
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/resource_skus.rb +6 -0
- data/lib/azure_mgmt_cognitive_services.rb +1 -1
- data/lib/profiles/latest/modules/cognitiveservices_profile_module.rb +153 -39
- data/lib/version.rb +1 -1
- metadata +37 -8
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/check_sku_availability.rb +0 -138
- data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_create_parameters.rb +0 -108
@@ -0,0 +1,46 @@
|
|
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::CognitiveServices::Mgmt::V2017_04_18
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# The user owned storage for Cognitive Services account.
|
10
|
+
#
|
11
|
+
class UserOwnedStorage
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] Full resource id of a Microsoft.Storage resource.
|
16
|
+
attr_accessor :resource_id
|
17
|
+
|
18
|
+
|
19
|
+
#
|
20
|
+
# Mapper for UserOwnedStorage class as Ruby Hash.
|
21
|
+
# This will be used for serialization/deserialization.
|
22
|
+
#
|
23
|
+
def self.mapper()
|
24
|
+
{
|
25
|
+
client_side_validation: true,
|
26
|
+
required: false,
|
27
|
+
serialized_name: 'UserOwnedStorage',
|
28
|
+
type: {
|
29
|
+
name: 'Composite',
|
30
|
+
class_name: 'UserOwnedStorage',
|
31
|
+
model_properties: {
|
32
|
+
resource_id: {
|
33
|
+
client_side_validation: true,
|
34
|
+
required: false,
|
35
|
+
serialized_name: 'resourceId',
|
36
|
+
type: {
|
37
|
+
name: 'String'
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,69 @@
|
|
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::CognitiveServices::Mgmt::V2017_04_18
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# A rule governing the accessibility from a specific virtual network.
|
10
|
+
#
|
11
|
+
class VirtualNetworkRule
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] Full resource id of a vnet subnet, such as
|
16
|
+
# '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'.
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
# @return [String] Gets the state of virtual network rule.
|
20
|
+
attr_accessor :state
|
21
|
+
|
22
|
+
# @return [Boolean] Ignore missing vnet service endpoint or not.
|
23
|
+
attr_accessor :ignore_missing_vnet_service_endpoint
|
24
|
+
|
25
|
+
|
26
|
+
#
|
27
|
+
# Mapper for VirtualNetworkRule class as Ruby Hash.
|
28
|
+
# This will be used for serialization/deserialization.
|
29
|
+
#
|
30
|
+
def self.mapper()
|
31
|
+
{
|
32
|
+
client_side_validation: true,
|
33
|
+
required: false,
|
34
|
+
serialized_name: 'VirtualNetworkRule',
|
35
|
+
type: {
|
36
|
+
name: 'Composite',
|
37
|
+
class_name: 'VirtualNetworkRule',
|
38
|
+
model_properties: {
|
39
|
+
id: {
|
40
|
+
client_side_validation: true,
|
41
|
+
required: true,
|
42
|
+
serialized_name: 'id',
|
43
|
+
type: {
|
44
|
+
name: 'String'
|
45
|
+
}
|
46
|
+
},
|
47
|
+
state: {
|
48
|
+
client_side_validation: true,
|
49
|
+
required: false,
|
50
|
+
serialized_name: 'state',
|
51
|
+
type: {
|
52
|
+
name: 'String'
|
53
|
+
}
|
54
|
+
},
|
55
|
+
ignore_missing_vnet_service_endpoint: {
|
56
|
+
client_side_validation: true,
|
57
|
+
required: false,
|
58
|
+
serialized_name: 'ignoreMissingVnetServiceEndpoint',
|
59
|
+
type: {
|
60
|
+
name: 'Boolean'
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -56,6 +56,7 @@ module Azure::CognitiveServices::Mgmt::V2017_04_18
|
|
56
56
|
#
|
57
57
|
def list_async(custom_headers:nil)
|
58
58
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
59
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
59
60
|
|
60
61
|
|
61
62
|
request_headers = {}
|
@@ -86,6 +87,8 @@ module Azure::CognitiveServices::Mgmt::V2017_04_18
|
|
86
87
|
end
|
87
88
|
|
88
89
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
90
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
91
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
89
92
|
# Deserialize Response
|
90
93
|
if status_code == 200
|
91
94
|
begin
|
@@ -174,6 +177,8 @@ module Azure::CognitiveServices::Mgmt::V2017_04_18
|
|
174
177
|
end
|
175
178
|
|
176
179
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
180
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
181
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
177
182
|
# Deserialize Response
|
178
183
|
if status_code == 200
|
179
184
|
begin
|
@@ -0,0 +1,481 @@
|
|
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::CognitiveServices::Mgmt::V2017_04_18
|
7
|
+
#
|
8
|
+
# Cognitive Services 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 [CognitiveServicesManagementClient] reference to the CognitiveServicesManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Gets the private endpoint connections associated with the Cognitive Services
|
26
|
+
# account.
|
27
|
+
#
|
28
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
29
|
+
# is case insensitive.
|
30
|
+
# @param account_name [String] The name of Cognitive Services account.
|
31
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
32
|
+
# will be added to the HTTP request.
|
33
|
+
#
|
34
|
+
# @return [PrivateEndpointConnectionListResult] operation results.
|
35
|
+
#
|
36
|
+
def list(resource_group_name, account_name, custom_headers:nil)
|
37
|
+
response = list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
|
38
|
+
response.body unless response.nil?
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
# Gets the private endpoint connections associated with the Cognitive Services
|
43
|
+
# account.
|
44
|
+
#
|
45
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
46
|
+
# is case insensitive.
|
47
|
+
# @param account_name [String] The name of Cognitive Services account.
|
48
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
49
|
+
# will be added to the HTTP request.
|
50
|
+
#
|
51
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
52
|
+
#
|
53
|
+
def list_with_http_info(resource_group_name, account_name, custom_headers:nil)
|
54
|
+
list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
|
55
|
+
end
|
56
|
+
|
57
|
+
#
|
58
|
+
# Gets the private endpoint connections associated with the Cognitive Services
|
59
|
+
# account.
|
60
|
+
#
|
61
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
62
|
+
# is case insensitive.
|
63
|
+
# @param account_name [String] The name of Cognitive Services account.
|
64
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
65
|
+
# to the HTTP request.
|
66
|
+
#
|
67
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
68
|
+
#
|
69
|
+
def list_async(resource_group_name, account_name, custom_headers:nil)
|
70
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
71
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
72
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
73
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
74
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
75
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '64'" if !account_name.nil? && account_name.length > 64
|
76
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '2'" if !account_name.nil? && account_name.length < 2
|
77
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
|
78
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
79
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
80
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
81
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
82
|
+
|
83
|
+
|
84
|
+
request_headers = {}
|
85
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
86
|
+
|
87
|
+
# Set Headers
|
88
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
89
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
90
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections'
|
91
|
+
|
92
|
+
request_url = @base_url || @client.base_url
|
93
|
+
|
94
|
+
options = {
|
95
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
96
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
97
|
+
query_params: {'api-version' => @client.api_version},
|
98
|
+
headers: request_headers.merge(custom_headers || {}),
|
99
|
+
base_url: request_url
|
100
|
+
}
|
101
|
+
promise = @client.make_request_async(:get, path_template, options)
|
102
|
+
|
103
|
+
promise = promise.then do |result|
|
104
|
+
http_response = result.response
|
105
|
+
status_code = http_response.status
|
106
|
+
response_content = http_response.body
|
107
|
+
unless status_code == 200
|
108
|
+
error_model = JSON.load(response_content)
|
109
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
110
|
+
end
|
111
|
+
|
112
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
113
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
114
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
115
|
+
# Deserialize Response
|
116
|
+
if status_code == 200
|
117
|
+
begin
|
118
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
119
|
+
result_mapper = Azure::CognitiveServices::Mgmt::V2017_04_18::Models::PrivateEndpointConnectionListResult.mapper()
|
120
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
121
|
+
rescue Exception => e
|
122
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
result
|
127
|
+
end
|
128
|
+
|
129
|
+
promise.execute
|
130
|
+
end
|
131
|
+
|
132
|
+
#
|
133
|
+
# Gets the specified private endpoint connection associated with the Cognitive
|
134
|
+
# Services account.
|
135
|
+
#
|
136
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
137
|
+
# is case insensitive.
|
138
|
+
# @param account_name [String] The name of Cognitive Services account.
|
139
|
+
# @param private_endpoint_connection_name [String] The name of the private
|
140
|
+
# endpoint connection associated with the Cognitive Services Account
|
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, account_name, private_endpoint_connection_name, custom_headers:nil)
|
147
|
+
response = get_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
|
148
|
+
response.body unless response.nil?
|
149
|
+
end
|
150
|
+
|
151
|
+
#
|
152
|
+
# Gets the specified private endpoint connection associated with the Cognitive
|
153
|
+
# Services account.
|
154
|
+
#
|
155
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
156
|
+
# is case insensitive.
|
157
|
+
# @param account_name [String] The name of Cognitive Services account.
|
158
|
+
# @param private_endpoint_connection_name [String] The name of the private
|
159
|
+
# endpoint connection associated with the Cognitive Services Account
|
160
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
161
|
+
# will be added to the HTTP request.
|
162
|
+
#
|
163
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
164
|
+
#
|
165
|
+
def get_with_http_info(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
|
166
|
+
get_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
|
167
|
+
end
|
168
|
+
|
169
|
+
#
|
170
|
+
# Gets the specified private endpoint connection associated with the Cognitive
|
171
|
+
# Services account.
|
172
|
+
#
|
173
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
174
|
+
# is case insensitive.
|
175
|
+
# @param account_name [String] The name of Cognitive Services account.
|
176
|
+
# @param private_endpoint_connection_name [String] The name of the private
|
177
|
+
# endpoint connection associated with the Cognitive Services Account
|
178
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
179
|
+
# to the HTTP request.
|
180
|
+
#
|
181
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
182
|
+
#
|
183
|
+
def get_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
|
184
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
185
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
186
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
187
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
188
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
189
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '64'" if !account_name.nil? && account_name.length > 64
|
190
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '2'" if !account_name.nil? && account_name.length < 2
|
191
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
|
192
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
193
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
194
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
195
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
196
|
+
fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
|
197
|
+
|
198
|
+
|
199
|
+
request_headers = {}
|
200
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
201
|
+
|
202
|
+
# Set Headers
|
203
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
204
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
205
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'
|
206
|
+
|
207
|
+
request_url = @base_url || @client.base_url
|
208
|
+
|
209
|
+
options = {
|
210
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
211
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'privateEndpointConnectionName' => private_endpoint_connection_name},
|
212
|
+
query_params: {'api-version' => @client.api_version},
|
213
|
+
headers: request_headers.merge(custom_headers || {}),
|
214
|
+
base_url: request_url
|
215
|
+
}
|
216
|
+
promise = @client.make_request_async(:get, path_template, options)
|
217
|
+
|
218
|
+
promise = promise.then do |result|
|
219
|
+
http_response = result.response
|
220
|
+
status_code = http_response.status
|
221
|
+
response_content = http_response.body
|
222
|
+
unless status_code == 200
|
223
|
+
error_model = JSON.load(response_content)
|
224
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
225
|
+
end
|
226
|
+
|
227
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
228
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
229
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
230
|
+
# Deserialize Response
|
231
|
+
if status_code == 200
|
232
|
+
begin
|
233
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
234
|
+
result_mapper = Azure::CognitiveServices::Mgmt::V2017_04_18::Models::PrivateEndpointConnection.mapper()
|
235
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
236
|
+
rescue Exception => e
|
237
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
result
|
242
|
+
end
|
243
|
+
|
244
|
+
promise.execute
|
245
|
+
end
|
246
|
+
|
247
|
+
#
|
248
|
+
# Update the state of specified private endpoint connection associated with the
|
249
|
+
# Cognitive Services account.
|
250
|
+
#
|
251
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
252
|
+
# is case insensitive.
|
253
|
+
# @param account_name [String] The name of Cognitive Services account.
|
254
|
+
# @param private_endpoint_connection_name [String] The name of the private
|
255
|
+
# endpoint connection associated with the Cognitive Services Account
|
256
|
+
# @param properties [PrivateEndpointConnection] The private endpoint connection
|
257
|
+
# properties.
|
258
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
259
|
+
# will be added to the HTTP request.
|
260
|
+
#
|
261
|
+
# @return [PrivateEndpointConnection] operation results.
|
262
|
+
#
|
263
|
+
def create_or_update(resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers:nil)
|
264
|
+
response = create_or_update_async(resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers:custom_headers).value!
|
265
|
+
response.body unless response.nil?
|
266
|
+
end
|
267
|
+
|
268
|
+
#
|
269
|
+
# Update the state of specified private endpoint connection associated with the
|
270
|
+
# Cognitive Services account.
|
271
|
+
#
|
272
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
273
|
+
# is case insensitive.
|
274
|
+
# @param account_name [String] The name of Cognitive Services account.
|
275
|
+
# @param private_endpoint_connection_name [String] The name of the private
|
276
|
+
# endpoint connection associated with the Cognitive Services Account
|
277
|
+
# @param properties [PrivateEndpointConnection] The private endpoint connection
|
278
|
+
# properties.
|
279
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
280
|
+
# will be added to the HTTP request.
|
281
|
+
#
|
282
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
283
|
+
#
|
284
|
+
def create_or_update_with_http_info(resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers:nil)
|
285
|
+
create_or_update_async(resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers:custom_headers).value!
|
286
|
+
end
|
287
|
+
|
288
|
+
#
|
289
|
+
# Update the state of specified private endpoint connection associated with the
|
290
|
+
# Cognitive Services account.
|
291
|
+
#
|
292
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
293
|
+
# is case insensitive.
|
294
|
+
# @param account_name [String] The name of Cognitive Services account.
|
295
|
+
# @param private_endpoint_connection_name [String] The name of the private
|
296
|
+
# endpoint connection associated with the Cognitive Services Account
|
297
|
+
# @param properties [PrivateEndpointConnection] The private endpoint connection
|
298
|
+
# properties.
|
299
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
300
|
+
# to the HTTP request.
|
301
|
+
#
|
302
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
303
|
+
#
|
304
|
+
def create_or_update_async(resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers:nil)
|
305
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
306
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
307
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
308
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
309
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
310
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '64'" if !account_name.nil? && account_name.length > 64
|
311
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '2'" if !account_name.nil? && account_name.length < 2
|
312
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
|
313
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
314
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
315
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
316
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
317
|
+
fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
|
318
|
+
fail ArgumentError, 'properties is nil' if properties.nil?
|
319
|
+
|
320
|
+
|
321
|
+
request_headers = {}
|
322
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
323
|
+
|
324
|
+
# Set Headers
|
325
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
326
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
327
|
+
|
328
|
+
# Serialize Request
|
329
|
+
request_mapper = Azure::CognitiveServices::Mgmt::V2017_04_18::Models::PrivateEndpointConnection.mapper()
|
330
|
+
request_content = @client.serialize(request_mapper, properties)
|
331
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
332
|
+
|
333
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'
|
334
|
+
|
335
|
+
request_url = @base_url || @client.base_url
|
336
|
+
|
337
|
+
options = {
|
338
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
339
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'privateEndpointConnectionName' => private_endpoint_connection_name},
|
340
|
+
query_params: {'api-version' => @client.api_version},
|
341
|
+
body: request_content,
|
342
|
+
headers: request_headers.merge(custom_headers || {}),
|
343
|
+
base_url: request_url
|
344
|
+
}
|
345
|
+
promise = @client.make_request_async(:put, path_template, options)
|
346
|
+
|
347
|
+
promise = promise.then do |result|
|
348
|
+
http_response = result.response
|
349
|
+
status_code = http_response.status
|
350
|
+
response_content = http_response.body
|
351
|
+
unless status_code == 200
|
352
|
+
error_model = JSON.load(response_content)
|
353
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
354
|
+
end
|
355
|
+
|
356
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
357
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
358
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
359
|
+
# Deserialize Response
|
360
|
+
if status_code == 200
|
361
|
+
begin
|
362
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
363
|
+
result_mapper = Azure::CognitiveServices::Mgmt::V2017_04_18::Models::PrivateEndpointConnection.mapper()
|
364
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
365
|
+
rescue Exception => e
|
366
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
367
|
+
end
|
368
|
+
end
|
369
|
+
|
370
|
+
result
|
371
|
+
end
|
372
|
+
|
373
|
+
promise.execute
|
374
|
+
end
|
375
|
+
|
376
|
+
#
|
377
|
+
# Deletes the specified private endpoint connection associated with the
|
378
|
+
# Cognitive Services account.
|
379
|
+
#
|
380
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
381
|
+
# is case insensitive.
|
382
|
+
# @param account_name [String] The name of Cognitive Services account.
|
383
|
+
# @param private_endpoint_connection_name [String] The name of the private
|
384
|
+
# endpoint connection associated with the Cognitive Services Account
|
385
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
386
|
+
# will be added to the HTTP request.
|
387
|
+
#
|
388
|
+
#
|
389
|
+
def delete(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
|
390
|
+
response = delete_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
|
391
|
+
nil
|
392
|
+
end
|
393
|
+
|
394
|
+
#
|
395
|
+
# Deletes the specified private endpoint connection associated with the
|
396
|
+
# Cognitive Services account.
|
397
|
+
#
|
398
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
399
|
+
# is case insensitive.
|
400
|
+
# @param account_name [String] The name of Cognitive Services account.
|
401
|
+
# @param private_endpoint_connection_name [String] The name of the private
|
402
|
+
# endpoint connection associated with the Cognitive Services Account
|
403
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
404
|
+
# will be added to the HTTP request.
|
405
|
+
#
|
406
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
407
|
+
#
|
408
|
+
def delete_with_http_info(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
|
409
|
+
delete_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
|
410
|
+
end
|
411
|
+
|
412
|
+
#
|
413
|
+
# Deletes the specified private endpoint connection associated with the
|
414
|
+
# Cognitive Services account.
|
415
|
+
#
|
416
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
417
|
+
# is case insensitive.
|
418
|
+
# @param account_name [String] The name of Cognitive Services account.
|
419
|
+
# @param private_endpoint_connection_name [String] The name of the private
|
420
|
+
# endpoint connection associated with the Cognitive Services Account
|
421
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
422
|
+
# to the HTTP request.
|
423
|
+
#
|
424
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
425
|
+
#
|
426
|
+
def delete_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
|
427
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
428
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
429
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
430
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
431
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
432
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '64'" if !account_name.nil? && account_name.length > 64
|
433
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '2'" if !account_name.nil? && account_name.length < 2
|
434
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
|
435
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
436
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
437
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
438
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
439
|
+
fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
|
440
|
+
|
441
|
+
|
442
|
+
request_headers = {}
|
443
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
444
|
+
|
445
|
+
# Set Headers
|
446
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
447
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
448
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'
|
449
|
+
|
450
|
+
request_url = @base_url || @client.base_url
|
451
|
+
|
452
|
+
options = {
|
453
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
454
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'privateEndpointConnectionName' => private_endpoint_connection_name},
|
455
|
+
query_params: {'api-version' => @client.api_version},
|
456
|
+
headers: request_headers.merge(custom_headers || {}),
|
457
|
+
base_url: request_url
|
458
|
+
}
|
459
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
460
|
+
|
461
|
+
promise = promise.then do |result|
|
462
|
+
http_response = result.response
|
463
|
+
status_code = http_response.status
|
464
|
+
response_content = http_response.body
|
465
|
+
unless status_code == 200 || status_code == 204
|
466
|
+
error_model = JSON.load(response_content)
|
467
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
468
|
+
end
|
469
|
+
|
470
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
471
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
472
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
473
|
+
|
474
|
+
result
|
475
|
+
end
|
476
|
+
|
477
|
+
promise.execute
|
478
|
+
end
|
479
|
+
|
480
|
+
end
|
481
|
+
end
|