azure_mgmt_machine_learning_services 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services.rb +67 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/machine_learning_compute.rb +881 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/machine_learning_services_client.rb +139 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/aks.rb +131 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/aks_compute_secrets.rb +85 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/aksproperties.rb +103 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/batch_ai.rb +131 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/batch_aiproperties.rb +69 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/compute.rb +144 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/compute_resource.rb +110 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/compute_secrets.rb +48 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/compute_type.rb +19 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/data_factory.rb +119 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/error_detail.rb +57 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/error_response.rb +77 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/hdinsight.rb +131 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/hdinsight_properties.rb +72 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/identity.rb +72 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/list_workspace_keys_result.rb +85 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/machine_learning_service_error.rb +47 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/operation.rb +58 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/operation_display.rb +80 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/operation_list_result.rb +56 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/paginated_compute_resources_list.rb +101 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/password.rb +60 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/provisioning_state.rb +21 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/registry_list_credentials_result.rb +80 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/resource.rb +124 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/resource_identity_type.rb +15 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/scale_settings.rb +68 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/service_principal_credentials.rb +57 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/ssl_configuration.rb +80 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/system_service.rb +71 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/virtual_machine.rb +131 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/virtual_machine_properties.rb +82 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/virtual_machine_secrets.rb +63 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/virtual_machine_ssh_credentials.rb +79 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/workspace.rb +232 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/workspace_list_result.rb +101 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/workspace_update_parameters.rb +77 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/module_definition.rb +9 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/operations.rb +111 -0
- data/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/workspaces.rb +1033 -0
- data/lib/azure_mgmt_machine_learning_services.rb +6 -0
- data/lib/module_definition.rb +8 -0
- data/lib/profiles/latest/machinelearningservices_latest_profile_client.rb +40 -0
- data/lib/profiles/latest/machinelearningservices_module_definition.rb +8 -0
- data/lib/profiles/latest/modules/machinelearningservices_profile_module.rb +213 -0
- data/lib/version.rb +7 -0
- metadata +170 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ee5d5a070992d90c0d87e1171787f3455a67f281694d4cd29521083a9b6367bc
|
4
|
+
data.tar.gz: 91b8025c83b861433974ad70323410da9890f580b769f4bebc206b45d439bd05
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 48f085957828e04b11e439161f4ce39dd47c5a355bbc7e1037a3c21eeb6132d0df069c75ac9a67a14765671034bdcea83bcf01f9c256ebc32534b1cee191c7b5
|
7
|
+
data.tar.gz: 4eb6fc15fee8f9c6ae59669a437c9dbb0c71b5f801d74f3cbd75539bfe5e026a4752bfd43a451ccf2031e8f8984e62c1f660ff816e36d819dbf93a92a67d91f4
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Microsoft Corporation
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,67 @@
|
|
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
|
+
require 'uri'
|
7
|
+
require 'cgi'
|
8
|
+
require 'date'
|
9
|
+
require 'json'
|
10
|
+
require 'base64'
|
11
|
+
require 'erb'
|
12
|
+
require 'securerandom'
|
13
|
+
require 'time'
|
14
|
+
require 'timeliness'
|
15
|
+
require 'faraday'
|
16
|
+
require 'faraday-cookie_jar'
|
17
|
+
require 'concurrent'
|
18
|
+
require 'ms_rest'
|
19
|
+
require '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/module_definition'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
module Azure::MachineLearningServices::Mgmt::V2018_03_01_preview
|
23
|
+
autoload :Operations, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/operations.rb'
|
24
|
+
autoload :Workspaces, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/workspaces.rb'
|
25
|
+
autoload :MachineLearningCompute, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/machine_learning_compute.rb'
|
26
|
+
autoload :MachineLearningServicesClient, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/machine_learning_services_client.rb'
|
27
|
+
|
28
|
+
module Models
|
29
|
+
autoload :SystemService, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/system_service.rb'
|
30
|
+
autoload :OperationDisplay, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/operation_display.rb'
|
31
|
+
autoload :SslConfiguration, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/ssl_configuration.rb'
|
32
|
+
autoload :OperationListResult, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/operation_list_result.rb'
|
33
|
+
autoload :AKSProperties, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/aksproperties.rb'
|
34
|
+
autoload :WorkspaceUpdateParameters, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/workspace_update_parameters.rb'
|
35
|
+
autoload :PaginatedComputeResourcesList, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/paginated_compute_resources_list.rb'
|
36
|
+
autoload :Operation, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/operation.rb'
|
37
|
+
autoload :Resource, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/resource.rb'
|
38
|
+
autoload :Password, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/password.rb'
|
39
|
+
autoload :RegistryListCredentialsResult, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/registry_list_credentials_result.rb'
|
40
|
+
autoload :ServicePrincipalCredentials, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/service_principal_credentials.rb'
|
41
|
+
autoload :ErrorDetail, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/error_detail.rb'
|
42
|
+
autoload :WorkspaceListResult, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/workspace_list_result.rb'
|
43
|
+
autoload :MachineLearningServiceError, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/machine_learning_service_error.rb'
|
44
|
+
autoload :HDInsightProperties, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/hdinsight_properties.rb'
|
45
|
+
autoload :ScaleSettings, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/scale_settings.rb'
|
46
|
+
autoload :ListWorkspaceKeysResult, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/list_workspace_keys_result.rb'
|
47
|
+
autoload :BatchAIProperties, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/batch_aiproperties.rb'
|
48
|
+
autoload :Compute, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/compute.rb'
|
49
|
+
autoload :ComputeSecrets, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/compute_secrets.rb'
|
50
|
+
autoload :ErrorResponse, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/error_response.rb'
|
51
|
+
autoload :VirtualMachineSshCredentials, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/virtual_machine_ssh_credentials.rb'
|
52
|
+
autoload :Identity, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/identity.rb'
|
53
|
+
autoload :VirtualMachineProperties, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/virtual_machine_properties.rb'
|
54
|
+
autoload :Workspace, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/workspace.rb'
|
55
|
+
autoload :ComputeResource, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/compute_resource.rb'
|
56
|
+
autoload :AKS, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/aks.rb'
|
57
|
+
autoload :BatchAI, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/batch_ai.rb'
|
58
|
+
autoload :VirtualMachine, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/virtual_machine.rb'
|
59
|
+
autoload :HDInsight, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/hdinsight.rb'
|
60
|
+
autoload :DataFactory, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/data_factory.rb'
|
61
|
+
autoload :AksComputeSecrets, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/aks_compute_secrets.rb'
|
62
|
+
autoload :VirtualMachineSecrets, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/virtual_machine_secrets.rb'
|
63
|
+
autoload :ProvisioningState, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/provisioning_state.rb'
|
64
|
+
autoload :ResourceIdentityType, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/resource_identity_type.rb'
|
65
|
+
autoload :ComputeType, '2018-03-01-preview/generated/azure_mgmt_machine_learning_services/models/compute_type.rb'
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,881 @@
|
|
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::MachineLearningServices::Mgmt::V2018_03_01_preview
|
7
|
+
#
|
8
|
+
# These APIs allow end users to operate on Azure Machine Learning Workspace
|
9
|
+
# resources.
|
10
|
+
#
|
11
|
+
class MachineLearningCompute
|
12
|
+
include MsRestAzure
|
13
|
+
|
14
|
+
#
|
15
|
+
# Creates and initializes a new instance of the MachineLearningCompute class.
|
16
|
+
# @param client service class for accessing basic functionality.
|
17
|
+
#
|
18
|
+
def initialize(client)
|
19
|
+
@client = client
|
20
|
+
end
|
21
|
+
|
22
|
+
# @return [MachineLearningServicesClient] reference to the MachineLearningServicesClient
|
23
|
+
attr_reader :client
|
24
|
+
|
25
|
+
#
|
26
|
+
# Gets computes in specified workspace.
|
27
|
+
#
|
28
|
+
# @param resource_group_name [String] Name of the resource group in which
|
29
|
+
# workspace is located.
|
30
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
31
|
+
# @param skiptoken [String] Continuation token for pagination.
|
32
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
33
|
+
# will be added to the HTTP request.
|
34
|
+
#
|
35
|
+
# @return [Array<ComputeResource>] operation results.
|
36
|
+
#
|
37
|
+
def list_by_workspace(resource_group_name, workspace_name, skiptoken:nil, custom_headers:nil)
|
38
|
+
first_page = list_by_workspace_as_lazy(resource_group_name, workspace_name, skiptoken:skiptoken, custom_headers:custom_headers)
|
39
|
+
first_page.get_all_items
|
40
|
+
end
|
41
|
+
|
42
|
+
#
|
43
|
+
# Gets computes in specified workspace.
|
44
|
+
#
|
45
|
+
# @param resource_group_name [String] Name of the resource group in which
|
46
|
+
# workspace is located.
|
47
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
48
|
+
# @param skiptoken [String] Continuation token for pagination.
|
49
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
50
|
+
# will be added to the HTTP request.
|
51
|
+
#
|
52
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
53
|
+
#
|
54
|
+
def list_by_workspace_with_http_info(resource_group_name, workspace_name, skiptoken:nil, custom_headers:nil)
|
55
|
+
list_by_workspace_async(resource_group_name, workspace_name, skiptoken:skiptoken, custom_headers:custom_headers).value!
|
56
|
+
end
|
57
|
+
|
58
|
+
#
|
59
|
+
# Gets computes in specified workspace.
|
60
|
+
#
|
61
|
+
# @param resource_group_name [String] Name of the resource group in which
|
62
|
+
# workspace is located.
|
63
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
64
|
+
# @param skiptoken [String] Continuation token for pagination.
|
65
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
66
|
+
# to the HTTP request.
|
67
|
+
#
|
68
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
69
|
+
#
|
70
|
+
def list_by_workspace_async(resource_group_name, workspace_name, skiptoken:nil, custom_headers:nil)
|
71
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
72
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
73
|
+
fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
|
74
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
75
|
+
|
76
|
+
|
77
|
+
request_headers = {}
|
78
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
79
|
+
|
80
|
+
# Set Headers
|
81
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
82
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
83
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'
|
84
|
+
|
85
|
+
request_url = @base_url || @client.base_url
|
86
|
+
|
87
|
+
options = {
|
88
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
89
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name},
|
90
|
+
query_params: {'api-version' => @client.api_version,'$skiptoken' => skiptoken},
|
91
|
+
headers: request_headers.merge(custom_headers || {}),
|
92
|
+
base_url: request_url
|
93
|
+
}
|
94
|
+
promise = @client.make_request_async(:get, path_template, options)
|
95
|
+
|
96
|
+
promise = promise.then do |result|
|
97
|
+
http_response = result.response
|
98
|
+
status_code = http_response.status
|
99
|
+
response_content = http_response.body
|
100
|
+
unless status_code == 200
|
101
|
+
error_model = JSON.load(response_content)
|
102
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
103
|
+
end
|
104
|
+
|
105
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
106
|
+
# Deserialize Response
|
107
|
+
if status_code == 200
|
108
|
+
begin
|
109
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
110
|
+
result_mapper = Azure::MachineLearningServices::Mgmt::V2018_03_01_preview::Models::PaginatedComputeResourcesList.mapper()
|
111
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
112
|
+
rescue Exception => e
|
113
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
result
|
118
|
+
end
|
119
|
+
|
120
|
+
promise.execute
|
121
|
+
end
|
122
|
+
|
123
|
+
#
|
124
|
+
# Gets compute definition by its name. Any secrets (storage keys, service
|
125
|
+
# credentials, etc) are not returned - use 'keys' nested resource to get them.
|
126
|
+
#
|
127
|
+
# @param resource_group_name [String] Name of the resource group in which
|
128
|
+
# workspace is located.
|
129
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
130
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
131
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
132
|
+
# will be added to the HTTP request.
|
133
|
+
#
|
134
|
+
# @return [ComputeResource] operation results.
|
135
|
+
#
|
136
|
+
def get(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
137
|
+
response = get_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
|
138
|
+
response.body unless response.nil?
|
139
|
+
end
|
140
|
+
|
141
|
+
#
|
142
|
+
# Gets compute definition by its name. Any secrets (storage keys, service
|
143
|
+
# credentials, etc) are not returned - use 'keys' nested resource to get them.
|
144
|
+
#
|
145
|
+
# @param resource_group_name [String] Name of the resource group in which
|
146
|
+
# workspace is located.
|
147
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
148
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
149
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
150
|
+
# will be added to the HTTP request.
|
151
|
+
#
|
152
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
153
|
+
#
|
154
|
+
def get_with_http_info(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
155
|
+
get_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
|
156
|
+
end
|
157
|
+
|
158
|
+
#
|
159
|
+
# Gets compute definition by its name. Any secrets (storage keys, service
|
160
|
+
# credentials, etc) are not returned - use 'keys' nested resource to get them.
|
161
|
+
#
|
162
|
+
# @param resource_group_name [String] Name of the resource group in which
|
163
|
+
# workspace is located.
|
164
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
165
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
166
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
167
|
+
# to the HTTP request.
|
168
|
+
#
|
169
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
170
|
+
#
|
171
|
+
def get_async(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
172
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
173
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
174
|
+
fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
|
175
|
+
fail ArgumentError, 'compute_name is nil' if compute_name.nil?
|
176
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
177
|
+
|
178
|
+
|
179
|
+
request_headers = {}
|
180
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
181
|
+
|
182
|
+
# Set Headers
|
183
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
184
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
185
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'
|
186
|
+
|
187
|
+
request_url = @base_url || @client.base_url
|
188
|
+
|
189
|
+
options = {
|
190
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
191
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'computeName' => compute_name},
|
192
|
+
query_params: {'api-version' => @client.api_version},
|
193
|
+
headers: request_headers.merge(custom_headers || {}),
|
194
|
+
base_url: request_url
|
195
|
+
}
|
196
|
+
promise = @client.make_request_async(:get, path_template, options)
|
197
|
+
|
198
|
+
promise = promise.then do |result|
|
199
|
+
http_response = result.response
|
200
|
+
status_code = http_response.status
|
201
|
+
response_content = http_response.body
|
202
|
+
unless status_code == 200
|
203
|
+
error_model = JSON.load(response_content)
|
204
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
205
|
+
end
|
206
|
+
|
207
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
208
|
+
# Deserialize Response
|
209
|
+
if status_code == 200
|
210
|
+
begin
|
211
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
212
|
+
result_mapper = Azure::MachineLearningServices::Mgmt::V2018_03_01_preview::Models::ComputeResource.mapper()
|
213
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
214
|
+
rescue Exception => e
|
215
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
result
|
220
|
+
end
|
221
|
+
|
222
|
+
promise.execute
|
223
|
+
end
|
224
|
+
|
225
|
+
#
|
226
|
+
# Creates or updates compute. This call will overwrite a compute if it exists.
|
227
|
+
# This is a nonrecoverable operation. If your intent is to create a new
|
228
|
+
# compute, do a GET first to verify that it does not exist yet.
|
229
|
+
#
|
230
|
+
# @param resource_group_name [String] Name of the resource group in which
|
231
|
+
# workspace is located.
|
232
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
233
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
234
|
+
# @param parameters [ComputeResource] Payload with Machine Learning compute
|
235
|
+
# definition.
|
236
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
237
|
+
# will be added to the HTTP request.
|
238
|
+
#
|
239
|
+
# @return [ComputeResource] operation results.
|
240
|
+
#
|
241
|
+
def create_or_update(resource_group_name, workspace_name, compute_name, parameters, custom_headers:nil)
|
242
|
+
response = create_or_update_async(resource_group_name, workspace_name, compute_name, parameters, custom_headers:custom_headers).value!
|
243
|
+
response.body unless response.nil?
|
244
|
+
end
|
245
|
+
|
246
|
+
#
|
247
|
+
# @param resource_group_name [String] Name of the resource group in which
|
248
|
+
# workspace is located.
|
249
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
250
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
251
|
+
# @param parameters [ComputeResource] Payload with Machine Learning compute
|
252
|
+
# definition.
|
253
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
254
|
+
# will be added to the HTTP request.
|
255
|
+
#
|
256
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
257
|
+
# response.
|
258
|
+
#
|
259
|
+
def create_or_update_async(resource_group_name, workspace_name, compute_name, parameters, custom_headers:nil)
|
260
|
+
# Send request
|
261
|
+
promise = begin_create_or_update_async(resource_group_name, workspace_name, compute_name, parameters, custom_headers:custom_headers)
|
262
|
+
|
263
|
+
promise = promise.then do |response|
|
264
|
+
# Defining deserialization method.
|
265
|
+
deserialize_method = lambda do |parsed_response|
|
266
|
+
result_mapper = Azure::MachineLearningServices::Mgmt::V2018_03_01_preview::Models::ComputeResource.mapper()
|
267
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
268
|
+
end
|
269
|
+
|
270
|
+
# Waiting for response.
|
271
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
272
|
+
end
|
273
|
+
|
274
|
+
promise
|
275
|
+
end
|
276
|
+
|
277
|
+
#
|
278
|
+
# Deletes specified Machine Learning compute.
|
279
|
+
#
|
280
|
+
# @param resource_group_name [String] Name of the resource group in which
|
281
|
+
# workspace is located.
|
282
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
283
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
284
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
285
|
+
# will be added to the HTTP request.
|
286
|
+
#
|
287
|
+
def delete(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
288
|
+
response = delete_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
|
289
|
+
nil
|
290
|
+
end
|
291
|
+
|
292
|
+
#
|
293
|
+
# @param resource_group_name [String] Name of the resource group in which
|
294
|
+
# workspace is located.
|
295
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
296
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
297
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
298
|
+
# will be added to the HTTP request.
|
299
|
+
#
|
300
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
301
|
+
# response.
|
302
|
+
#
|
303
|
+
def delete_async(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
304
|
+
# Send request
|
305
|
+
promise = begin_delete_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers)
|
306
|
+
|
307
|
+
promise = promise.then do |response|
|
308
|
+
# Defining deserialization method.
|
309
|
+
deserialize_method = lambda do |parsed_response|
|
310
|
+
end
|
311
|
+
|
312
|
+
# Waiting for response.
|
313
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
314
|
+
end
|
315
|
+
|
316
|
+
promise
|
317
|
+
end
|
318
|
+
|
319
|
+
#
|
320
|
+
# System Update On Machine Learning compute.
|
321
|
+
#
|
322
|
+
# @param resource_group_name [String] Name of the resource group in which
|
323
|
+
# workspace is located.
|
324
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
325
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
326
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
327
|
+
# will be added to the HTTP request.
|
328
|
+
#
|
329
|
+
def system_update(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
330
|
+
response = system_update_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
|
331
|
+
nil
|
332
|
+
end
|
333
|
+
|
334
|
+
#
|
335
|
+
# @param resource_group_name [String] Name of the resource group in which
|
336
|
+
# workspace is located.
|
337
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
338
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
339
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
340
|
+
# will be added to the HTTP request.
|
341
|
+
#
|
342
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
343
|
+
# response.
|
344
|
+
#
|
345
|
+
def system_update_async(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
346
|
+
# Send request
|
347
|
+
promise = begin_system_update_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers)
|
348
|
+
|
349
|
+
promise = promise.then do |response|
|
350
|
+
# Defining deserialization method.
|
351
|
+
deserialize_method = lambda do |parsed_response|
|
352
|
+
end
|
353
|
+
|
354
|
+
# Waiting for response.
|
355
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
356
|
+
end
|
357
|
+
|
358
|
+
promise
|
359
|
+
end
|
360
|
+
|
361
|
+
#
|
362
|
+
# Gets secrets related to Machine Learning compute (storage keys, service
|
363
|
+
# credentials, etc).
|
364
|
+
#
|
365
|
+
# @param resource_group_name [String] Name of the resource group in which
|
366
|
+
# workspace is located.
|
367
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
368
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
369
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
370
|
+
# will be added to the HTTP request.
|
371
|
+
#
|
372
|
+
# @return [ComputeSecrets] operation results.
|
373
|
+
#
|
374
|
+
def list_keys(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
375
|
+
response = list_keys_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
|
376
|
+
response.body unless response.nil?
|
377
|
+
end
|
378
|
+
|
379
|
+
#
|
380
|
+
# Gets secrets related to Machine Learning compute (storage keys, service
|
381
|
+
# credentials, etc).
|
382
|
+
#
|
383
|
+
# @param resource_group_name [String] Name of the resource group in which
|
384
|
+
# workspace is located.
|
385
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
386
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
387
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
388
|
+
# will be added to the HTTP request.
|
389
|
+
#
|
390
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
391
|
+
#
|
392
|
+
def list_keys_with_http_info(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
393
|
+
list_keys_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
|
394
|
+
end
|
395
|
+
|
396
|
+
#
|
397
|
+
# Gets secrets related to Machine Learning compute (storage keys, service
|
398
|
+
# credentials, etc).
|
399
|
+
#
|
400
|
+
# @param resource_group_name [String] Name of the resource group in which
|
401
|
+
# workspace is located.
|
402
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
403
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
404
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
405
|
+
# to the HTTP request.
|
406
|
+
#
|
407
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
408
|
+
#
|
409
|
+
def list_keys_async(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
410
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
411
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
412
|
+
fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
|
413
|
+
fail ArgumentError, 'compute_name is nil' if compute_name.nil?
|
414
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
415
|
+
|
416
|
+
|
417
|
+
request_headers = {}
|
418
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
419
|
+
|
420
|
+
# Set Headers
|
421
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
422
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
423
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'
|
424
|
+
|
425
|
+
request_url = @base_url || @client.base_url
|
426
|
+
|
427
|
+
options = {
|
428
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
429
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'computeName' => compute_name},
|
430
|
+
query_params: {'api-version' => @client.api_version},
|
431
|
+
headers: request_headers.merge(custom_headers || {}),
|
432
|
+
base_url: request_url
|
433
|
+
}
|
434
|
+
promise = @client.make_request_async(:post, path_template, options)
|
435
|
+
|
436
|
+
promise = promise.then do |result|
|
437
|
+
http_response = result.response
|
438
|
+
status_code = http_response.status
|
439
|
+
response_content = http_response.body
|
440
|
+
unless status_code == 200
|
441
|
+
error_model = JSON.load(response_content)
|
442
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
443
|
+
end
|
444
|
+
|
445
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
446
|
+
# Deserialize Response
|
447
|
+
if status_code == 200
|
448
|
+
begin
|
449
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
450
|
+
result_mapper = Azure::MachineLearningServices::Mgmt::V2018_03_01_preview::Models::ComputeSecrets.mapper()
|
451
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
452
|
+
rescue Exception => e
|
453
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
454
|
+
end
|
455
|
+
end
|
456
|
+
|
457
|
+
result
|
458
|
+
end
|
459
|
+
|
460
|
+
promise.execute
|
461
|
+
end
|
462
|
+
|
463
|
+
#
|
464
|
+
# Creates or updates compute. This call will overwrite a compute if it exists.
|
465
|
+
# This is a nonrecoverable operation. If your intent is to create a new
|
466
|
+
# compute, do a GET first to verify that it does not exist yet.
|
467
|
+
#
|
468
|
+
# @param resource_group_name [String] Name of the resource group in which
|
469
|
+
# workspace is located.
|
470
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
471
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
472
|
+
# @param parameters [ComputeResource] Payload with Machine Learning compute
|
473
|
+
# definition.
|
474
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
475
|
+
# will be added to the HTTP request.
|
476
|
+
#
|
477
|
+
# @return [ComputeResource] operation results.
|
478
|
+
#
|
479
|
+
def begin_create_or_update(resource_group_name, workspace_name, compute_name, parameters, custom_headers:nil)
|
480
|
+
response = begin_create_or_update_async(resource_group_name, workspace_name, compute_name, parameters, custom_headers:custom_headers).value!
|
481
|
+
response.body unless response.nil?
|
482
|
+
end
|
483
|
+
|
484
|
+
#
|
485
|
+
# Creates or updates compute. This call will overwrite a compute if it exists.
|
486
|
+
# This is a nonrecoverable operation. If your intent is to create a new
|
487
|
+
# compute, do a GET first to verify that it does not exist yet.
|
488
|
+
#
|
489
|
+
# @param resource_group_name [String] Name of the resource group in which
|
490
|
+
# workspace is located.
|
491
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
492
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
493
|
+
# @param parameters [ComputeResource] Payload with Machine Learning compute
|
494
|
+
# definition.
|
495
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
496
|
+
# will be added to the HTTP request.
|
497
|
+
#
|
498
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
499
|
+
#
|
500
|
+
def begin_create_or_update_with_http_info(resource_group_name, workspace_name, compute_name, parameters, custom_headers:nil)
|
501
|
+
begin_create_or_update_async(resource_group_name, workspace_name, compute_name, parameters, custom_headers:custom_headers).value!
|
502
|
+
end
|
503
|
+
|
504
|
+
#
|
505
|
+
# Creates or updates compute. This call will overwrite a compute if it exists.
|
506
|
+
# This is a nonrecoverable operation. If your intent is to create a new
|
507
|
+
# compute, do a GET first to verify that it does not exist yet.
|
508
|
+
#
|
509
|
+
# @param resource_group_name [String] Name of the resource group in which
|
510
|
+
# workspace is located.
|
511
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
512
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
513
|
+
# @param parameters [ComputeResource] Payload with Machine Learning compute
|
514
|
+
# definition.
|
515
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
516
|
+
# to the HTTP request.
|
517
|
+
#
|
518
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
519
|
+
#
|
520
|
+
def begin_create_or_update_async(resource_group_name, workspace_name, compute_name, parameters, custom_headers:nil)
|
521
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
522
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
523
|
+
fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
|
524
|
+
fail ArgumentError, 'compute_name is nil' if compute_name.nil?
|
525
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
526
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
527
|
+
|
528
|
+
|
529
|
+
request_headers = {}
|
530
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
531
|
+
|
532
|
+
# Set Headers
|
533
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
534
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
535
|
+
|
536
|
+
# Serialize Request
|
537
|
+
request_mapper = Azure::MachineLearningServices::Mgmt::V2018_03_01_preview::Models::ComputeResource.mapper()
|
538
|
+
request_content = @client.serialize(request_mapper, parameters)
|
539
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
540
|
+
|
541
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'
|
542
|
+
|
543
|
+
request_url = @base_url || @client.base_url
|
544
|
+
|
545
|
+
options = {
|
546
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
547
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'computeName' => compute_name},
|
548
|
+
query_params: {'api-version' => @client.api_version},
|
549
|
+
body: request_content,
|
550
|
+
headers: request_headers.merge(custom_headers || {}),
|
551
|
+
base_url: request_url
|
552
|
+
}
|
553
|
+
promise = @client.make_request_async(:put, path_template, options)
|
554
|
+
|
555
|
+
promise = promise.then do |result|
|
556
|
+
http_response = result.response
|
557
|
+
status_code = http_response.status
|
558
|
+
response_content = http_response.body
|
559
|
+
unless status_code == 200 || status_code == 201
|
560
|
+
error_model = JSON.load(response_content)
|
561
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
562
|
+
end
|
563
|
+
|
564
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
565
|
+
# Deserialize Response
|
566
|
+
if status_code == 200
|
567
|
+
begin
|
568
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
569
|
+
result_mapper = Azure::MachineLearningServices::Mgmt::V2018_03_01_preview::Models::ComputeResource.mapper()
|
570
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
571
|
+
rescue Exception => e
|
572
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
573
|
+
end
|
574
|
+
end
|
575
|
+
# Deserialize Response
|
576
|
+
if status_code == 201
|
577
|
+
begin
|
578
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
579
|
+
result_mapper = Azure::MachineLearningServices::Mgmt::V2018_03_01_preview::Models::ComputeResource.mapper()
|
580
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
581
|
+
rescue Exception => e
|
582
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
583
|
+
end
|
584
|
+
end
|
585
|
+
|
586
|
+
result
|
587
|
+
end
|
588
|
+
|
589
|
+
promise.execute
|
590
|
+
end
|
591
|
+
|
592
|
+
#
|
593
|
+
# Deletes specified Machine Learning compute.
|
594
|
+
#
|
595
|
+
# @param resource_group_name [String] Name of the resource group in which
|
596
|
+
# workspace is located.
|
597
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
598
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
599
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
600
|
+
# will be added to the HTTP request.
|
601
|
+
#
|
602
|
+
#
|
603
|
+
def begin_delete(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
604
|
+
response = begin_delete_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
|
605
|
+
nil
|
606
|
+
end
|
607
|
+
|
608
|
+
#
|
609
|
+
# Deletes specified Machine Learning compute.
|
610
|
+
#
|
611
|
+
# @param resource_group_name [String] Name of the resource group in which
|
612
|
+
# workspace is located.
|
613
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
614
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
615
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
616
|
+
# will be added to the HTTP request.
|
617
|
+
#
|
618
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
619
|
+
#
|
620
|
+
def begin_delete_with_http_info(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
621
|
+
begin_delete_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
|
622
|
+
end
|
623
|
+
|
624
|
+
#
|
625
|
+
# Deletes specified Machine Learning compute.
|
626
|
+
#
|
627
|
+
# @param resource_group_name [String] Name of the resource group in which
|
628
|
+
# workspace is located.
|
629
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
630
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
631
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
632
|
+
# to the HTTP request.
|
633
|
+
#
|
634
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
635
|
+
#
|
636
|
+
def begin_delete_async(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
637
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
638
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
639
|
+
fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
|
640
|
+
fail ArgumentError, 'compute_name is nil' if compute_name.nil?
|
641
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
642
|
+
|
643
|
+
|
644
|
+
request_headers = {}
|
645
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
646
|
+
|
647
|
+
# Set Headers
|
648
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
649
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
650
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'
|
651
|
+
|
652
|
+
request_url = @base_url || @client.base_url
|
653
|
+
|
654
|
+
options = {
|
655
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
656
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'computeName' => compute_name},
|
657
|
+
query_params: {'api-version' => @client.api_version},
|
658
|
+
headers: request_headers.merge(custom_headers || {}),
|
659
|
+
base_url: request_url
|
660
|
+
}
|
661
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
662
|
+
|
663
|
+
promise = promise.then do |result|
|
664
|
+
http_response = result.response
|
665
|
+
status_code = http_response.status
|
666
|
+
response_content = http_response.body
|
667
|
+
unless status_code == 200 || status_code == 202
|
668
|
+
error_model = JSON.load(response_content)
|
669
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
670
|
+
end
|
671
|
+
|
672
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
673
|
+
|
674
|
+
result
|
675
|
+
end
|
676
|
+
|
677
|
+
promise.execute
|
678
|
+
end
|
679
|
+
|
680
|
+
#
|
681
|
+
# System Update On Machine Learning compute.
|
682
|
+
#
|
683
|
+
# @param resource_group_name [String] Name of the resource group in which
|
684
|
+
# workspace is located.
|
685
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
686
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
687
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
688
|
+
# will be added to the HTTP request.
|
689
|
+
#
|
690
|
+
#
|
691
|
+
def begin_system_update(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
692
|
+
response = begin_system_update_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
|
693
|
+
nil
|
694
|
+
end
|
695
|
+
|
696
|
+
#
|
697
|
+
# System Update On Machine Learning compute.
|
698
|
+
#
|
699
|
+
# @param resource_group_name [String] Name of the resource group in which
|
700
|
+
# workspace is located.
|
701
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
702
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
703
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
704
|
+
# will be added to the HTTP request.
|
705
|
+
#
|
706
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
707
|
+
#
|
708
|
+
def begin_system_update_with_http_info(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
709
|
+
begin_system_update_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
|
710
|
+
end
|
711
|
+
|
712
|
+
#
|
713
|
+
# System Update On Machine Learning compute.
|
714
|
+
#
|
715
|
+
# @param resource_group_name [String] Name of the resource group in which
|
716
|
+
# workspace is located.
|
717
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
718
|
+
# @param compute_name [String] Name of the Azure Machine Learning compute.
|
719
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
720
|
+
# to the HTTP request.
|
721
|
+
#
|
722
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
723
|
+
#
|
724
|
+
def begin_system_update_async(resource_group_name, workspace_name, compute_name, custom_headers:nil)
|
725
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
726
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
727
|
+
fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
|
728
|
+
fail ArgumentError, 'compute_name is nil' if compute_name.nil?
|
729
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
730
|
+
|
731
|
+
|
732
|
+
request_headers = {}
|
733
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
734
|
+
|
735
|
+
# Set Headers
|
736
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
737
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
738
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'
|
739
|
+
|
740
|
+
request_url = @base_url || @client.base_url
|
741
|
+
|
742
|
+
options = {
|
743
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
744
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'computeName' => compute_name},
|
745
|
+
query_params: {'api-version' => @client.api_version},
|
746
|
+
headers: request_headers.merge(custom_headers || {}),
|
747
|
+
base_url: request_url
|
748
|
+
}
|
749
|
+
promise = @client.make_request_async(:post, path_template, options)
|
750
|
+
|
751
|
+
promise = promise.then do |result|
|
752
|
+
http_response = result.response
|
753
|
+
status_code = http_response.status
|
754
|
+
response_content = http_response.body
|
755
|
+
unless status_code == 200 || status_code == 202
|
756
|
+
error_model = JSON.load(response_content)
|
757
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
758
|
+
end
|
759
|
+
|
760
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
761
|
+
|
762
|
+
result
|
763
|
+
end
|
764
|
+
|
765
|
+
promise.execute
|
766
|
+
end
|
767
|
+
|
768
|
+
#
|
769
|
+
# Gets computes in specified workspace.
|
770
|
+
#
|
771
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
772
|
+
# to List operation.
|
773
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
774
|
+
# will be added to the HTTP request.
|
775
|
+
#
|
776
|
+
# @return [PaginatedComputeResourcesList] operation results.
|
777
|
+
#
|
778
|
+
def list_by_workspace_next(next_page_link, custom_headers:nil)
|
779
|
+
response = list_by_workspace_next_async(next_page_link, custom_headers:custom_headers).value!
|
780
|
+
response.body unless response.nil?
|
781
|
+
end
|
782
|
+
|
783
|
+
#
|
784
|
+
# Gets computes in specified workspace.
|
785
|
+
#
|
786
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
787
|
+
# to List operation.
|
788
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
789
|
+
# will be added to the HTTP request.
|
790
|
+
#
|
791
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
792
|
+
#
|
793
|
+
def list_by_workspace_next_with_http_info(next_page_link, custom_headers:nil)
|
794
|
+
list_by_workspace_next_async(next_page_link, custom_headers:custom_headers).value!
|
795
|
+
end
|
796
|
+
|
797
|
+
#
|
798
|
+
# Gets computes in specified workspace.
|
799
|
+
#
|
800
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
801
|
+
# to List operation.
|
802
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
803
|
+
# to the HTTP request.
|
804
|
+
#
|
805
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
806
|
+
#
|
807
|
+
def list_by_workspace_next_async(next_page_link, custom_headers:nil)
|
808
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
809
|
+
|
810
|
+
|
811
|
+
request_headers = {}
|
812
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
813
|
+
|
814
|
+
# Set Headers
|
815
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
816
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
817
|
+
path_template = '{nextLink}'
|
818
|
+
|
819
|
+
request_url = @base_url || @client.base_url
|
820
|
+
|
821
|
+
options = {
|
822
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
823
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
824
|
+
headers: request_headers.merge(custom_headers || {}),
|
825
|
+
base_url: request_url
|
826
|
+
}
|
827
|
+
promise = @client.make_request_async(:get, path_template, options)
|
828
|
+
|
829
|
+
promise = promise.then do |result|
|
830
|
+
http_response = result.response
|
831
|
+
status_code = http_response.status
|
832
|
+
response_content = http_response.body
|
833
|
+
unless status_code == 200
|
834
|
+
error_model = JSON.load(response_content)
|
835
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
836
|
+
end
|
837
|
+
|
838
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
839
|
+
# Deserialize Response
|
840
|
+
if status_code == 200
|
841
|
+
begin
|
842
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
843
|
+
result_mapper = Azure::MachineLearningServices::Mgmt::V2018_03_01_preview::Models::PaginatedComputeResourcesList.mapper()
|
844
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
845
|
+
rescue Exception => e
|
846
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
847
|
+
end
|
848
|
+
end
|
849
|
+
|
850
|
+
result
|
851
|
+
end
|
852
|
+
|
853
|
+
promise.execute
|
854
|
+
end
|
855
|
+
|
856
|
+
#
|
857
|
+
# Gets computes in specified workspace.
|
858
|
+
#
|
859
|
+
# @param resource_group_name [String] Name of the resource group in which
|
860
|
+
# workspace is located.
|
861
|
+
# @param workspace_name [String] Name of Azure Machine Learning workspace.
|
862
|
+
# @param skiptoken [String] Continuation token for pagination.
|
863
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
864
|
+
# will be added to the HTTP request.
|
865
|
+
#
|
866
|
+
# @return [PaginatedComputeResourcesList] which provide lazy access to pages of
|
867
|
+
# the response.
|
868
|
+
#
|
869
|
+
def list_by_workspace_as_lazy(resource_group_name, workspace_name, skiptoken:nil, custom_headers:nil)
|
870
|
+
response = list_by_workspace_async(resource_group_name, workspace_name, skiptoken:skiptoken, custom_headers:custom_headers).value!
|
871
|
+
unless response.nil?
|
872
|
+
page = response.body
|
873
|
+
page.next_method = Proc.new do |next_page_link|
|
874
|
+
list_by_workspace_next_async(next_page_link, custom_headers:custom_headers)
|
875
|
+
end
|
876
|
+
page
|
877
|
+
end
|
878
|
+
end
|
879
|
+
|
880
|
+
end
|
881
|
+
end
|