azure_mgmt_migrate 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2018-02-02/generated/azure_mgmt_migrate.rb +80 -0
  4. data/lib/2018-02-02/generated/azure_mgmt_migrate/assessed_machines.rb +293 -0
  5. data/lib/2018-02-02/generated/azure_mgmt_migrate/assessment_options.rb +121 -0
  6. data/lib/2018-02-02/generated/azure_mgmt_migrate/assessments.rb +790 -0
  7. data/lib/2018-02-02/generated/azure_mgmt_migrate/azure_migrate.rb +160 -0
  8. data/lib/2018-02-02/generated/azure_mgmt_migrate/groups.rb +506 -0
  9. data/lib/2018-02-02/generated/azure_mgmt_migrate/location.rb +129 -0
  10. data/lib/2018-02-02/generated/azure_mgmt_migrate/machines.rb +241 -0
  11. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessed_disk.rb +312 -0
  12. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessed_machine.rb +547 -0
  13. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessed_machine_result_list.rb +55 -0
  14. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessed_network_adapter.rb +197 -0
  15. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessment.rb +367 -0
  16. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessment_options_result_list.rb +78 -0
  17. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessment_result_list.rb +55 -0
  18. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessment_sizing_criterion.rb +16 -0
  19. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessment_stage.rb +17 -0
  20. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/assessment_status.rb +19 -0
  21. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_disk_size.rb +29 -0
  22. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_disk_suitability_explanation.rb +22 -0
  23. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_disk_type.rb +17 -0
  24. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_hybrid_use_benefit.rb +17 -0
  25. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_location.rb +45 -0
  26. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_network_adapter_suitability_explanation.rb +17 -0
  27. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_offer_code.rb +52 -0
  28. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_pricing_tier.rb +16 -0
  29. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_storage_redundancy.rb +19 -0
  30. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_vm_size.rb +105 -0
  31. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/azure_vm_suitability_explanation.rb +50 -0
  32. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/check_name_availability_parameters.rb +61 -0
  33. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/check_name_availability_result.rb +78 -0
  34. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/cloud_suitability.rb +19 -0
  35. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/currency.rb +40 -0
  36. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/discovery_status.rb +18 -0
  37. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/disk.rb +59 -0
  38. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/download_url.rb +59 -0
  39. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/group.rb +151 -0
  40. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/group_result_list.rb +55 -0
  41. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/machine.rb +317 -0
  42. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/machine_boot_type.rb +17 -0
  43. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/machine_result_list.rb +55 -0
  44. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/name_availability_reason.rb +17 -0
  45. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/network_adapter.rb +67 -0
  46. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/operation.rb +71 -0
  47. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/operation_display.rb +83 -0
  48. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/operation_result_list.rb +55 -0
  49. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/percentile.rb +18 -0
  50. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/project.rb +256 -0
  51. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/project_key.rb +59 -0
  52. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/project_result_list.rb +55 -0
  53. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/provisioning_state.rb +20 -0
  54. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/time_range.rb +17 -0
  55. data/lib/2018-02-02/generated/azure_mgmt_migrate/models/vm_family.rb +88 -0
  56. data/lib/2018-02-02/generated/azure_mgmt_migrate/module_definition.rb +9 -0
  57. data/lib/2018-02-02/generated/azure_mgmt_migrate/operations.rb +113 -0
  58. data/lib/2018-02-02/generated/azure_mgmt_migrate/projects.rb +756 -0
  59. data/lib/azure_mgmt_migrate.rb +6 -0
  60. data/lib/module_definition.rb +7 -0
  61. data/lib/profiles/latest/migrate_latest_profile_client.rb +40 -0
  62. data/lib/profiles/latest/migrate_module_definition.rb +8 -0
  63. data/lib/profiles/latest/modules/migrate_profile_module.rb +255 -0
  64. data/lib/version.rb +7 -0
  65. metadata +180 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ec7feed2cf9f2db9d6c46b7bf779b47bc8c87ce4fb5dc907b2a47663b0885b6e
