azure_mgmt_compute 0.3.1 → 0.4.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 +5 -13
- data/azure_mgmt_compute.gemspec +4 -4
- data/lib/azure_mgmt_compute.rb +3 -138
- data/lib/generated/azure_mgmt_compute.rb +128 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/availability_sets.rb +24 -22
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/compute_management_client.rb +12 -12
- data/lib/generated/azure_mgmt_compute/models/additional_unattend_content.rb +88 -0
- data/lib/generated/azure_mgmt_compute/models/api_entity_reference.rb +45 -0
- data/lib/generated/azure_mgmt_compute/models/api_error.rb +93 -0
- data/lib/generated/azure_mgmt_compute/models/api_error_base.rb +64 -0
- data/lib/generated/azure_mgmt_compute/models/availability_set.rb +136 -0
- data/lib/generated/azure_mgmt_compute/models/availability_set_list_result.rb +52 -0
- data/lib/generated/azure_mgmt_compute/models/boot_diagnostics.rb +56 -0
- data/lib/generated/azure_mgmt_compute/models/boot_diagnostics_instance_view.rb +54 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/caching_types.rb +0 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/component_names.rb +0 -0
- data/lib/generated/azure_mgmt_compute/models/compute_long_running_operation_properties.rb +44 -0
- data/lib/generated/azure_mgmt_compute/models/data_disk.rb +114 -0
- data/lib/generated/azure_mgmt_compute/models/data_disk_image.rb +48 -0
- data/lib/generated/azure_mgmt_compute/models/diagnostics_profile.rb +45 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/disk_create_option_types.rb +0 -0
- data/lib/generated/azure_mgmt_compute/models/disk_encryption_settings.rb +69 -0
- data/lib/generated/azure_mgmt_compute/models/disk_instance_view.rb +62 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/hardware_profile.rb +20 -35
- data/lib/generated/azure_mgmt_compute/models/image_reference.rb +76 -0
- data/lib/generated/azure_mgmt_compute/models/inner_error.rb +54 -0
- data/lib/generated/azure_mgmt_compute/models/instance_view_status.rb +87 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/instance_view_types.rb +0 -0
- data/lib/generated/azure_mgmt_compute/models/key_vault_key_reference.rb +56 -0
- data/lib/generated/azure_mgmt_compute/models/key_vault_secret_reference.rb +56 -0
- data/lib/generated/azure_mgmt_compute/models/linux_configuration.rb +56 -0
- data/lib/generated/azure_mgmt_compute/models/list_usages_result.rb +95 -0
- data/lib/generated/azure_mgmt_compute/models/network_interface_reference.rb +51 -0
- data/lib/generated/azure_mgmt_compute/models/network_profile.rb +52 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/operating_system_types.rb +0 -0
- data/lib/generated/azure_mgmt_compute/models/osdisk.rb +127 -0
- data/lib/generated/azure_mgmt_compute/models/osdisk_image.rb +46 -0
- data/lib/generated/azure_mgmt_compute/models/osprofile.rb +116 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/pass_names.rb +0 -0
- data/lib/generated/azure_mgmt_compute/models/plan.rb +74 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/protocol_types.rb +0 -0
- data/lib/generated/azure_mgmt_compute/models/purchase_plan.rb +65 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/setting_names.rb +0 -0
- data/lib/generated/azure_mgmt_compute/models/sku.rb +64 -0
- data/lib/generated/azure_mgmt_compute/models/ssh_configuration.rb +53 -0
- data/lib/generated/azure_mgmt_compute/models/ssh_public_key.rb +59 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/status_level_types.rb +0 -0
- data/lib/generated/azure_mgmt_compute/models/storage_profile.rb +74 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/upgrade_mode.rb +0 -0
- data/lib/generated/azure_mgmt_compute/models/upgrade_policy.rb +46 -0
- data/lib/generated/azure_mgmt_compute/models/usage.rb +78 -0
- data/lib/generated/azure_mgmt_compute/models/usage_name.rb +54 -0
- data/lib/generated/azure_mgmt_compute/models/vault_certificate.rb +57 -0
- data/lib/generated/azure_mgmt_compute/models/vault_secret_group.rb +65 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_hard_disk.rb +45 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine.rb +224 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_agent_instance_view.rb +81 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_capture_parameters.rb +65 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_capture_result.rb +51 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension.rb +175 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension_handler_instance_view.rb +67 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension_image.rb +134 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension_instance_view.rb +101 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_image.rb +109 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_image_resource.rb +78 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_instance_view.rb +142 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set.rb +135 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension.rb +124 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_extension_profile.rb +53 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view.rb +85 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view_statuses_summary.rb +56 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration.rb +117 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_result.rb +95 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_skus_result.rb +97 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_with_link_result.rb +97 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration.rb +82 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_network_profile.rb +53 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_osdisk.rb +111 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_osprofile.rb +116 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_sku.rb +70 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_sku_capacity.rb +80 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/virtual_machine_scale_set_sku_scale_type.rb +0 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_storage_profile.rb +56 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vm.rb +248 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmextensions_summary.rb +66 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_ids.rb +51 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_required_ids.rb +52 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_view.rb +142 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmlist_result.rb +96 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmprofile.rb +82 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_size.rb +95 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_size_list_result.rb +52 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/models/virtual_machine_size_types.rb +0 -0
- data/lib/generated/azure_mgmt_compute/models/virtual_machine_status_code_count.rb +58 -0
- data/lib/generated/azure_mgmt_compute/models/win_rmconfiguration.rb +53 -0
- data/lib/generated/azure_mgmt_compute/models/win_rmlistener.rb +58 -0
- data/lib/generated/azure_mgmt_compute/models/windows_configuration.rb +98 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/module_definition.rb +0 -0
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/usage_operations.rb +32 -11
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/version.rb +1 -1
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_extension_images.rb +40 -26
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_extensions.rb +59 -31
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_images.rb +76 -48
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_scale_set_vms.rb +169 -41
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_scale_sets.rb +341 -125
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machine_sizes.rb +4 -4
- data/lib/{azure_mgmt_compute → generated/azure_mgmt_compute}/virtual_machines.rb +340 -84
- metadata +126 -142
- data/lib/azure_mgmt_compute/models/additional_unattend_content.rb +0 -105
- data/lib/azure_mgmt_compute/models/api_entity_reference.rb +0 -57
- data/lib/azure_mgmt_compute/models/api_error.rb +0 -119
- data/lib/azure_mgmt_compute/models/api_error_base.rb +0 -74
- data/lib/azure_mgmt_compute/models/availability_set.rb +0 -92
- data/lib/azure_mgmt_compute/models/availability_set_list_result.rb +0 -77
- data/lib/azure_mgmt_compute/models/availability_set_properties.rb +0 -128
- data/lib/azure_mgmt_compute/models/boot_diagnostics.rb +0 -67
- data/lib/azure_mgmt_compute/models/boot_diagnostics_instance_view.rb +0 -65
- data/lib/azure_mgmt_compute/models/compute_long_running_operation_properties.rb +0 -56
- data/lib/azure_mgmt_compute/models/data_disk.rb +0 -143
- data/lib/azure_mgmt_compute/models/data_disk_image.rb +0 -60
- data/lib/azure_mgmt_compute/models/diagnostics_profile.rb +0 -62
- data/lib/azure_mgmt_compute/models/disk_encryption_settings.rb +0 -90
- data/lib/azure_mgmt_compute/models/disk_instance_view.rb +0 -86
- data/lib/azure_mgmt_compute/models/image_reference.rb +0 -85
- data/lib/azure_mgmt_compute/models/inner_error.rb +0 -66
- data/lib/azure_mgmt_compute/models/instance_view_status.rb +0 -100
- data/lib/azure_mgmt_compute/models/key_vault_key_reference.rb +0 -74
- data/lib/azure_mgmt_compute/models/key_vault_secret_reference.rb +0 -75
- data/lib/azure_mgmt_compute/models/linux_configuration.rb +0 -73
- data/lib/azure_mgmt_compute/models/list_usages_result.rb +0 -76
- data/lib/azure_mgmt_compute/models/network_interface_reference.rb +0 -68
- data/lib/azure_mgmt_compute/models/network_interface_reference_properties.rb +0 -57
- data/lib/azure_mgmt_compute/models/network_profile.rb +0 -77
- data/lib/azure_mgmt_compute/models/osdisk.rb +0 -163
- data/lib/azure_mgmt_compute/models/osdisk_image.rb +0 -61
- data/lib/azure_mgmt_compute/models/osprofile.rb +0 -147
- data/lib/azure_mgmt_compute/models/plan.rb +0 -83
- data/lib/azure_mgmt_compute/models/purchase_plan.rb +0 -77
- data/lib/azure_mgmt_compute/models/sku.rb +0 -75
- data/lib/azure_mgmt_compute/models/ssh_configuration.rb +0 -77
- data/lib/azure_mgmt_compute/models/ssh_public_key.rb +0 -70
- data/lib/azure_mgmt_compute/models/storage_profile.rb +0 -108
- data/lib/azure_mgmt_compute/models/upgrade_policy.rb +0 -60
- data/lib/azure_mgmt_compute/models/usage.rb +0 -96
- data/lib/azure_mgmt_compute/models/usage_name.rb +0 -66
- data/lib/azure_mgmt_compute/models/vault_certificate.rb +0 -68
- data/lib/azure_mgmt_compute/models/vault_secret_group.rb +0 -94
- data/lib/azure_mgmt_compute/models/virtual_hard_disk.rb +0 -57
- data/lib/azure_mgmt_compute/models/virtual_machine.rb +0 -140
- data/lib/azure_mgmt_compute/models/virtual_machine_agent_instance_view.rb +0 -117
- data/lib/azure_mgmt_compute/models/virtual_machine_capture_parameters.rb +0 -78
- data/lib/azure_mgmt_compute/models/virtual_machine_capture_result.rb +0 -68
- data/lib/azure_mgmt_compute/models/virtual_machine_capture_result_properties.rb +0 -56
- data/lib/azure_mgmt_compute/models/virtual_machine_extension.rb +0 -92
- data/lib/azure_mgmt_compute/models/virtual_machine_extension_handler_instance_view.rb +0 -83
- data/lib/azure_mgmt_compute/models/virtual_machine_extension_image.rb +0 -92
- data/lib/azure_mgmt_compute/models/virtual_machine_extension_image_properties.rb +0 -102
- data/lib/azure_mgmt_compute/models/virtual_machine_extension_instance_view.rb +0 -137
- data/lib/azure_mgmt_compute/models/virtual_machine_extension_properties.rb +0 -141
- data/lib/azure_mgmt_compute/models/virtual_machine_image.rb +0 -86
- data/lib/azure_mgmt_compute/models/virtual_machine_image_properties.rb +0 -108
- data/lib/azure_mgmt_compute/models/virtual_machine_image_resource.rb +0 -83
- data/lib/azure_mgmt_compute/models/virtual_machine_instance_view.rb +0 -202
- data/lib/azure_mgmt_compute/models/virtual_machine_list_result.rb +0 -87
- data/lib/azure_mgmt_compute/models/virtual_machine_properties.rb +0 -189
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set.rb +0 -108
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_extension.rb +0 -77
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_extension_profile.rb +0 -77
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_extension_properties.rb +0 -116
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view.rb +0 -125
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_instance_view_statuses_summary.rb +0 -79
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration.rb +0 -78
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_ipconfiguration_properties.rb +0 -158
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_list_result.rb +0 -77
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_list_skus_result.rb +0 -77
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_list_with_link_result.rb +0 -88
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration.rb +0 -80
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_network_configuration_properties.rb +0 -89
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_network_profile.rb +0 -77
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_osdisk.rb +0 -129
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_osprofile.rb +0 -147
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_properties.rb +0 -99
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_sku.rb +0 -88
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_sku_capacity.rb +0 -90
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_storage_profile.rb +0 -78
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vm.rb +0 -165
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmextensions_summary.rb +0 -87
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_ids.rb +0 -57
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_required_ids.rb +0 -59
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vminstance_view.rb +0 -202
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmlist_result.rb +0 -77
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmprofile.rb +0 -114
- data/lib/azure_mgmt_compute/models/virtual_machine_scale_set_vmproperties.rb +0 -190
- data/lib/azure_mgmt_compute/models/virtual_machine_size.rb +0 -109
- data/lib/azure_mgmt_compute/models/virtual_machine_size_list_result.rb +0 -77
- data/lib/azure_mgmt_compute/models/virtual_machine_status_code_count.rb +0 -68
- data/lib/azure_mgmt_compute/models/win_rmconfiguration.rb +0 -77
- data/lib/azure_mgmt_compute/models/win_rmlistener.rb +0 -71
- data/lib/azure_mgmt_compute/models/windows_configuration.rb +0 -124
@@ -65,6 +65,8 @@ module Azure::ARM::Compute
|
|
65
65
|
fail ArgumentError, 'location is nil' if location.nil?
|
66
66
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
67
67
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
68
|
+
|
69
|
+
|
68
70
|
request_headers = {}
|
69
71
|
|
70
72
|
# Set Headers
|
@@ -100,10 +102,8 @@ module Azure::ARM::Compute
|
|
100
102
|
if status_code == 200
|
101
103
|
begin
|
102
104
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
103
|
-
|
104
|
-
|
105
|
-
end
|
106
|
-
result.body = parsed_response
|
105
|
+
result_mapper = VirtualMachineSizeListResult.mapper()
|
106
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
107
107
|
rescue Exception => e
|
108
108
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
109
109
|
end
|
@@ -30,23 +30,40 @@ module Azure::ARM::Compute
|
|
30
30
|
# @param vm_name [String] The name of the virtual machine.
|
31
31
|
# @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
|
32
32
|
# the Capture Virtual Machine operation.
|
33
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
34
|
+
# will be added to the HTTP request.
|
35
|
+
#
|
36
|
+
# @return [VirtualMachineCaptureResult] operation results.
|
37
|
+
#
|
38
|
+
def capture(resource_group_name, vm_name, parameters, custom_headers = nil)
|
39
|
+
response = capture_async(resource_group_name, vm_name, parameters, custom_headers).value!
|
40
|
+
response.body unless response.nil?
|
41
|
+
end
|
42
|
+
|
43
|
+
#
|
44
|
+
# @param resource_group_name [String] The name of the resource group.
|
45
|
+
# @param vm_name [String] The name of the virtual machine.
|
46
|
+
# @param parameters [VirtualMachineCaptureParameters] Parameters supplied to
|
47
|
+
# the Capture Virtual Machine operation.
|
48
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
49
|
+
# will be added to the HTTP request.
|
50
|
+
#
|
33
51
|
# @return [Concurrent::Promise] promise which provides async access to http
|
34
52
|
# response.
|
35
53
|
#
|
36
|
-
def
|
54
|
+
def capture_async(resource_group_name, vm_name, parameters, custom_headers = nil)
|
37
55
|
# Send request
|
38
56
|
promise = begin_capture_async(resource_group_name, vm_name, parameters, custom_headers)
|
39
57
|
|
40
58
|
promise = promise.then do |response|
|
41
59
|
# Defining deserialization method.
|
42
60
|
deserialize_method = lambda do |parsed_response|
|
43
|
-
|
44
|
-
|
45
|
-
end
|
61
|
+
result_mapper = VirtualMachineCaptureResult.mapper()
|
62
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
|
46
63
|
end
|
47
64
|
|
48
|
-
|
49
|
-
|
65
|
+
# Waiting for response.
|
66
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
50
67
|
end
|
51
68
|
|
52
69
|
promise
|
@@ -104,21 +121,23 @@ module Azure::ARM::Compute
|
|
104
121
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
105
122
|
fail ArgumentError, 'vm_name is nil' if vm_name.nil?
|
106
123
|
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
107
|
-
parameters.validate unless parameters.nil?
|
108
124
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
109
125
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
126
|
+
|
127
|
+
|
110
128
|
request_headers = {}
|
111
129
|
|
112
130
|
# Set Headers
|
113
131
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
114
132
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
115
133
|
|
116
|
-
# Serialize Request
|
117
134
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
request_content =
|
135
|
+
|
136
|
+
# Serialize Request
|
137
|
+
request_mapper = VirtualMachineCaptureParameters.mapper()
|
138
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
139
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
140
|
+
|
122
141
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture'
|
123
142
|
options = {
|
124
143
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
@@ -150,10 +169,8 @@ module Azure::ARM::Compute
|
|
150
169
|
if status_code == 200
|
151
170
|
begin
|
152
171
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
153
|
-
|
154
|
-
|
155
|
-
end
|
156
|
-
result.body = parsed_response
|
172
|
+
result_mapper = VirtualMachineCaptureResult.mapper()
|
173
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
157
174
|
rescue Exception => e
|
158
175
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
159
176
|
end
|
@@ -172,26 +189,36 @@ module Azure::ARM::Compute
|
|
172
189
|
# @param vm_name [String] The name of the virtual machine.
|
173
190
|
# @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
|
174
191
|
# Machine operation.
|
175
|
-
# @param
|
176
|
-
#
|
177
|
-
#
|
178
|
-
#
|
179
|
-
#
|
180
|
-
|
192
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
193
|
+
# will be added to the HTTP request.
|
194
|
+
#
|
195
|
+
# @return [VirtualMachine] operation results.
|
196
|
+
#
|
197
|
+
def create_or_update(resource_group_name, vm_name, parameters, custom_headers = nil)
|
198
|
+
response = create_or_update_async(resource_group_name, vm_name, parameters, custom_headers).value!
|
199
|
+
response.body unless response.nil?
|
200
|
+
end
|
201
|
+
|
202
|
+
#
|
203
|
+
# @param resource_group_name [String] The name of the resource group.
|
204
|
+
# @param vm_name [String] The name of the virtual machine.
|
205
|
+
# @param parameters [VirtualMachine] Parameters supplied to the Create Virtual
|
206
|
+
# Machine operation.
|
207
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
208
|
+
# will be added to the HTTP request.
|
181
209
|
#
|
182
210
|
# @return [Concurrent::Promise] promise which provides async access to http
|
183
211
|
# response.
|
184
212
|
#
|
185
|
-
def
|
213
|
+
def create_or_update_async(resource_group_name, vm_name, parameters, custom_headers = nil)
|
186
214
|
# Send request
|
187
215
|
promise = begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers)
|
188
216
|
|
189
217
|
promise = promise.then do |response|
|
190
218
|
# Defining deserialization method.
|
191
219
|
deserialize_method = lambda do |parsed_response|
|
192
|
-
|
193
|
-
|
194
|
-
end
|
220
|
+
result_mapper = VirtualMachine.mapper()
|
221
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
|
195
222
|
end
|
196
223
|
|
197
224
|
# Waiting for response.
|
@@ -250,21 +277,23 @@ module Azure::ARM::Compute
|
|
250
277
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
251
278
|
fail ArgumentError, 'vm_name is nil' if vm_name.nil?
|
252
279
|
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
253
|
-
parameters.validate unless parameters.nil?
|
254
280
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
255
281
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
282
|
+
|
283
|
+
|
256
284
|
request_headers = {}
|
257
285
|
|
258
286
|
# Set Headers
|
259
287
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
260
288
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
261
289
|
|
262
|
-
# Serialize Request
|
263
290
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
request_content =
|
291
|
+
|
292
|
+
# Serialize Request
|
293
|
+
request_mapper = VirtualMachine.mapper()
|
294
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
295
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
296
|
+
|
268
297
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'
|
269
298
|
options = {
|
270
299
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
@@ -296,10 +325,8 @@ module Azure::ARM::Compute
|
|
296
325
|
if status_code == 200
|
297
326
|
begin
|
298
327
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
299
|
-
|
300
|
-
|
301
|
-
end
|
302
|
-
result.body = parsed_response
|
328
|
+
result_mapper = VirtualMachine.mapper()
|
329
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
303
330
|
rescue Exception => e
|
304
331
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
305
332
|
end
|
@@ -308,10 +335,8 @@ module Azure::ARM::Compute
|
|
308
335
|
if status_code == 201
|
309
336
|
begin
|
310
337
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
311
|
-
|
312
|
-
|
313
|
-
end
|
314
|
-
result.body = parsed_response
|
338
|
+
result_mapper = VirtualMachine.mapper()
|
339
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
315
340
|
rescue Exception => e
|
316
341
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
317
342
|
end
|
@@ -328,10 +353,24 @@ module Azure::ARM::Compute
|
|
328
353
|
#
|
329
354
|
# @param resource_group_name [String] The name of the resource group.
|
330
355
|
# @param vm_name [String] The name of the virtual machine.
|
356
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
357
|
+
# will be added to the HTTP request.
|
358
|
+
#
|
359
|
+
def delete(resource_group_name, vm_name, custom_headers = nil)
|
360
|
+
response = delete_async(resource_group_name, vm_name, custom_headers).value!
|
361
|
+
nil
|
362
|
+
end
|
363
|
+
|
364
|
+
#
|
365
|
+
# @param resource_group_name [String] The name of the resource group.
|
366
|
+
# @param vm_name [String] The name of the virtual machine.
|
367
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
368
|
+
# will be added to the HTTP request.
|
369
|
+
#
|
331
370
|
# @return [Concurrent::Promise] promise which provides async access to http
|
332
371
|
# response.
|
333
372
|
#
|
334
|
-
def
|
373
|
+
def delete_async(resource_group_name, vm_name, custom_headers = nil)
|
335
374
|
# Send request
|
336
375
|
promise = begin_delete_async(resource_group_name, vm_name, custom_headers)
|
337
376
|
|
@@ -340,8 +379,8 @@ module Azure::ARM::Compute
|
|
340
379
|
deserialize_method = lambda do |parsed_response|
|
341
380
|
end
|
342
381
|
|
343
|
-
|
344
|
-
|
382
|
+
# Waiting for response.
|
383
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
345
384
|
end
|
346
385
|
|
347
386
|
promise
|
@@ -390,6 +429,8 @@ module Azure::ARM::Compute
|
|
390
429
|
fail ArgumentError, 'vm_name is nil' if vm_name.nil?
|
391
430
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
392
431
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
432
|
+
|
433
|
+
|
393
434
|
request_headers = {}
|
394
435
|
|
395
436
|
# Set Headers
|
@@ -478,6 +519,8 @@ module Azure::ARM::Compute
|
|
478
519
|
fail ArgumentError, 'vm_name is nil' if vm_name.nil?
|
479
520
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
480
521
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
522
|
+
|
523
|
+
|
481
524
|
request_headers = {}
|
482
525
|
|
483
526
|
# Set Headers
|
@@ -513,10 +556,8 @@ module Azure::ARM::Compute
|
|
513
556
|
if status_code == 200
|
514
557
|
begin
|
515
558
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
516
|
-
|
517
|
-
|
518
|
-
end
|
519
|
-
result.body = parsed_response
|
559
|
+
result_mapper = VirtualMachine.mapper()
|
560
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
520
561
|
rescue Exception => e
|
521
562
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
522
563
|
end
|
@@ -534,10 +575,24 @@ module Azure::ARM::Compute
|
|
534
575
|
#
|
535
576
|
# @param resource_group_name [String] The name of the resource group.
|
536
577
|
# @param vm_name [String] The name of the virtual machine.
|
578
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
579
|
+
# will be added to the HTTP request.
|
580
|
+
#
|
581
|
+
def deallocate(resource_group_name, vm_name, custom_headers = nil)
|
582
|
+
response = deallocate_async(resource_group_name, vm_name, custom_headers).value!
|
583
|
+
nil
|
584
|
+
end
|
585
|
+
|
586
|
+
#
|
587
|
+
# @param resource_group_name [String] The name of the resource group.
|
588
|
+
# @param vm_name [String] The name of the virtual machine.
|
589
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
590
|
+
# will be added to the HTTP request.
|
591
|
+
#
|
537
592
|
# @return [Concurrent::Promise] promise which provides async access to http
|
538
593
|
# response.
|
539
594
|
#
|
540
|
-
def
|
595
|
+
def deallocate_async(resource_group_name, vm_name, custom_headers = nil)
|
541
596
|
# Send request
|
542
597
|
promise = begin_deallocate_async(resource_group_name, vm_name, custom_headers)
|
543
598
|
|
@@ -546,8 +601,8 @@ module Azure::ARM::Compute
|
|
546
601
|
deserialize_method = lambda do |parsed_response|
|
547
602
|
end
|
548
603
|
|
549
|
-
|
550
|
-
|
604
|
+
# Waiting for response.
|
605
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
551
606
|
end
|
552
607
|
|
553
608
|
promise
|
@@ -599,6 +654,8 @@ module Azure::ARM::Compute
|
|
599
654
|
fail ArgumentError, 'vm_name is nil' if vm_name.nil?
|
600
655
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
601
656
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
657
|
+
|
658
|
+
|
602
659
|
request_headers = {}
|
603
660
|
|
604
661
|
# Set Headers
|
@@ -680,6 +737,8 @@ module Azure::ARM::Compute
|
|
680
737
|
fail ArgumentError, 'vm_name is nil' if vm_name.nil?
|
681
738
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
682
739
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
740
|
+
|
741
|
+
|
683
742
|
request_headers = {}
|
684
743
|
|
685
744
|
# Set Headers
|
@@ -725,11 +784,32 @@ module Azure::ARM::Compute
|
|
725
784
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
726
785
|
# will be added to the HTTP request.
|
727
786
|
#
|
728
|
-
# @return [VirtualMachineListResult]
|
787
|
+
# @return [VirtualMachineListResult] which provide lazy access to pages of the
|
788
|
+
# response.
|
729
789
|
#
|
730
|
-
def
|
790
|
+
def list_as_lazy(resource_group_name, custom_headers = nil)
|
731
791
|
response = list_async(resource_group_name, custom_headers).value!
|
732
|
-
|
792
|
+
unless response.nil?
|
793
|
+
page = response.body
|
794
|
+
page.next_method = Proc.new do |next_link|
|
795
|
+
list_next_async(next_link, custom_headers)
|
796
|
+
end
|
797
|
+
page
|
798
|
+
end
|
799
|
+
end
|
800
|
+
|
801
|
+
#
|
802
|
+
# The operation to list virtual machines under a resource group.
|
803
|
+
#
|
804
|
+
# @param resource_group_name [String] The name of the resource group.
|
805
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
806
|
+
# will be added to the HTTP request.
|
807
|
+
#
|
808
|
+
# @return [Array<VirtualMachine>] operation results.
|
809
|
+
#
|
810
|
+
def list(resource_group_name, custom_headers = nil)
|
811
|
+
first_page = list_as_lazy(resource_group_name, custom_headers)
|
812
|
+
first_page.get_all_items
|
733
813
|
end
|
734
814
|
|
735
815
|
#
|
@@ -758,6 +838,8 @@ module Azure::ARM::Compute
|
|
758
838
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
759
839
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
760
840
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
841
|
+
|
842
|
+
|
761
843
|
request_headers = {}
|
762
844
|
|
763
845
|
# Set Headers
|
@@ -793,10 +875,8 @@ module Azure::ARM::Compute
|
|
793
875
|
if status_code == 200
|
794
876
|
begin
|
795
877
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
796
|
-
|
797
|
-
|
798
|
-
end
|
799
|
-
result.body = parsed_response
|
878
|
+
result_mapper = VirtualMachineListResult.mapper()
|
879
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
800
880
|
rescue Exception => e
|
801
881
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
802
882
|
end
|
@@ -816,11 +896,33 @@ module Azure::ARM::Compute
|
|
816
896
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
817
897
|
# will be added to the HTTP request.
|
818
898
|
#
|
819
|
-
# @return [VirtualMachineListResult]
|
899
|
+
# @return [VirtualMachineListResult] which provide lazy access to pages of the
|
900
|
+
# response.
|
820
901
|
#
|
821
|
-
def
|
902
|
+
def list_all_as_lazy(custom_headers = nil)
|
822
903
|
response = list_all_async(custom_headers).value!
|
823
|
-
|
904
|
+
unless response.nil?
|
905
|
+
page = response.body
|
906
|
+
page.next_method = Proc.new do |next_link|
|
907
|
+
list_all_next_async(next_link, custom_headers)
|
908
|
+
end
|
909
|
+
page
|
910
|
+
end
|
911
|
+
end
|
912
|
+
|
913
|
+
#
|
914
|
+
# Gets the list of Virtual Machines in the subscription. Use nextLink property
|
915
|
+
# in the response to get the next page of Virtual Machines. Do this till
|
916
|
+
# nextLink is not null to fetch all the Virtual Machines.
|
917
|
+
#
|
918
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
919
|
+
# will be added to the HTTP request.
|
920
|
+
#
|
921
|
+
# @return [Array<VirtualMachine>] operation results.
|
922
|
+
#
|
923
|
+
def list_all(custom_headers = nil)
|
924
|
+
first_page = list_all_as_lazy(custom_headers)
|
925
|
+
first_page.get_all_items
|
824
926
|
end
|
825
927
|
|
826
928
|
#
|
@@ -850,6 +952,8 @@ module Azure::ARM::Compute
|
|
850
952
|
def list_all_async(custom_headers = nil)
|
851
953
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
852
954
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
955
|
+
|
956
|
+
|
853
957
|
request_headers = {}
|
854
958
|
|
855
959
|
# Set Headers
|
@@ -885,10 +989,8 @@ module Azure::ARM::Compute
|
|
885
989
|
if status_code == 200
|
886
990
|
begin
|
887
991
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
888
|
-
|
889
|
-
|
890
|
-
end
|
891
|
-
result.body = parsed_response
|
992
|
+
result_mapper = VirtualMachineListResult.mapper()
|
993
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
892
994
|
rescue Exception => e
|
893
995
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
894
996
|
end
|
@@ -947,6 +1049,8 @@ module Azure::ARM::Compute
|
|
947
1049
|
fail ArgumentError, 'vm_name is nil' if vm_name.nil?
|
948
1050
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
949
1051
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1052
|
+
|
1053
|
+
|
950
1054
|
request_headers = {}
|
951
1055
|
|
952
1056
|
# Set Headers
|
@@ -982,10 +1086,8 @@ module Azure::ARM::Compute
|
|
982
1086
|
if status_code == 200
|
983
1087
|
begin
|
984
1088
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
985
|
-
|
986
|
-
|
987
|
-
end
|
988
|
-
result.body = parsed_response
|
1089
|
+
result_mapper = VirtualMachineSizeListResult.mapper()
|
1090
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
989
1091
|
rescue Exception => e
|
990
1092
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
991
1093
|
end
|
@@ -1002,10 +1104,24 @@ module Azure::ARM::Compute
|
|
1002
1104
|
#
|
1003
1105
|
# @param resource_group_name [String] The name of the resource group.
|
1004
1106
|
# @param vm_name [String] The name of the virtual machine.
|
1107
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1108
|
+
# will be added to the HTTP request.
|
1109
|
+
#
|
1110
|
+
def power_off(resource_group_name, vm_name, custom_headers = nil)
|
1111
|
+
response = power_off_async(resource_group_name, vm_name, custom_headers).value!
|
1112
|
+
nil
|
1113
|
+
end
|
1114
|
+
|
1115
|
+
#
|
1116
|
+
# @param resource_group_name [String] The name of the resource group.
|
1117
|
+
# @param vm_name [String] The name of the virtual machine.
|
1118
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1119
|
+
# will be added to the HTTP request.
|
1120
|
+
#
|
1005
1121
|
# @return [Concurrent::Promise] promise which provides async access to http
|
1006
1122
|
# response.
|
1007
1123
|
#
|
1008
|
-
def
|
1124
|
+
def power_off_async(resource_group_name, vm_name, custom_headers = nil)
|
1009
1125
|
# Send request
|
1010
1126
|
promise = begin_power_off_async(resource_group_name, vm_name, custom_headers)
|
1011
1127
|
|
@@ -1014,8 +1130,8 @@ module Azure::ARM::Compute
|
|
1014
1130
|
deserialize_method = lambda do |parsed_response|
|
1015
1131
|
end
|
1016
1132
|
|
1017
|
-
|
1018
|
-
|
1133
|
+
# Waiting for response.
|
1134
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
1019
1135
|
end
|
1020
1136
|
|
1021
1137
|
promise
|
@@ -1064,6 +1180,8 @@ module Azure::ARM::Compute
|
|
1064
1180
|
fail ArgumentError, 'vm_name is nil' if vm_name.nil?
|
1065
1181
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1066
1182
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1183
|
+
|
1184
|
+
|
1067
1185
|
request_headers = {}
|
1068
1186
|
|
1069
1187
|
# Set Headers
|
@@ -1107,10 +1225,24 @@ module Azure::ARM::Compute
|
|
1107
1225
|
#
|
1108
1226
|
# @param resource_group_name [String] The name of the resource group.
|
1109
1227
|
# @param vm_name [String] The name of the virtual machine.
|
1228
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1229
|
+
# will be added to the HTTP request.
|
1230
|
+
#
|
1231
|
+
def restart(resource_group_name, vm_name, custom_headers = nil)
|
1232
|
+
response = restart_async(resource_group_name, vm_name, custom_headers).value!
|
1233
|
+
nil
|
1234
|
+
end
|
1235
|
+
|
1236
|
+
#
|
1237
|
+
# @param resource_group_name [String] The name of the resource group.
|
1238
|
+
# @param vm_name [String] The name of the virtual machine.
|
1239
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1240
|
+
# will be added to the HTTP request.
|
1241
|
+
#
|
1110
1242
|
# @return [Concurrent::Promise] promise which provides async access to http
|
1111
1243
|
# response.
|
1112
1244
|
#
|
1113
|
-
def
|
1245
|
+
def restart_async(resource_group_name, vm_name, custom_headers = nil)
|
1114
1246
|
# Send request
|
1115
1247
|
promise = begin_restart_async(resource_group_name, vm_name, custom_headers)
|
1116
1248
|
|
@@ -1119,8 +1251,8 @@ module Azure::ARM::Compute
|
|
1119
1251
|
deserialize_method = lambda do |parsed_response|
|
1120
1252
|
end
|
1121
1253
|
|
1122
|
-
|
1123
|
-
|
1254
|
+
# Waiting for response.
|
1255
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
1124
1256
|
end
|
1125
1257
|
|
1126
1258
|
promise
|
@@ -1169,6 +1301,8 @@ module Azure::ARM::Compute
|
|
1169
1301
|
fail ArgumentError, 'vm_name is nil' if vm_name.nil?
|
1170
1302
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1171
1303
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1304
|
+
|
1305
|
+
|
1172
1306
|
request_headers = {}
|
1173
1307
|
|
1174
1308
|
# Set Headers
|
@@ -1212,10 +1346,24 @@ module Azure::ARM::Compute
|
|
1212
1346
|
#
|
1213
1347
|
# @param resource_group_name [String] The name of the resource group.
|
1214
1348
|
# @param vm_name [String] The name of the virtual machine.
|
1349
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1350
|
+
# will be added to the HTTP request.
|
1351
|
+
#
|
1352
|
+
def start(resource_group_name, vm_name, custom_headers = nil)
|
1353
|
+
response = start_async(resource_group_name, vm_name, custom_headers).value!
|
1354
|
+
nil
|
1355
|
+
end
|
1356
|
+
|
1357
|
+
#
|
1358
|
+
# @param resource_group_name [String] The name of the resource group.
|
1359
|
+
# @param vm_name [String] The name of the virtual machine.
|
1360
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1361
|
+
# will be added to the HTTP request.
|
1362
|
+
#
|
1215
1363
|
# @return [Concurrent::Promise] promise which provides async access to http
|
1216
1364
|
# response.
|
1217
1365
|
#
|
1218
|
-
def
|
1366
|
+
def start_async(resource_group_name, vm_name, custom_headers = nil)
|
1219
1367
|
# Send request
|
1220
1368
|
promise = begin_start_async(resource_group_name, vm_name, custom_headers)
|
1221
1369
|
|
@@ -1224,8 +1372,8 @@ module Azure::ARM::Compute
|
|
1224
1372
|
deserialize_method = lambda do |parsed_response|
|
1225
1373
|
end
|
1226
1374
|
|
1227
|
-
|
1228
|
-
|
1375
|
+
# Waiting for response.
|
1376
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
1229
1377
|
end
|
1230
1378
|
|
1231
1379
|
promise
|
@@ -1274,6 +1422,8 @@ module Azure::ARM::Compute
|
|
1274
1422
|
fail ArgumentError, 'vm_name is nil' if vm_name.nil?
|
1275
1423
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1276
1424
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1425
|
+
|
1426
|
+
|
1277
1427
|
request_headers = {}
|
1278
1428
|
|
1279
1429
|
# Set Headers
|
@@ -1317,10 +1467,24 @@ module Azure::ARM::Compute
|
|
1317
1467
|
#
|
1318
1468
|
# @param resource_group_name [String] The name of the resource group.
|
1319
1469
|
# @param vm_name [String] The name of the virtual machine.
|
1470
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1471
|
+
# will be added to the HTTP request.
|
1472
|
+
#
|
1473
|
+
def redeploy(resource_group_name, vm_name, custom_headers = nil)
|
1474
|
+
response = redeploy_async(resource_group_name, vm_name, custom_headers).value!
|
1475
|
+
nil
|
1476
|
+
end
|
1477
|
+
|
1478
|
+
#
|
1479
|
+
# @param resource_group_name [String] The name of the resource group.
|
1480
|
+
# @param vm_name [String] The name of the virtual machine.
|
1481
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1482
|
+
# will be added to the HTTP request.
|
1483
|
+
#
|
1320
1484
|
# @return [Concurrent::Promise] promise which provides async access to http
|
1321
1485
|
# response.
|
1322
1486
|
#
|
1323
|
-
def
|
1487
|
+
def redeploy_async(resource_group_name, vm_name, custom_headers = nil)
|
1324
1488
|
# Send request
|
1325
1489
|
promise = begin_redeploy_async(resource_group_name, vm_name, custom_headers)
|
1326
1490
|
|
@@ -1329,8 +1493,8 @@ module Azure::ARM::Compute
|
|
1329
1493
|
deserialize_method = lambda do |parsed_response|
|
1330
1494
|
end
|
1331
1495
|
|
1332
|
-
|
1333
|
-
|
1496
|
+
# Waiting for response.
|
1497
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
1334
1498
|
end
|
1335
1499
|
|
1336
1500
|
promise
|
@@ -1379,6 +1543,8 @@ module Azure::ARM::Compute
|
|
1379
1543
|
fail ArgumentError, 'vm_name is nil' if vm_name.nil?
|
1380
1544
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1381
1545
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1546
|
+
|
1547
|
+
|
1382
1548
|
request_headers = {}
|
1383
1549
|
|
1384
1550
|
# Set Headers
|
@@ -1417,6 +1583,96 @@ module Azure::ARM::Compute
|
|
1417
1583
|
promise.execute
|
1418
1584
|
end
|
1419
1585
|
|
1586
|
+
#
|
1587
|
+
# The operation to list virtual machines under a resource group.
|
1588
|
+
#
|
1589
|
+
# @param next_page_link [String] The NextLink from the previous successful
|
1590
|
+
# call to List operation.
|
1591
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1592
|
+
# will be added to the HTTP request.
|
1593
|
+
#
|
1594
|
+
# @return [VirtualMachineListResult] operation results.
|
1595
|
+
#
|
1596
|
+
def list_next(next_page_link, custom_headers = nil)
|
1597
|
+
response = list_next_async(next_page_link, custom_headers).value!
|
1598
|
+
response.body unless response.nil?
|
1599
|
+
end
|
1600
|
+
|
1601
|
+
#
|
1602
|
+
# The operation to list virtual machines under a resource group.
|
1603
|
+
#
|
1604
|
+
# @param next_page_link [String] The NextLink from the previous successful
|
1605
|
+
# call to List operation.
|
1606
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1607
|
+
# will be added to the HTTP request.
|
1608
|
+
#
|
1609
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1610
|
+
#
|
1611
|
+
def list_next_with_http_info(next_page_link, custom_headers = nil)
|
1612
|
+
list_next_async(next_page_link, custom_headers).value!
|
1613
|
+
end
|
1614
|
+
|
1615
|
+
#
|
1616
|
+
# The operation to list virtual machines under a resource group.
|
1617
|
+
#
|
1618
|
+
# @param next_page_link [String] The NextLink from the previous successful
|
1619
|
+
# call to List operation.
|
1620
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1621
|
+
# to the HTTP request.
|
1622
|
+
#
|
1623
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1624
|
+
#
|
1625
|
+
def list_next_async(next_page_link, custom_headers = nil)
|
1626
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
1627
|
+
|
1628
|
+
|
1629
|
+
request_headers = {}
|
1630
|
+
|
1631
|
+
# Set Headers
|
1632
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1633
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1634
|
+
path_template = '{nextLink}'
|
1635
|
+
options = {
|
1636
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1637
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
1638
|
+
headers: request_headers.merge(custom_headers || {})
|
1639
|
+
}
|
1640
|
+
|
1641
|
+
request_url = @base_url || @client.base_url
|
1642
|
+
|
1643
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
1644
|
+
promise = request.run_promise do |req|
|
1645
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
1646
|
+
end
|
1647
|
+
|
1648
|
+
promise = promise.then do |http_response|
|
1649
|
+
status_code = http_response.status
|
1650
|
+
response_content = http_response.body
|
1651
|
+
unless status_code == 200
|
1652
|
+
error_model = JSON.load(response_content)
|
1653
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
1654
|
+
end
|
1655
|
+
|
1656
|
+
# Create Result
|
1657
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
1658
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1659
|
+
# Deserialize Response
|
1660
|
+
if status_code == 200
|
1661
|
+
begin
|
1662
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1663
|
+
result_mapper = VirtualMachineListResult.mapper()
|
1664
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1665
|
+
rescue Exception => e
|
1666
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1667
|
+
end
|
1668
|
+
end
|
1669
|
+
|
1670
|
+
result
|
1671
|
+
end
|
1672
|
+
|
1673
|
+
promise.execute
|
1674
|
+
end
|
1675
|
+
|
1420
1676
|
#
|
1421
1677
|
# Gets the list of Virtual Machines in the subscription. Use nextLink property
|
1422
1678
|
# in the response to get the next page of Virtual Machines. Do this till
|
@@ -1464,6 +1720,8 @@ module Azure::ARM::Compute
|
|
1464
1720
|
#
|
1465
1721
|
def list_all_next_async(next_page_link, custom_headers = nil)
|
1466
1722
|
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
1723
|
+
|
1724
|
+
|
1467
1725
|
request_headers = {}
|
1468
1726
|
|
1469
1727
|
# Set Headers
|
@@ -1498,10 +1756,8 @@ module Azure::ARM::Compute
|
|
1498
1756
|
if status_code == 200
|
1499
1757
|
begin
|
1500
1758
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1501
|
-
|
1502
|
-
|
1503
|
-
end
|
1504
|
-
result.body = parsed_response
|
1759
|
+
result_mapper = VirtualMachineListResult.mapper()
|
1760
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1505
1761
|
rescue Exception => e
|
1506
1762
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1507
1763
|
end
|