azure_mgmt_migrate 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate.rb +80 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/assessed_machines.rb +293 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/assessment_options.rb +121 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/assessments.rb +790 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/azure_migrate.rb +160 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/groups.rb +506 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/location.rb +129 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/machines.rb +241 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessed_disk.rb +312 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessed_machine.rb +547 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessed_machine_result_list.rb +55 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessed_network_adapter.rb +197 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessment.rb +367 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessment_options_result_list.rb +78 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessment_result_list.rb +55 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessment_sizing_criterion.rb +16 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessment_stage.rb +17 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessment_status.rb +19 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_disk_size.rb +29 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_disk_suitability_explanation.rb +22 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_disk_type.rb +17 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_hybrid_use_benefit.rb +17 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_location.rb +45 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_network_adapter_suitability_explanation.rb +17 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_offer_code.rb +52 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_pricing_tier.rb +16 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_storage_redundancy.rb +19 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_vm_size.rb +105 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_vm_suitability_explanation.rb +50 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/check_name_availability_parameters.rb +61 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/check_name_availability_result.rb +78 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/cloud_suitability.rb +19 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/currency.rb +40 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/discovery_status.rb +18 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/disk.rb +59 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/download_url.rb +59 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/group.rb +151 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/group_result_list.rb +55 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/machine.rb +317 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/machine_boot_type.rb +17 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/machine_result_list.rb +55 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/name_availability_reason.rb +17 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/network_adapter.rb +67 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/operation.rb +71 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/operation_display.rb +83 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/operation_result_list.rb +55 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/percentile.rb +18 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/project.rb +256 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/project_key.rb +59 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/project_result_list.rb +55 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/provisioning_state.rb +20 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/time_range.rb +17 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/models/vm_family.rb +88 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/module_definition.rb +9 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/operations.rb +113 -0
- data/lib/2018-02-02/generated/azure_mgmt_migrate/projects.rb +756 -0
- data/lib/azure_mgmt_migrate.rb +6 -0
- data/lib/module_definition.rb +7 -0
- data/lib/profiles/latest/migrate_latest_profile_client.rb +40 -0
- data/lib/profiles/latest/migrate_module_definition.rb +8 -0
- data/lib/profiles/latest/modules/migrate_profile_module.rb +255 -0
- data/lib/version.rb +7 -0
- metadata +180 -0
|
@@ -0,0 +1,129 @@
|
|
|
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::Migrate::Mgmt::V2018_02_02
|
|
7
|
+
#
|
|
8
|
+
# Move your workloads to Azure.
|
|
9
|
+
#
|
|
10
|
+
class Location
|
|
11
|
+
include MsRestAzure
|
|
12
|
+
|
|
13
|
+
#
|
|
14
|
+
# Creates and initializes a new instance of the Location class.
|
|
15
|
+
# @param client service class for accessing basic functionality.
|
|
16
|
+
#
|
|
17
|
+
def initialize(client)
|
|
18
|
+
@client = client
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# @return [AzureMigrate] reference to the AzureMigrate
|
|
22
|
+
attr_reader :client
|
|
23
|
+
|
|
24
|
+
#
|
|
25
|
+
# Checks whether the project name is available in the specified region.
|
|
26
|
+
#
|
|
27
|
+
# @param location_name [String] The desired region for the name check.
|
|
28
|
+
# @param parameters [CheckNameAvailabilityParameters] Properties needed to
|
|
29
|
+
# check the availability of a name.
|
|
30
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
31
|
+
# will be added to the HTTP request.
|
|
32
|
+
#
|
|
33
|
+
# @return [CheckNameAvailabilityResult] operation results.
|
|
34
|
+
#
|
|
35
|
+
def check_name_availability(location_name, parameters, custom_headers:nil)
|
|
36
|
+
response = check_name_availability_async(location_name, parameters, custom_headers:custom_headers).value!
|
|
37
|
+
response.body unless response.nil?
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
#
|
|
41
|
+
# Checks whether the project name is available in the specified region.
|
|
42
|
+
#
|
|
43
|
+
# @param location_name [String] The desired region for the name check.
|
|
44
|
+
# @param parameters [CheckNameAvailabilityParameters] Properties needed to
|
|
45
|
+
# check the availability of a name.
|
|
46
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
47
|
+
# will be added to the HTTP request.
|
|
48
|
+
#
|
|
49
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
50
|
+
#
|
|
51
|
+
def check_name_availability_with_http_info(location_name, parameters, custom_headers:nil)
|
|
52
|
+
check_name_availability_async(location_name, parameters, custom_headers:custom_headers).value!
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
#
|
|
56
|
+
# Checks whether the project name is available in the specified region.
|
|
57
|
+
#
|
|
58
|
+
# @param location_name [String] The desired region for the name check.
|
|
59
|
+
# @param parameters [CheckNameAvailabilityParameters] Properties needed to
|
|
60
|
+
# check the availability of a name.
|
|
61
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
62
|
+
# to the HTTP request.
|
|
63
|
+
#
|
|
64
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
65
|
+
#
|
|
66
|
+
def check_name_availability_async(location_name, parameters, custom_headers:nil)
|
|
67
|
+
fail ArgumentError, 'location_name is nil' if location_name.nil?
|
|
68
|
+
@client.api_version = '2018-02-02'
|
|
69
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
70
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
request_headers = {}
|
|
74
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
75
|
+
|
|
76
|
+
# Set Headers
|
|
77
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
78
|
+
request_headers['Accept-Language'] = @client.accept_language unless @client.accept_language.nil?
|
|
79
|
+
|
|
80
|
+
# Serialize Request
|
|
81
|
+
request_mapper = Azure::Migrate::Mgmt::V2018_02_02::Models::CheckNameAvailabilityParameters.mapper()
|
|
82
|
+
request_content = @client.serialize(request_mapper, parameters)
|
|
83
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
84
|
+
|
|
85
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Migrate/locations/{locationName}/checkNameAvailability'
|
|
86
|
+
|
|
87
|
+
request_url = @base_url || @client.base_url
|
|
88
|
+
|
|
89
|
+
options = {
|
|
90
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
91
|
+
path_params: {'locationName' => location_name,'subscriptionId' => @client.subscription_id},
|
|
92
|
+
query_params: {'api-version' => @client.api_version},
|
|
93
|
+
body: request_content,
|
|
94
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
95
|
+
base_url: request_url
|
|
96
|
+
}
|
|
97
|
+
promise = @client.make_request_async(:post, path_template, options)
|
|
98
|
+
|
|
99
|
+
promise = promise.then do |result|
|
|
100
|
+
http_response = result.response
|
|
101
|
+
status_code = http_response.status
|
|
102
|
+
response_content = http_response.body
|
|
103
|
+
unless status_code == 200
|
|
104
|
+
error_model = JSON.load(response_content)
|
|
105
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
109
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
110
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
111
|
+
# Deserialize Response
|
|
112
|
+
if status_code == 200
|
|
113
|
+
begin
|
|
114
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
115
|
+
result_mapper = Azure::Migrate::Mgmt::V2018_02_02::Models::CheckNameAvailabilityResult.mapper()
|
|
116
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
117
|
+
rescue Exception => e
|
|
118
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
result
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
promise.execute
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
end
|
|
129
|
+
end
|
|
@@ -0,0 +1,241 @@
|
|
|
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::Migrate::Mgmt::V2018_02_02
|
|
7
|
+
#
|
|
8
|
+
# Move your workloads to Azure.
|
|
9
|
+
#
|
|
10
|
+
class Machines
|
|
11
|
+
include MsRestAzure
|
|
12
|
+
|
|
13
|
+
#
|
|
14
|
+
# Creates and initializes a new instance of the Machines class.
|
|
15
|
+
# @param client service class for accessing basic functionality.
|
|
16
|
+
#
|
|
17
|
+
def initialize(client)
|
|
18
|
+
@client = client
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# @return [AzureMigrate] reference to the AzureMigrate
|
|
22
|
+
attr_reader :client
|
|
23
|
+
|
|
24
|
+
#
|
|
25
|
+
# Get all machines in the project
|
|
26
|
+
#
|
|
27
|
+
# Get data of all the machines available in the project. Returns a json array
|
|
28
|
+
# of objects of type 'machine' defined in Models section.
|
|
29
|
+
#
|
|
30
|
+
# @param resource_group_name [String] Name of the Azure Resource Group that
|
|
31
|
+
# project is part of.
|
|
32
|
+
# @param project_name [String] Name of the Azure Migrate project.
|
|
33
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
34
|
+
# will be added to the HTTP request.
|
|
35
|
+
#
|
|
36
|
+
# @return [MachineResultList] operation results.
|
|
37
|
+
#
|
|
38
|
+
def list_by_project(resource_group_name, project_name, custom_headers:nil)
|
|
39
|
+
response = list_by_project_async(resource_group_name, project_name, custom_headers:custom_headers).value!
|
|
40
|
+
response.body unless response.nil?
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
#
|
|
44
|
+
# Get all machines in the project
|
|
45
|
+
#
|
|
46
|
+
# Get data of all the machines available in the project. Returns a json array
|
|
47
|
+
# of objects of type 'machine' defined in Models section.
|
|
48
|
+
#
|
|
49
|
+
# @param resource_group_name [String] Name of the Azure Resource Group that
|
|
50
|
+
# project is part of.
|
|
51
|
+
# @param project_name [String] Name of the Azure Migrate project.
|
|
52
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
53
|
+
# will be added to the HTTP request.
|
|
54
|
+
#
|
|
55
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
56
|
+
#
|
|
57
|
+
def list_by_project_with_http_info(resource_group_name, project_name, custom_headers:nil)
|
|
58
|
+
list_by_project_async(resource_group_name, project_name, custom_headers:custom_headers).value!
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
#
|
|
62
|
+
# Get all machines in the project
|
|
63
|
+
#
|
|
64
|
+
# Get data of all the machines available in the project. Returns a json array
|
|
65
|
+
# of objects of type 'machine' defined in Models section.
|
|
66
|
+
#
|
|
67
|
+
# @param resource_group_name [String] Name of the Azure Resource Group that
|
|
68
|
+
# project is part of.
|
|
69
|
+
# @param project_name [String] Name of the Azure Migrate project.
|
|
70
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
71
|
+
# to the HTTP request.
|
|
72
|
+
#
|
|
73
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
74
|
+
#
|
|
75
|
+
def list_by_project_async(resource_group_name, project_name, custom_headers:nil)
|
|
76
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
77
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
78
|
+
fail ArgumentError, 'project_name is nil' if project_name.nil?
|
|
79
|
+
@client.api_version = '2018-02-02'
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
request_headers = {}
|
|
83
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
84
|
+
|
|
85
|
+
# Set Headers
|
|
86
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
87
|
+
request_headers['Accept-Language'] = @client.accept_language unless @client.accept_language.nil?
|
|
88
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/machines'
|
|
89
|
+
|
|
90
|
+
request_url = @base_url || @client.base_url
|
|
91
|
+
|
|
92
|
+
options = {
|
|
93
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
94
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'projectName' => project_name},
|
|
95
|
+
query_params: {'api-version' => @client.api_version},
|
|
96
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
97
|
+
base_url: request_url
|
|
98
|
+
}
|
|
99
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
100
|
+
|
|
101
|
+
promise = promise.then do |result|
|
|
102
|
+
http_response = result.response
|
|
103
|
+
status_code = http_response.status
|
|
104
|
+
response_content = http_response.body
|
|
105
|
+
unless status_code == 200
|
|
106
|
+
error_model = JSON.load(response_content)
|
|
107
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
111
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
112
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
113
|
+
# Deserialize Response
|
|
114
|
+
if status_code == 200
|
|
115
|
+
begin
|
|
116
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
117
|
+
result_mapper = Azure::Migrate::Mgmt::V2018_02_02::Models::MachineResultList.mapper()
|
|
118
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
119
|
+
rescue Exception => e
|
|
120
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
result
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
promise.execute
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
#
|
|
131
|
+
# Get a specific machine.
|
|
132
|
+
#
|
|
133
|
+
# Get the machine with the specified name. Returns a json object of type
|
|
134
|
+
# 'machine' defined in Models section.
|
|
135
|
+
#
|
|
136
|
+
# @param resource_group_name [String] Name of the Azure Resource Group that
|
|
137
|
+
# project is part of.
|
|
138
|
+
# @param project_name [String] Name of the Azure Migrate project.
|
|
139
|
+
# @param machine_name [String] Unique name of a machine in private datacenter.
|
|
140
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
141
|
+
# will be added to the HTTP request.
|
|
142
|
+
#
|
|
143
|
+
# @return [Machine] operation results.
|
|
144
|
+
#
|
|
145
|
+
def get(resource_group_name, project_name, machine_name, custom_headers:nil)
|
|
146
|
+
response = get_async(resource_group_name, project_name, machine_name, custom_headers:custom_headers).value!
|
|
147
|
+
response.body unless response.nil?
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
#
|
|
151
|
+
# Get a specific machine.
|
|
152
|
+
#
|
|
153
|
+
# Get the machine with the specified name. Returns a json object of type
|
|
154
|
+
# 'machine' defined in Models section.
|
|
155
|
+
#
|
|
156
|
+
# @param resource_group_name [String] Name of the Azure Resource Group that
|
|
157
|
+
# project is part of.
|
|
158
|
+
# @param project_name [String] Name of the Azure Migrate project.
|
|
159
|
+
# @param machine_name [String] Unique name of a machine in private datacenter.
|
|
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, project_name, machine_name, custom_headers:nil)
|
|
166
|
+
get_async(resource_group_name, project_name, machine_name, custom_headers:custom_headers).value!
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
#
|
|
170
|
+
# Get a specific machine.
|
|
171
|
+
#
|
|
172
|
+
# Get the machine with the specified name. Returns a json object of type
|
|
173
|
+
# 'machine' defined in Models section.
|
|
174
|
+
#
|
|
175
|
+
# @param resource_group_name [String] Name of the Azure Resource Group that
|
|
176
|
+
# project is part of.
|
|
177
|
+
# @param project_name [String] Name of the Azure Migrate project.
|
|
178
|
+
# @param machine_name [String] Unique name of a machine in private datacenter.
|
|
179
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
180
|
+
# to the HTTP request.
|
|
181
|
+
#
|
|
182
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
183
|
+
#
|
|
184
|
+
def get_async(resource_group_name, project_name, machine_name, custom_headers:nil)
|
|
185
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
186
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
187
|
+
fail ArgumentError, 'project_name is nil' if project_name.nil?
|
|
188
|
+
fail ArgumentError, 'machine_name is nil' if machine_name.nil?
|
|
189
|
+
@client.api_version = '2018-02-02'
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
request_headers = {}
|
|
193
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
194
|
+
|
|
195
|
+
# Set Headers
|
|
196
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
197
|
+
request_headers['Accept-Language'] = @client.accept_language unless @client.accept_language.nil?
|
|
198
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/machines/{machineName}'
|
|
199
|
+
|
|
200
|
+
request_url = @base_url || @client.base_url
|
|
201
|
+
|
|
202
|
+
options = {
|
|
203
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
204
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'projectName' => project_name,'machineName' => machine_name},
|
|
205
|
+
query_params: {'api-version' => @client.api_version},
|
|
206
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
207
|
+
base_url: request_url
|
|
208
|
+
}
|
|
209
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
210
|
+
|
|
211
|
+
promise = promise.then do |result|
|
|
212
|
+
http_response = result.response
|
|
213
|
+
status_code = http_response.status
|
|
214
|
+
response_content = http_response.body
|
|
215
|
+
unless status_code == 200
|
|
216
|
+
error_model = JSON.load(response_content)
|
|
217
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
221
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
222
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
223
|
+
# Deserialize Response
|
|
224
|
+
if status_code == 200
|
|
225
|
+
begin
|
|
226
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
227
|
+
result_mapper = Azure::Migrate::Mgmt::V2018_02_02::Models::Machine.mapper()
|
|
228
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
229
|
+
rescue Exception => e
|
|
230
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
result
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
promise.execute
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
end
|
|
241
|
+
end
|
|
@@ -0,0 +1,312 @@
|
|
|
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::Migrate::Mgmt::V2018_02_02
|
|
7
|
+
module Models
|
|
8
|
+
#
|
|
9
|
+
# A disk assessed for an assessment.
|
|
10
|
+
#
|
|
11
|
+
class AssessedDisk
|
|
12
|
+
|
|
13
|
+
include MsRestAzure
|
|
14
|
+
|
|
15
|
+
# @return [String] Name of the assessed disk.
|
|
16
|
+
attr_accessor :name
|
|
17
|
+
|
|
18
|
+
# @return [Float] Gigabytes of storage provisioned for this disk.
|
|
19
|
+
attr_accessor :gigabytes_provisioned
|
|
20
|
+
|
|
21
|
+
# @return [Float] Gigabytes of storage consumed by this disk.
|
|
22
|
+
attr_accessor :gigabytes_consumed
|
|
23
|
+
|
|
24
|
+
# @return [Float] Disk throughput in MegaBytes per second.
|
|
25
|
+
attr_accessor :megabytes_per_second_of_read
|
|
26
|
+
|
|
27
|
+
# @return [Integer] Expected data points for MegaBytes per second of
|
|
28
|
+
# read.
|
|
29
|
+
attr_accessor :megabytes_per_second_of_read_data_points_expected
|
|
30
|
+
|
|
31
|
+
# @return [Integer] Received data points for MegaBytes per second of
|
|
32
|
+
# read.
|
|
33
|
+
attr_accessor :megabytes_per_second_of_read_data_points_received
|
|
34
|
+
|
|
35
|
+
# @return [Float] Disk throughput in MegaBytes per second.
|
|
36
|
+
attr_accessor :megabytes_per_second_of_write
|
|
37
|
+
|
|
38
|
+
# @return [Integer] Expected data points for MegaBytes per second of
|
|
39
|
+
# write.
|
|
40
|
+
attr_accessor :megabytes_per_second_of_write_data_points_expected
|
|
41
|
+
|
|
42
|
+
# @return [Integer] Received data points for MegaBytes per second of
|
|
43
|
+
# write.
|
|
44
|
+
attr_accessor :megabytes_per_second_of_write_data_points_received
|
|
45
|
+
|
|
46
|
+
# @return [Float] Number of read operations per second for the disk.
|
|
47
|
+
attr_accessor :number_of_read_operations_per_second
|
|
48
|
+
|
|
49
|
+
# @return [Integer] Expected number of data points for read operations
|
|
50
|
+
# per second.
|
|
51
|
+
attr_accessor :number_of_read_operations_per_second_data_points_expected
|
|
52
|
+
|
|
53
|
+
# @return [Integer] Received number of data points for read operations
|
|
54
|
+
# per second.
|
|
55
|
+
attr_accessor :number_of_read_operations_per_second_data_points_received
|
|
56
|
+
|
|
57
|
+
# @return [Float] Number of read and write operations per second for the
|
|
58
|
+
# disk.
|
|
59
|
+
attr_accessor :number_of_write_operations_per_second
|
|
60
|
+
|
|
61
|
+
# @return [Integer] Expected number of data points for write operations
|
|
62
|
+
# per second.
|
|
63
|
+
attr_accessor :number_of_write_operations_per_second_data_points_expected
|
|
64
|
+
|
|
65
|
+
# @return [Integer] Received number of data points for write operations
|
|
66
|
+
# per second.
|
|
67
|
+
attr_accessor :number_of_write_operations_per_second_data_points_received
|
|
68
|
+
|
|
69
|
+
# @return [Float] Estimated aggregate storage cost for a 31-day month for
|
|
70
|
+
# this disk.
|
|
71
|
+
attr_accessor :monthly_storage_cost
|
|
72
|
+
|
|
73
|
+
# @return [AzureDiskType] Storage type selected for this disk. Possible
|
|
74
|
+
# values include: 'Unknown', 'Standard', 'Premium'
|
|
75
|
+
attr_accessor :recommended_disk_type
|
|
76
|
+
|
|
77
|
+
# @return [AzureDiskSize] Recommended Azure size for the disk, given
|
|
78
|
+
# utilization data and preferences set on Assessment. Possible values
|
|
79
|
+
# include: 'Unknown', 'Standard_S4', 'Standard_S6', 'Standard_S10',
|
|
80
|
+
# 'Standard_S20', 'Standard_S30', 'Standard_S40', 'Standard_S50',
|
|
81
|
+
# 'Premium_P4', 'Premium_P6', 'Premium_P10', 'Premium_P20',
|
|
82
|
+
# 'Premium_P30', 'Premium_P40', 'Premium_P50'
|
|
83
|
+
attr_accessor :recommended_disk_size
|
|
84
|
+
|
|
85
|
+
# @return [Integer] Gigabytes of storage provided by the recommended
|
|
86
|
+
# Azure disk size.
|
|
87
|
+
attr_accessor :gigabytes_for_recommended_disk_size
|
|
88
|
+
|
|
89
|
+
# @return [CloudSuitability] Whether this disk is suitable for Azure.
|
|
90
|
+
# Possible values include: 'Unknown', 'NotSuitable', 'Suitable',
|
|
91
|
+
# 'ConditionallySuitable', 'ReadinessUnknown'
|
|
92
|
+
attr_accessor :suitability
|
|
93
|
+
|
|
94
|
+
# @return [AzureDiskSuitabilityExplanation] If disk is suitable, this
|
|
95
|
+
# explains the reasons and mitigation steps. Possible values include:
|
|
96
|
+
# 'Unknown', 'NotApplicable', 'DiskSizeGreaterThanSupported',
|
|
97
|
+
# 'NoSuitableDiskSizeForIops', 'NoSuitableDiskSizeForThroughput',
|
|
98
|
+
# 'NoDiskSizeFoundInSelectedLocation',
|
|
99
|
+
# 'NoDiskSizeFoundForSelectedRedundancy',
|
|
100
|
+
# 'InternalErrorOccurredForDiskEvaluation'
|
|
101
|
+
attr_accessor :suitability_explanation
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
#
|
|
105
|
+
# Mapper for AssessedDisk class as Ruby Hash.
|
|
106
|
+
# This will be used for serialization/deserialization.
|
|
107
|
+
#
|
|
108
|
+
def self.mapper()
|
|
109
|
+
{
|
|
110
|
+
client_side_validation: true,
|
|
111
|
+
required: false,
|
|
112
|
+
serialized_name: 'AssessedDisk',
|
|
113
|
+
type: {
|
|
114
|
+
name: 'Composite',
|
|
115
|
+
class_name: 'AssessedDisk',
|
|
116
|
+
model_properties: {
|
|
117
|
+
name: {
|
|
118
|
+
client_side_validation: true,
|
|
119
|
+
required: false,
|
|
120
|
+
read_only: true,
|
|
121
|
+
serialized_name: 'name',
|
|
122
|
+
type: {
|
|
123
|
+
name: 'String'
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
gigabytes_provisioned: {
|
|
127
|
+
client_side_validation: true,
|
|
128
|
+
required: false,
|
|
129
|
+
read_only: true,
|
|
130
|
+
serialized_name: 'gigabytesProvisioned',
|
|
131
|
+
type: {
|
|
132
|
+
name: 'Double'
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
gigabytes_consumed: {
|
|
136
|
+
client_side_validation: true,
|
|
137
|
+
required: false,
|
|
138
|
+
read_only: true,
|
|
139
|
+
serialized_name: 'gigabytesConsumed',
|
|
140
|
+
type: {
|
|
141
|
+
name: 'Double'
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
megabytes_per_second_of_read: {
|
|
145
|
+
client_side_validation: true,
|
|
146
|
+
required: false,
|
|
147
|
+
read_only: true,
|
|
148
|
+
serialized_name: 'megabytesPerSecondOfRead',
|
|
149
|
+
type: {
|
|
150
|
+
name: 'Double'
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
megabytes_per_second_of_read_data_points_expected: {
|
|
154
|
+
client_side_validation: true,
|
|
155
|
+
required: false,
|
|
156
|
+
read_only: true,
|
|
157
|
+
serialized_name: 'megabytesPerSecondOfReadDataPointsExpected',
|
|
158
|
+
type: {
|
|
159
|
+
name: 'Number'
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
megabytes_per_second_of_read_data_points_received: {
|
|
163
|
+
client_side_validation: true,
|
|
164
|
+
required: false,
|
|
165
|
+
read_only: true,
|
|
166
|
+
serialized_name: 'megabytesPerSecondOfReadDataPointsReceived',
|
|
167
|
+
type: {
|
|
168
|
+
name: 'Number'
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
megabytes_per_second_of_write: {
|
|
172
|
+
client_side_validation: true,
|
|
173
|
+
required: false,
|
|
174
|
+
read_only: true,
|
|
175
|
+
serialized_name: 'megabytesPerSecondOfWrite',
|
|
176
|
+
type: {
|
|
177
|
+
name: 'Double'
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
megabytes_per_second_of_write_data_points_expected: {
|
|
181
|
+
client_side_validation: true,
|
|
182
|
+
required: false,
|
|
183
|
+
read_only: true,
|
|
184
|
+
serialized_name: 'megabytesPerSecondOfWriteDataPointsExpected',
|
|
185
|
+
type: {
|
|
186
|
+
name: 'Number'
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
megabytes_per_second_of_write_data_points_received: {
|
|
190
|
+
client_side_validation: true,
|
|
191
|
+
required: false,
|
|
192
|
+
read_only: true,
|
|
193
|
+
serialized_name: 'megabytesPerSecondOfWriteDataPointsReceived',
|
|
194
|
+
type: {
|
|
195
|
+
name: 'Number'
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
number_of_read_operations_per_second: {
|
|
199
|
+
client_side_validation: true,
|
|
200
|
+
required: false,
|
|
201
|
+
read_only: true,
|
|
202
|
+
serialized_name: 'numberOfReadOperationsPerSecond',
|
|
203
|
+
type: {
|
|
204
|
+
name: 'Double'
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
number_of_read_operations_per_second_data_points_expected: {
|
|
208
|
+
client_side_validation: true,
|
|
209
|
+
required: false,
|
|
210
|
+
read_only: true,
|
|
211
|
+
serialized_name: 'numberOfReadOperationsPerSecondDataPointsExpected',
|
|
212
|
+
type: {
|
|
213
|
+
name: 'Number'
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
number_of_read_operations_per_second_data_points_received: {
|
|
217
|
+
client_side_validation: true,
|
|
218
|
+
required: false,
|
|
219
|
+
read_only: true,
|
|
220
|
+
serialized_name: 'numberOfReadOperationsPerSecondDataPointsReceived',
|
|
221
|
+
type: {
|
|
222
|
+
name: 'Number'
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
number_of_write_operations_per_second: {
|
|
226
|
+
client_side_validation: true,
|
|
227
|
+
required: false,
|
|
228
|
+
read_only: true,
|
|
229
|
+
serialized_name: 'numberOfWriteOperationsPerSecond',
|
|
230
|
+
type: {
|
|
231
|
+
name: 'Double'
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
number_of_write_operations_per_second_data_points_expected: {
|
|
235
|
+
client_side_validation: true,
|
|
236
|
+
required: false,
|
|
237
|
+
read_only: true,
|
|
238
|
+
serialized_name: 'numberOfWriteOperationsPerSecondDataPointsExpected',
|
|
239
|
+
type: {
|
|
240
|
+
name: 'Number'
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
number_of_write_operations_per_second_data_points_received: {
|
|
244
|
+
client_side_validation: true,
|
|
245
|
+
required: false,
|
|
246
|
+
read_only: true,
|
|
247
|
+
serialized_name: 'numberOfWriteOperationsPerSecondDataPointsReceived',
|
|
248
|
+
type: {
|
|
249
|
+
name: 'Number'
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
monthly_storage_cost: {
|
|
253
|
+
client_side_validation: true,
|
|
254
|
+
required: false,
|
|
255
|
+
read_only: true,
|
|
256
|
+
serialized_name: 'monthlyStorageCost',
|
|
257
|
+
type: {
|
|
258
|
+
name: 'Double'
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
recommended_disk_type: {
|
|
262
|
+
client_side_validation: true,
|
|
263
|
+
required: false,
|
|
264
|
+
read_only: true,
|
|
265
|
+
serialized_name: 'recommendedDiskType',
|
|
266
|
+
type: {
|
|
267
|
+
name: 'String'
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
recommended_disk_size: {
|
|
271
|
+
client_side_validation: true,
|
|
272
|
+
required: false,
|
|
273
|
+
read_only: true,
|
|
274
|
+
serialized_name: 'recommendedDiskSize',
|
|
275
|
+
type: {
|
|
276
|
+
name: 'String'
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
gigabytes_for_recommended_disk_size: {
|
|
280
|
+
client_side_validation: true,
|
|
281
|
+
required: false,
|
|
282
|
+
read_only: true,
|
|
283
|
+
serialized_name: 'gigabytesForRecommendedDiskSize',
|
|
284
|
+
type: {
|
|
285
|
+
name: 'Number'
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
suitability: {
|
|
289
|
+
client_side_validation: true,
|
|
290
|
+
required: false,
|
|
291
|
+
read_only: true,
|
|
292
|
+
serialized_name: 'suitability',
|
|
293
|
+
type: {
|
|
294
|
+
name: 'String'
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
suitability_explanation: {
|
|
298
|
+
client_side_validation: true,
|
|
299
|
+
required: false,
|
|
300
|
+
read_only: true,
|
|
301
|
+
serialized_name: 'suitabilityExplanation',
|
|
302
|
+
type: {
|
|
303
|
+
name: 'String'
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
end
|
|
310
|
+
end
|
|
311
|
+
end
|
|
312
|
+
end
|