4
+ data.tar.gz: b600a508e02a758b5f14908af93bcb64ba1aea030d7069165323812d098a287f
5
+ SHA512:
6
+ metadata.gz: b9c1c59759b7fba4a716121228667cbbcf50cefb44f3c90ded279e37b56b66b2ce992f988b34910f60880607379d29274b224ef284aeb8f97d552ef63ecb110c
7
+ data.tar.gz: ebbf243ee4720c8cbbfdd1f11129b96f0e52f1397695e2a1246285ffbf82114031523d298c4a7daefdf9ad3808ffc8c785bc743e46a0d1a2ec0485c6aa38468e
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,80 @@
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-02-02/generated/azure_mgmt_migrate/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Migrate::Mgmt::V2018_02_02
23
+ autoload :Location, '2018-02-02/generated/azure_mgmt_migrate/location.rb'
24
+ autoload :AssessmentOptions, '2018-02-02/generated/azure_mgmt_migrate/assessment_options.rb'
25
+ autoload :Projects, '2018-02-02/generated/azure_mgmt_migrate/projects.rb'
26
+ autoload :Machines, '2018-02-02/generated/azure_mgmt_migrate/machines.rb'
27
+ autoload :Groups, '2018-02-02/generated/azure_mgmt_migrate/groups.rb'
28
+ autoload :Assessments, '2018-02-02/generated/azure_mgmt_migrate/assessments.rb'
29
+ autoload :AssessedMachines, '2018-02-02/generated/azure_mgmt_migrate/assessed_machines.rb'
30
+ autoload :Operations, '2018-02-02/generated/azure_mgmt_migrate/operations.rb'
31
+ autoload :AzureMigrate, '2018-02-02/generated/azure_mgmt_migrate/azure_migrate.rb'
32
+
33
+ module Models
34
+ autoload :DownloadUrl, '2018-02-02/generated/azure_mgmt_migrate/models/download_url.rb'
35
+ autoload :Project, '2018-02-02/generated/azure_mgmt_migrate/models/project.rb'
36
+ autoload :VmFamily, '2018-02-02/generated/azure_mgmt_migrate/models/vm_family.rb'
37
+ autoload :Assessment, '2018-02-02/generated/azure_mgmt_migrate/models/assessment.rb'
38
+ autoload :ProjectResultList, '2018-02-02/generated/azure_mgmt_migrate/models/project_result_list.rb'
39
+ autoload :NetworkAdapter, '2018-02-02/generated/azure_mgmt_migrate/models/network_adapter.rb'
40
+ autoload :MachineResultList, '2018-02-02/generated/azure_mgmt_migrate/models/machine_result_list.rb'
41
+ autoload :AssessedDisk, '2018-02-02/generated/azure_mgmt_migrate/models/assessed_disk.rb'
42
+ autoload :GroupResultList, '2018-02-02/generated/azure_mgmt_migrate/models/group_result_list.rb'
43
+ autoload :AssessedMachine, '2018-02-02/generated/azure_mgmt_migrate/models/assessed_machine.rb'
44
+ autoload :AssessedMachineResultList, '2018-02-02/generated/azure_mgmt_migrate/models/assessed_machine_result_list.rb'
45
+ autoload :OperationDisplay, '2018-02-02/generated/azure_mgmt_migrate/models/operation_display.rb'
46
+ autoload :AssessmentResultList, '2018-02-02/generated/azure_mgmt_migrate/models/assessment_result_list.rb'
47
+ autoload :Group, '2018-02-02/generated/azure_mgmt_migrate/models/group.rb'
48
+ autoload :OperationResultList, '2018-02-02/generated/azure_mgmt_migrate/models/operation_result_list.rb'
49
+ autoload :Machine, '2018-02-02/generated/azure_mgmt_migrate/models/machine.rb'
50
+ autoload :AssessmentOptionsResultList, '2018-02-02/generated/azure_mgmt_migrate/models/assessment_options_result_list.rb'
51
+ autoload :ProjectKey, '2018-02-02/generated/azure_mgmt_migrate/models/project_key.rb'
52
+ autoload :Disk, '2018-02-02/generated/azure_mgmt_migrate/models/disk.rb'
53
+ autoload :Operation, '2018-02-02/generated/azure_mgmt_migrate/models/operation.rb'
54
+ autoload :CheckNameAvailabilityParameters, '2018-02-02/generated/azure_mgmt_migrate/models/check_name_availability_parameters.rb'
55
+ autoload :AssessedNetworkAdapter, '2018-02-02/generated/azure_mgmt_migrate/models/assessed_network_adapter.rb'
56
+ autoload :CheckNameAvailabilityResult, '2018-02-02/generated/azure_mgmt_migrate/models/check_name_availability_result.rb'
57
+ autoload :DiscoveryStatus, '2018-02-02/generated/azure_mgmt_migrate/models/discovery_status.rb'
58
+ autoload :ProvisioningState, '2018-02-02/generated/azure_mgmt_migrate/models/provisioning_state.rb'
59
+ autoload :AzureLocation, '2018-02-02/generated/azure_mgmt_migrate/models/azure_location.rb'
60
+ autoload :AzureOfferCode, '2018-02-02/generated/azure_mgmt_migrate/models/azure_offer_code.rb'
61
+ autoload :AzurePricingTier, '2018-02-02/generated/azure_mgmt_migrate/models/azure_pricing_tier.rb'
62
+ autoload :AzureStorageRedundancy, '2018-02-02/generated/azure_mgmt_migrate/models/azure_storage_redundancy.rb'
63
+ autoload :Percentile, '2018-02-02/generated/azure_mgmt_migrate/models/percentile.rb'
64
+ autoload :TimeRange, '2018-02-02/generated/azure_mgmt_migrate/models/time_range.rb'
65
+ autoload :AssessmentStage, '2018-02-02/generated/azure_mgmt_migrate/models/assessment_stage.rb'
66
+ autoload :Currency, '2018-02-02/generated/azure_mgmt_migrate/models/currency.rb'
67
+ autoload :AzureHybridUseBenefit, '2018-02-02/generated/azure_mgmt_migrate/models/azure_hybrid_use_benefit.rb'
68
+ autoload :AssessmentSizingCriterion, '2018-02-02/generated/azure_mgmt_migrate/models/assessment_sizing_criterion.rb'
69
+ autoload :AssessmentStatus, '2018-02-02/generated/azure_mgmt_migrate/models/assessment_status.rb'
70
+ autoload :MachineBootType, '2018-02-02/generated/azure_mgmt_migrate/models/machine_boot_type.rb'
71
+ autoload :AzureDiskType, '2018-02-02/generated/azure_mgmt_migrate/models/azure_disk_type.rb'
72
+ autoload :AzureDiskSize, '2018-02-02/generated/azure_mgmt_migrate/models/azure_disk_size.rb'
73
+ autoload :CloudSuitability, '2018-02-02/generated/azure_mgmt_migrate/models/cloud_suitability.rb'
74
+ autoload :AzureDiskSuitabilityExplanation, '2018-02-02/generated/azure_mgmt_migrate/models/azure_disk_suitability_explanation.rb'
75
+ autoload :AzureNetworkAdapterSuitabilityExplanation, '2018-02-02/generated/azure_mgmt_migrate/models/azure_network_adapter_suitability_explanation.rb'
76
+ autoload :AzureVmSize, '2018-02-02/generated/azure_mgmt_migrate/models/azure_vm_size.rb'
77
+ autoload :AzureVmSuitabilityExplanation, '2018-02-02/generated/azure_mgmt_migrate/models/azure_vm_suitability_explanation.rb'
78
+ autoload :NameAvailabilityReason, '2018-02-02/generated/azure_mgmt_migrate/models/name_availability_reason.rb'
79
+ end
80
+ end
@@ -0,0 +1,293 @@
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 AssessedMachines
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the AssessedMachines 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 assessed machines for assessment.
26
+ #
27
+ # Get list of machines that assessed as part of the specified assessment.
28
+ # Returns a json array of objects of type 'assessedMachine' as specified in the
29
+ # Models section.
30
+ #
31
+ # Whenever an assessment is created or updated, it goes under computation.
32
+ # During this phase, the 'status' field of Assessment object reports
33
+ # 'Computing'.
34
+ # During the period when the assessment is under computation, the list of
35
+ # assessed machines is empty and no assessed machines are returned by this
36
+ # call.
37
+ #
38
+ #
39
+ # @param resource_group_name [String] Name of the Azure Resource Group that
40
+ # project is part of.
41
+ # @param project_name [String] Name of the Azure Migrate project.
42
+ # @param group_name [String] Unique name of a group within a project.
43
+ # @param assessment_name [String] Unique name of an assessment within a
44
+ # project.
45
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
46
+ # will be added to the HTTP request.
47
+ #
48
+ # @return [AssessedMachineResultList] operation results.
49
+ #
50
+ def list_by_assessment(resource_group_name, project_name, group_name, assessment_name, custom_headers:nil)
51
+ response = list_by_assessment_async(resource_group_name, project_name, group_name, assessment_name, custom_headers:custom_headers).value!
52
+ response.body unless response.nil?
53
+ end
54
+
55
+ #
56
+ # Get assessed machines for assessment.
57
+ #
58
+ # Get list of machines that assessed as part of the specified assessment.
59
+ # Returns a json array of objects of type 'assessedMachine' as specified in the
60
+ # Models section.
61
+ #
62
+ # Whenever an assessment is created or updated, it goes under computation.
63
+ # During this phase, the 'status' field of Assessment object reports
64
+ # 'Computing'.
65
+ # During the period when the assessment is under computation, the list of
66
+ # assessed machines is empty and no assessed machines are returned by this
67
+ # call.
68
+ #
69
+ #
70
+ # @param resource_group_name [String] Name of the Azure Resource Group that
71
+ # project is part of.
72
+ # @param project_name [String] Name of the Azure Migrate project.
73
+ # @param group_name [String] Unique name of a group within a project.
74
+ # @param assessment_name [String] Unique name of an assessment within a
75
+ # project.
76
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
77
+ # will be added to the HTTP request.
78
+ #
79
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
80
+ #
81
+ def list_by_assessment_with_http_info(resource_group_name, project_name, group_name, assessment_name, custom_headers:nil)
82
+ list_by_assessment_async(resource_group_name, project_name, group_name, assessment_name, custom_headers:custom_headers).value!
83
+ end
84
+
85
+ #
86
+ # Get assessed machines for assessment.
87
+ #
88
+ # Get list of machines that assessed as part of the specified assessment.
89
+ # Returns a json array of objects of type 'assessedMachine' as specified in the
90
+ # Models section.
91
+ #
92
+ # Whenever an assessment is created or updated, it goes under computation.
93
+ # During this phase, the 'status' field of Assessment object reports
94
+ # 'Computing'.
95
+ # During the period when the assessment is under computation, the list of
96
+ # assessed machines is empty and no assessed machines are returned by this
97
+ # call.
98
+ #
99
+ #
100
+ # @param resource_group_name [String] Name of the Azure Resource Group that
101
+ # project is part of.
102
+ # @param project_name [String] Name of the Azure Migrate project.
103
+ # @param group_name [String] Unique name of a group within a project.
104
+ # @param assessment_name [String] Unique name of an assessment within a
105
+ # project.
106
+ # @param [Hash{String => String}] A hash of custom headers that will be added
107
+ # to the HTTP request.
108
+ #
109
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
110
+ #
111
+ def list_by_assessment_async(resource_group_name, project_name, group_name, assessment_name, custom_headers:nil)
112
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
113
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
114
+ fail ArgumentError, 'project_name is nil' if project_name.nil?
115
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
116
+ fail ArgumentError, 'assessment_name is nil' if assessment_name.nil?
117
+ @client.api_version = '2018-02-02'
118
+
119
+
120
+ request_headers = {}
121
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
122
+
123
+ # Set Headers
124
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
125
+ request_headers['Accept-Language'] = @client.accept_language unless @client.accept_language.nil?
126
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines'
127
+
128
+ request_url = @base_url || @client.base_url
129
+
130
+ options = {
131
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
132
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'projectName' => project_name,'groupName' => group_name,'assessmentName' => assessment_name},
133
+ query_params: {'api-version' => @client.api_version},
134
+ headers: request_headers.merge(custom_headers || {}),
135
+ base_url: request_url
136
+ }
137
+ promise = @client.make_request_async(:get, path_template, options)
138
+
139
+ promise = promise.then do |result|
140
+ http_response = result.response
141
+ status_code = http_response.status
142
+ response_content = http_response.body
143
+ unless status_code == 200
144
+ error_model = JSON.load(response_content)
145
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
146
+ end
147
+
148
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
149
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
150
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
151
+ # Deserialize Response
152
+ if status_code == 200
153
+ begin
154
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
155
+ result_mapper = Azure::Migrate::Mgmt::V2018_02_02::Models::AssessedMachineResultList.mapper()
156
+ result.body = @client.deserialize(result_mapper, parsed_response)
157
+ rescue Exception => e
158
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
159
+ end
160
+ end
161
+
162
+ result
163
+ end
164
+
165
+ promise.execute
166
+ end
167
+
168
+ #
169
+ # Get an assessed machine.
170
+ #
171
+ # Get an assessed machine with its size & cost estimate that was evaluated in
172
+ # the specified assessment.
173
+ #
174
+ # @param resource_group_name [String] Name of the Azure Resource Group that
175
+ # project is part of.
176
+ # @param project_name [String] Name of the Azure Migrate project.
177
+ # @param group_name [String] Unique name of a group within a project.
178
+ # @param assessment_name [String] Unique name of an assessment within a
179
+ # project.
180
+ # @param assessed_machine_name [String] Unique name of an assessed machine
181
+ # evaluated as part of an assessment.
182
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
183
+ # will be added to the HTTP request.
184
+ #
185
+ # @return [AssessedMachine] operation results.
186
+ #
187
+ def get(resource_group_name, project_name, group_name, assessment_name, assessed_machine_name, custom_headers:nil)
188
+ response = get_async(resource_group_name, project_name, group_name, assessment_name, assessed_machine_name, custom_headers:custom_headers).value!
189
+ response.body unless response.nil?
190
+ end
191
+
192
+ #
193
+ # Get an assessed machine.
194
+ #
195
+ # Get an assessed machine with its size & cost estimate that was evaluated in
196
+ # the specified assessment.
197
+ #
198
+ # @param resource_group_name [String] Name of the Azure Resource Group that
199
+ # project is part of.
200
+ # @param project_name [String] Name of the Azure Migrate project.
201
+ # @param group_name [String] Unique name of a group within a project.
202
+ # @param assessment_name [String] Unique name of an assessment within a
203
+ # project.
204
+ # @param assessed_machine_name [String] Unique name of an assessed machine
205
+ # evaluated as part of an assessment.
206
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
207
+ # will be added to the HTTP request.
208
+ #
209
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
210
+ #
211
+ def get_with_http_info(resource_group_name, project_name, group_name, assessment_name, assessed_machine_name, custom_headers:nil)
212
+ get_async(resource_group_name, project_name, group_name, assessment_name, assessed_machine_name, custom_headers:custom_headers).value!
213
+ end
214
+
215
+ #
216
+ # Get an assessed machine.
217
+ #
218
+ # Get an assessed machine with its size & cost estimate that was evaluated in
219
+ # the specified assessment.
220
+ #
221
+ # @param resource_group_name [String] Name of the Azure Resource Group that
222
+ # project is part of.
223
+ # @param project_name [String] Name of the Azure Migrate project.
224
+ # @param group_name [String] Unique name of a group within a project.
225
+ # @param assessment_name [String] Unique name of an assessment within a
226
+ # project.
227
+ # @param assessed_machine_name [String] Unique name of an assessed machine
228
+ # evaluated as part of an assessment.
229
+ # @param [Hash{String => String}] A hash of custom headers that will be added
230
+ # to the HTTP request.
231
+ #
232
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
233
+ #
234
+ def get_async(resource_group_name, project_name, group_name, assessment_name, assessed_machine_name, custom_headers:nil)
235
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
236
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
237
+ fail ArgumentError, 'project_name is nil' if project_name.nil?
238
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
239
+ fail ArgumentError, 'assessment_name is nil' if assessment_name.nil?
240
+ fail ArgumentError, 'assessed_machine_name is nil' if assessed_machine_name.nil?
241
+ @client.api_version = '2018-02-02'
242
+
243
+
244
+ request_headers = {}
245
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
246
+
247
+ # Set Headers
248
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
249
+ request_headers['Accept-Language'] = @client.accept_language unless @client.accept_language.nil?
250
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName}'
251
+
252
+ request_url = @base_url || @client.base_url
253
+
254
+ options = {
255
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
256
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'projectName' => project_name,'groupName' => group_name,'assessmentName' => assessment_name,'assessedMachineName' => assessed_machine_name},
257
+ query_params: {'api-version' => @client.api_version},
258
+ headers: request_headers.merge(custom_headers || {}),
259
+ base_url: request_url
260
+ }
261
+ promise = @client.make_request_async(:get, path_template, options)
262
+
263
+ promise = promise.then do |result|
264
+ http_response = result.response
265
+ status_code = http_response.status
266
+ response_content = http_response.body
267
+ unless status_code == 200
268
+ error_model = JSON.load(response_content)
269
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
270
+ end
271
+
272
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
273
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
274
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
275
+ # Deserialize Response
276
+ if status_code == 200
277
+ begin
278
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
279
+ result_mapper = Azure::Migrate::Mgmt::V2018_02_02::Models::AssessedMachine.mapper()
280
+ result.body = @client.deserialize(result_mapper, parsed_response)
281
+ rescue Exception => e
282
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
283
+ end
284
+ end
285
+
286
+ result
287
+ end
288
+
289
+ promise.execute
290
+ end
291
+
292
+ end
293
+ end
@@ -0,0 +1,121 @@
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 AssessmentOptions
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the AssessmentOptions 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 the assessment options.
26
+ #
27
+ # Get the available options for the properties of an assessment.
28
+ #
29
+ # @param location_name [String] Azure region in which the project is created.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [AssessmentOptionsResultList] operation results.
34
+ #
35
+ def get(location_name, custom_headers:nil)
36
+ response = get_async(location_name, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Get the assessment options.
42
+ #
43
+ # Get the available options for the properties of an assessment.
44
+ #
45
+ # @param location_name [String] Azure region in which the project is created.
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 get_with_http_info(location_name, custom_headers:nil)
52
+ get_async(location_name, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Get the assessment options.
57
+ #
58
+ # Get the available options for the properties of an assessment.
59
+ #
60
+ # @param location_name [String] Azure region in which the project is created.
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 get_async(location_name, custom_headers:nil)
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+ fail ArgumentError, 'location_name is nil' if location_name.nil?
69
+ @client.api_version = '2018-02-02'
70
+
71
+
72
+ request_headers = {}
73
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
74
+
75
+ # Set Headers
76
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
77
+ request_headers['Accept-Language'] = @client.accept_language unless @client.accept_language.nil?
78
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Migrate/locations/{locationName}/assessmentOptions'
79
+
80
+ request_url = @base_url || @client.base_url
81
+
82
+ options = {
83
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
84
+ path_params: {'subscriptionId' => @client.subscription_id,'locationName' => location_name},
85
+ query_params: {'api-version' => @client.api_version},
86
+ headers: request_headers.merge(custom_headers || {}),
87
+ base_url: request_url
88
+ }
89
+ promise = @client.make_request_async(:get, path_template, options)
90
+
91
+ promise = promise.then do |result|
92
+ http_response = result.response
93
+ status_code = http_response.status
94
+ response_content = http_response.body
95
+ unless status_code == 200
96
+ error_model = JSON.load(response_content)
97
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
98
+ end
99
+
100
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
101
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
102
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
103
+ # Deserialize Response
104
+ if status_code == 200
105
+ begin
106
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
107
+ result_mapper = Azure::Migrate::Mgmt::V2018_02_02::Models::AssessmentOptionsResultList.mapper()
108
+ result.body = @client.deserialize(result_mapper, parsed_response)
109
+ rescue Exception => e
110
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
111
+ end
112
+ end
113
+
114
+ result
115
+ end
116
+
117
+ promise.execute
118
+ end
119
+
120
+ end
121
+ end