azure_mgmt_compute 0.17.0 → 0.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/2015-06-15/generated/azure_mgmt_compute.rb +5 -3
- data/lib/2015-06-15/generated/azure_mgmt_compute/models/update_resource.rb +54 -0
- data/lib/2015-06-15/generated/azure_mgmt_compute/models/virtual_machine_extension_update.rb +134 -0
- data/lib/2015-06-15/generated/azure_mgmt_compute/virtual_machine_extensions.rb +168 -5
- data/lib/2016-03-30/generated/azure_mgmt_compute.rb +28 -25
- data/lib/2016-03-30/generated/azure_mgmt_compute/compute_management_client.rb +4 -4
- data/lib/2016-03-30/generated/azure_mgmt_compute/models/update_resource.rb +54 -0
- data/lib/2016-03-30/generated/azure_mgmt_compute/models/virtual_machine_extension_update.rb +134 -0
- data/lib/2016-03-30/generated/azure_mgmt_compute/models/virtual_machine_extensions_list_result.rb +55 -0
- data/lib/2016-03-30/generated/azure_mgmt_compute/virtual_machine_extensions.rb +168 -5
- data/lib/2016-03-30/generated/azure_mgmt_compute/virtual_machines.rb +98 -0
- data/lib/2016-04-30-preview/generated/azure_mgmt_compute.rb +35 -32
- data/lib/2016-04-30-preview/generated/azure_mgmt_compute/compute_management_client.rb +4 -4
- data/lib/2016-04-30-preview/generated/azure_mgmt_compute/models/update_resource.rb +54 -0
- data/lib/2016-04-30-preview/generated/azure_mgmt_compute/models/virtual_machine_extension_update.rb +134 -0
- data/lib/2016-04-30-preview/generated/azure_mgmt_compute/models/virtual_machine_extensions_list_result.rb +55 -0
- data/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_extensions.rb +168 -5
- data/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machines.rb +98 -0
- data/lib/2017-03-30/generated/azure_mgmt_compute.rb +69 -67
- data/lib/2017-03-30/generated/azure_mgmt_compute/availability_sets.rb +1 -1
- data/lib/2017-03-30/generated/azure_mgmt_compute/compute_management_client.rb +4 -4
- data/lib/2017-03-30/generated/azure_mgmt_compute/disks.rb +1 -1
- data/lib/2017-03-30/generated/azure_mgmt_compute/images.rb +1 -1
- data/lib/2017-03-30/generated/azure_mgmt_compute/models/virtual_machine_extension_update.rb +134 -0
- data/lib/2017-03-30/generated/azure_mgmt_compute/models/virtual_machine_extensions_list_result.rb +55 -0
- data/lib/2017-03-30/generated/azure_mgmt_compute/resource_skus.rb +1 -1
- data/lib/2017-03-30/generated/azure_mgmt_compute/snapshots.rb +1 -1
- data/lib/2017-03-30/generated/azure_mgmt_compute/usage_operations.rb +1 -1
- data/lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_extension_images.rb +1 -1
- data/lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_extensions.rb +169 -6
- data/lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_images.rb +1 -1
- data/lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_run_commands.rb +1 -1
- data/lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_extensions.rb +1 -1
- data/lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_rolling_upgrades.rb +1 -1
- data/lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb +1 -1
- data/lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb +1 -1
- data/lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_sizes.rb +1 -1
- data/lib/2017-03-30/generated/azure_mgmt_compute/virtual_machines.rb +99 -1
- data/lib/2017-12-01/generated/azure_mgmt_compute.rb +75 -64
- data/lib/2017-12-01/generated/azure_mgmt_compute/compute_management_client.rb +4 -4
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/auto_osupgrade_policy.rb +47 -0
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/availability_set_update.rb +1 -10
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/data_disk.rb +7 -7
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/image_update.rb +1 -3
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/osdisk.rb +7 -7
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/rollback_status_info.rb +74 -0
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/upgrade_operation_historical_status_info.rb +73 -0
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/upgrade_operation_historical_status_info_properties.rb +116 -0
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/upgrade_operation_history_status.rb +74 -0
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/upgrade_operation_invoker.rb +17 -0
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/upgrade_policy.rb +13 -0
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/upgrade_state.rb +18 -0
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/virtual_machine_eviction_policy_types.rb +16 -0
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/virtual_machine_extension_update.rb +134 -0
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/virtual_machine_extensions_list_result.rb +55 -0
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_osupgrade_history.rb +104 -0
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_osdisk.rb +3 -3
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmprofile.rb +14 -0
- data/lib/2017-12-01/generated/azure_mgmt_compute/models/virtual_machine_update.rb +1 -1
- data/lib/2017-12-01/generated/azure_mgmt_compute/virtual_machine_extensions.rb +168 -5
- data/lib/2017-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb +202 -0
- data/lib/2017-12-01/generated/azure_mgmt_compute/virtual_machines.rb +98 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute.rb +56 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/compute_management_client.rb +136 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/disks.rb +1304 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/access_level.rb +16 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/access_uri.rb +47 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/api_error.rb +100 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/api_error_base.rb +68 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/creation_data.rb +97 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/disk.rb +207 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/disk_create_option.rb +20 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/disk_list.rb +99 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/disk_sku.rb +60 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/disk_update.rb +100 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/encryption_settings.rb +76 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/grant_access_data.rb +58 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/image_disk_reference.rb +60 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/inner_error.rb +57 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/key_vault_and_key_reference.rb +60 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/key_vault_and_secret_reference.rb +59 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/operating_system_types.rb +16 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/operation_status_response.rb +96 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/resource.rb +101 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/resource_update.rb +66 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/snapshot.rb +187 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/snapshot_list.rb +99 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/snapshot_sku.rb +61 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/snapshot_storage_account_types.rb +17 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/snapshot_update.rb +100 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/source_vault.rb +47 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/models/storage_account_types.rb +16 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/module_definition.rb +9 -0
- data/lib/2018-04-01/generated/azure_mgmt_compute/snapshots.rb +1304 -0
- data/lib/azure_mgmt_compute.rb +1 -0
- data/lib/profiles/latest/modules/compute_profile_module.rb +303 -251
- data/lib/profiles/v2017_03_09/modules/compute_profile_module.rb +90 -78
- data/lib/version.rb +1 -1
- metadata +55 -2
@@ -709,6 +709,98 @@ module Azure::Compute::Mgmt::V2017_12_01
|
|
709
709
|
promise.execute
|
710
710
|
end
|
711
711
|
|
712
|
+
#
|
713
|
+
# Gets list of OS upgrades on a VM scale set instance.
|
714
|
+
#
|
715
|
+
# @param resource_group_name [String] The name of the resource group.
|
716
|
+
# @param vm_scale_set_name [String] The name of the VM scale set.
|
717
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
718
|
+
# will be added to the HTTP request.
|
719
|
+
#
|
720
|
+
# @return [Array<UpgradeOperationHistoricalStatusInfo>] operation results.
|
721
|
+
#
|
722
|
+
def get_osupgrade_history(resource_group_name, vm_scale_set_name, custom_headers:nil)
|
723
|
+
first_page = get_osupgrade_history_as_lazy(resource_group_name, vm_scale_set_name, custom_headers:custom_headers)
|
724
|
+
first_page.get_all_items
|
725
|
+
end
|
726
|
+
|
727
|
+
#
|
728
|
+
# Gets list of OS upgrades on a VM scale set instance.
|
729
|
+
#
|
730
|
+
# @param resource_group_name [String] The name of the resource group.
|
731
|
+
# @param vm_scale_set_name [String] The name of the VM scale set.
|
732
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
733
|
+
# will be added to the HTTP request.
|
734
|
+
#
|
735
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
736
|
+
#
|
737
|
+
def get_osupgrade_history_with_http_info(resource_group_name, vm_scale_set_name, custom_headers:nil)
|
738
|
+
get_osupgrade_history_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
|
739
|
+
end
|
740
|
+
|
741
|
+
#
|
742
|
+
# Gets list of OS upgrades on a VM scale set instance.
|
743
|
+
#
|
744
|
+
# @param resource_group_name [String] The name of the resource group.
|
745
|
+
# @param vm_scale_set_name [String] The name of the VM scale set.
|
746
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
747
|
+
# to the HTTP request.
|
748
|
+
#
|
749
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
750
|
+
#
|
751
|
+
def get_osupgrade_history_async(resource_group_name, vm_scale_set_name, custom_headers:nil)
|
752
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
753
|
+
fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
|
754
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
755
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
756
|
+
|
757
|
+
|
758
|
+
request_headers = {}
|
759
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
760
|
+
|
761
|
+
# Set Headers
|
762
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
763
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
764
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory'
|
765
|
+
|
766
|
+
request_url = @base_url || @client.base_url
|
767
|
+
|
768
|
+
options = {
|
769
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
770
|
+
path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'subscriptionId' => @client.subscription_id},
|
771
|
+
query_params: {'api-version' => @client.api_version},
|
772
|
+
headers: request_headers.merge(custom_headers || {}),
|
773
|
+
base_url: request_url
|
774
|
+
}
|
775
|
+
promise = @client.make_request_async(:get, path_template, options)
|
776
|
+
|
777
|
+
promise = promise.then do |result|
|
778
|
+
http_response = result.response
|
779
|
+
status_code = http_response.status
|
780
|
+
response_content = http_response.body
|
781
|
+
unless status_code == 200
|
782
|
+
error_model = JSON.load(response_content)
|
783
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
784
|
+
end
|
785
|
+
|
786
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
787
|
+
# Deserialize Response
|
788
|
+
if status_code == 200
|
789
|
+
begin
|
790
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
791
|
+
result_mapper = Azure::Compute::Mgmt::V2017_12_01::Models::VirtualMachineScaleSetListOSUpgradeHistory.mapper()
|
792
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
793
|
+
rescue Exception => e
|
794
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
795
|
+
end
|
796
|
+
end
|
797
|
+
|
798
|
+
result
|
799
|
+
end
|
800
|
+
|
801
|
+
promise.execute
|
802
|
+
end
|
803
|
+
|
712
804
|
#
|
713
805
|
# Power off (stop) one or more virtual machines in a VM scale set. Note that
|
714
806
|
# resources are still attached and you are getting charged for the resources.
|
@@ -2847,6 +2939,94 @@ module Azure::Compute::Mgmt::V2017_12_01
|
|
2847
2939
|
promise.execute
|
2848
2940
|
end
|
2849
2941
|
|
2942
|
+
#
|
2943
|
+
# Gets list of OS upgrades on a VM scale set instance.
|
2944
|
+
#
|
2945
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
2946
|
+
# to List operation.
|
2947
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
2948
|
+
# will be added to the HTTP request.
|
2949
|
+
#
|
2950
|
+
# @return [VirtualMachineScaleSetListOSUpgradeHistory] operation results.
|
2951
|
+
#
|
2952
|
+
def get_osupgrade_history_next(next_page_link, custom_headers:nil)
|
2953
|
+
response = get_osupgrade_history_next_async(next_page_link, custom_headers:custom_headers).value!
|
2954
|
+
response.body unless response.nil?
|
2955
|
+
end
|
2956
|
+
|
2957
|
+
#
|
2958
|
+
# Gets list of OS upgrades on a VM scale set instance.
|
2959
|
+
#
|
2960
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
2961
|
+
# to List operation.
|
2962
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
2963
|
+
# will be added to the HTTP request.
|
2964
|
+
#
|
2965
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
2966
|
+
#
|
2967
|
+
def get_osupgrade_history_next_with_http_info(next_page_link, custom_headers:nil)
|
2968
|
+
get_osupgrade_history_next_async(next_page_link, custom_headers:custom_headers).value!
|
2969
|
+
end
|
2970
|
+
|
2971
|
+
#
|
2972
|
+
# Gets list of OS upgrades on a VM scale set instance.
|
2973
|
+
#
|
2974
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
2975
|
+
# to List operation.
|
2976
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
2977
|
+
# to the HTTP request.
|
2978
|
+
#
|
2979
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
2980
|
+
#
|
2981
|
+
def get_osupgrade_history_next_async(next_page_link, custom_headers:nil)
|
2982
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
2983
|
+
|
2984
|
+
|
2985
|
+
request_headers = {}
|
2986
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
2987
|
+
|
2988
|
+
# Set Headers
|
2989
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
2990
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
2991
|
+
path_template = '{nextLink}'
|
2992
|
+
|
2993
|
+
request_url = @base_url || @client.base_url
|
2994
|
+
|
2995
|
+
options = {
|
2996
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
2997
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
2998
|
+
headers: request_headers.merge(custom_headers || {}),
|
2999
|
+
base_url: request_url
|
3000
|
+
}
|
3001
|
+
promise = @client.make_request_async(:get, path_template, options)
|
3002
|
+
|
3003
|
+
promise = promise.then do |result|
|
3004
|
+
http_response = result.response
|
3005
|
+
status_code = http_response.status
|
3006
|
+
response_content = http_response.body
|
3007
|
+
unless status_code == 200
|
3008
|
+
error_model = JSON.load(response_content)
|
3009
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
3010
|
+
end
|
3011
|
+
|
3012
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
3013
|
+
# Deserialize Response
|
3014
|
+
if status_code == 200
|
3015
|
+
begin
|
3016
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
3017
|
+
result_mapper = Azure::Compute::Mgmt::V2017_12_01::Models::VirtualMachineScaleSetListOSUpgradeHistory.mapper()
|
3018
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
3019
|
+
rescue Exception => e
|
3020
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
3021
|
+
end
|
3022
|
+
end
|
3023
|
+
|
3024
|
+
result
|
3025
|
+
end
|
3026
|
+
|
3027
|
+
promise.execute
|
3028
|
+
end
|
3029
|
+
|
2850
3030
|
#
|
2851
3031
|
# Gets a list of all VM scale sets under a resource group.
|
2852
3032
|
#
|
@@ -2914,5 +3094,27 @@ module Azure::Compute::Mgmt::V2017_12_01
|
|
2914
3094
|
end
|
2915
3095
|
end
|
2916
3096
|
|
3097
|
+
#
|
3098
|
+
# Gets list of OS upgrades on a VM scale set instance.
|
3099
|
+
#
|
3100
|
+
# @param resource_group_name [String] The name of the resource group.
|
3101
|
+
# @param vm_scale_set_name [String] The name of the VM scale set.
|
3102
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
3103
|
+
# will be added to the HTTP request.
|
3104
|
+
#
|
3105
|
+
# @return [VirtualMachineScaleSetListOSUpgradeHistory] which provide lazy
|
3106
|
+
# access to pages of the response.
|
3107
|
+
#
|
3108
|
+
def get_osupgrade_history_as_lazy(resource_group_name, vm_scale_set_name, custom_headers:nil)
|
3109
|
+
response = get_osupgrade_history_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
|
3110
|
+
unless response.nil?
|
3111
|
+
page = response.body
|
3112
|
+
page.next_method = Proc.new do |next_page_link|
|
3113
|
+
get_osupgrade_history_next_async(next_page_link, custom_headers:custom_headers)
|
3114
|
+
end
|
3115
|
+
page
|
3116
|
+
end
|
3117
|
+
end
|
3118
|
+
|
2917
3119
|
end
|
2918
3120
|
end
|
@@ -21,6 +21,104 @@ module Azure::Compute::Mgmt::V2017_12_01
|
|
21
21
|
# @return [ComputeManagementClient] reference to the ComputeManagementClient
|
22
22
|
attr_reader :client
|
23
23
|
|
24
|
+
#
|
25
|
+
# The operation to get all extensions of a Virtual Machine.
|
26
|
+
#
|
27
|
+
# @param resource_group_name [String] The name of the resource group.
|
28
|
+
# @param vm_name [String] The name of the virtual machine containing the
|
29
|
+
# extension.
|
30
|
+
# @param expand [String] The expand expression to apply on the operation.
|
31
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
32
|
+
# will be added to the HTTP request.
|
33
|
+
#
|
34
|
+
# @return [VirtualMachineExtensionsListResult] operation results.
|
35
|
+
#
|
36
|
+
def get_extensions(resource_group_name, vm_name, expand:nil, custom_headers:nil)
|
37
|
+
response = get_extensions_async(resource_group_name, vm_name, expand:expand, custom_headers:custom_headers).value!
|
38
|
+
response.body unless response.nil?
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
# The operation to get all extensions of a Virtual Machine.
|
43
|
+
#
|
44
|
+
# @param resource_group_name [String] The name of the resource group.
|
45
|
+
# @param vm_name [String] The name of the virtual machine containing the
|
46
|
+
# extension.
|
47
|
+
# @param expand [String] The expand expression to apply on the operation.
|
48
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
49
|
+
# will be added to the HTTP request.
|
50
|
+
#
|
51
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
52
|
+
#
|
53
|
+
def get_extensions_with_http_info(resource_group_name, vm_name, expand:nil, custom_headers:nil)
|
54
|
+
get_extensions_async(resource_group_name, vm_name, expand:expand, custom_headers:custom_headers).value!
|
55
|
+
end
|
56
|
+
|
57
|
+
#
|
58
|
+
# The operation to get all extensions of a Virtual Machine.
|
59
|
+
#
|
60
|
+
# @param resource_group_name [String] The name of the resource group.
|
61
|
+
# @param vm_name [String] The name of the virtual machine containing the
|
62
|
+
# extension.
|
63
|
+
# @param expand [String] The expand expression to apply on the operation.
|
64
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
65
|
+
# to the HTTP request.
|
66
|
+
#
|
67
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
68
|
+
#
|
69
|
+
def get_extensions_async(resource_group_name, vm_name, expand:nil, custom_headers:nil)
|
70
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
71
|
+
fail ArgumentError, 'vm_name is nil' if vm_name.nil?
|
72
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
73
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
74
|
+
|
75
|
+
|
76
|
+
request_headers = {}
|
77
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
78
|
+
|
79
|
+
# Set Headers
|
80
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
81
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
82
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions'
|
83
|
+
|
84
|
+
request_url = @base_url || @client.base_url
|
85
|
+
|
86
|
+
options = {
|
87
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
88
|
+
path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id},
|
89
|
+
query_params: {'$expand' => expand,'api-version' => @client.api_version},
|
90
|
+
headers: request_headers.merge(custom_headers || {}),
|
91
|
+
base_url: request_url
|
92
|
+
}
|
93
|
+
promise = @client.make_request_async(:get, path_template, options)
|
94
|
+
|
95
|
+
promise = promise.then do |result|
|
96
|
+
http_response = result.response
|
97
|
+
status_code = http_response.status
|
98
|
+
response_content = http_response.body
|
99
|
+
unless status_code == 200
|
100
|
+
error_model = JSON.load(response_content)
|
101
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
102
|
+
end
|
103
|
+
|
104
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
105
|
+
# Deserialize Response
|
106
|
+
if status_code == 200
|
107
|
+
begin
|
108
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
109
|
+
result_mapper = Azure::Compute::Mgmt::V2017_12_01::Models::VirtualMachineExtensionsListResult.mapper()
|
110
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
111
|
+
rescue Exception => e
|
112
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
result
|
117
|
+
end
|
118
|
+
|
119
|
+
promise.execute
|
120
|
+
end
|
121
|
+
|
24
122
|
#
|
25
123
|
# Captures the VM by copying virtual hard disks of the VM and outputs a
|
26
124
|
# template that can be used to create similar VMs.
|
@@ -0,0 +1,56 @@
|
|
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-04-01/generated/azure_mgmt_compute/module_definition'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
module Azure::Compute::Mgmt::V2018_04_01
|
23
|
+
autoload :Disks, '2018-04-01/generated/azure_mgmt_compute/disks.rb'
|
24
|
+
autoload :Snapshots, '2018-04-01/generated/azure_mgmt_compute/snapshots.rb'
|
25
|
+
autoload :ComputeManagementClient, '2018-04-01/generated/azure_mgmt_compute/compute_management_client.rb'
|
26
|
+
|
27
|
+
module Models
|
28
|
+
autoload :DiskList, '2018-04-01/generated/azure_mgmt_compute/models/disk_list.rb'
|
29
|
+
autoload :Resource, '2018-04-01/generated/azure_mgmt_compute/models/resource.rb'
|
30
|
+
autoload :SnapshotSku, '2018-04-01/generated/azure_mgmt_compute/models/snapshot_sku.rb'
|
31
|
+
autoload :ResourceUpdate, '2018-04-01/generated/azure_mgmt_compute/models/resource_update.rb'
|
32
|
+
autoload :GrantAccessData, '2018-04-01/generated/azure_mgmt_compute/models/grant_access_data.rb'
|
33
|
+
autoload :CreationData, '2018-04-01/generated/azure_mgmt_compute/models/creation_data.rb'
|
34
|
+
autoload :AccessUri, '2018-04-01/generated/azure_mgmt_compute/models/access_uri.rb'
|
35
|
+
autoload :KeyVaultAndSecretReference, '2018-04-01/generated/azure_mgmt_compute/models/key_vault_and_secret_reference.rb'
|
36
|
+
autoload :KeyVaultAndKeyReference, '2018-04-01/generated/azure_mgmt_compute/models/key_vault_and_key_reference.rb'
|
37
|
+
autoload :EncryptionSettings, '2018-04-01/generated/azure_mgmt_compute/models/encryption_settings.rb'
|
38
|
+
autoload :ApiError, '2018-04-01/generated/azure_mgmt_compute/models/api_error.rb'
|
39
|
+
autoload :DiskSku, '2018-04-01/generated/azure_mgmt_compute/models/disk_sku.rb'
|
40
|
+
autoload :OperationStatusResponse, '2018-04-01/generated/azure_mgmt_compute/models/operation_status_response.rb'
|
41
|
+
autoload :SourceVault, '2018-04-01/generated/azure_mgmt_compute/models/source_vault.rb'
|
42
|
+
autoload :SnapshotList, '2018-04-01/generated/azure_mgmt_compute/models/snapshot_list.rb'
|
43
|
+
autoload :ImageDiskReference, '2018-04-01/generated/azure_mgmt_compute/models/image_disk_reference.rb'
|
44
|
+
autoload :ApiErrorBase, '2018-04-01/generated/azure_mgmt_compute/models/api_error_base.rb'
|
45
|
+
autoload :InnerError, '2018-04-01/generated/azure_mgmt_compute/models/inner_error.rb'
|
46
|
+
autoload :Disk, '2018-04-01/generated/azure_mgmt_compute/models/disk.rb'
|
47
|
+
autoload :DiskUpdate, '2018-04-01/generated/azure_mgmt_compute/models/disk_update.rb'
|
48
|
+
autoload :Snapshot, '2018-04-01/generated/azure_mgmt_compute/models/snapshot.rb'
|
49
|
+
autoload :SnapshotUpdate, '2018-04-01/generated/azure_mgmt_compute/models/snapshot_update.rb'
|
50
|
+
autoload :StorageAccountTypes, '2018-04-01/generated/azure_mgmt_compute/models/storage_account_types.rb'
|
51
|
+
autoload :OperatingSystemTypes, '2018-04-01/generated/azure_mgmt_compute/models/operating_system_types.rb'
|
52
|
+
autoload :DiskCreateOption, '2018-04-01/generated/azure_mgmt_compute/models/disk_create_option.rb'
|
53
|
+
autoload :SnapshotStorageAccountTypes, '2018-04-01/generated/azure_mgmt_compute/models/snapshot_storage_account_types.rb'
|
54
|
+
autoload :AccessLevel, '2018-04-01/generated/azure_mgmt_compute/models/access_level.rb'
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,136 @@
|
|
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::Compute::Mgmt::V2018_04_01
|
7
|
+
#
|
8
|
+
# A service client - single point of access to the REST API.
|
9
|
+
#
|
10
|
+
class ComputeManagementClient < MsRestAzure::AzureServiceClient
|
11
|
+
include MsRestAzure
|
12
|
+
include MsRestAzure::Serialization
|
13
|
+
|
14
|
+
# @return [String] the base URI of the service.
|
15
|
+
attr_accessor :base_url
|
16
|
+
|
17
|
+
# @return Credentials needed for the client to connect to Azure.
|
18
|
+
attr_reader :credentials
|
19
|
+
|
20
|
+
# @return [String] Subscription credentials which uniquely identify
|
21
|
+
# Microsoft Azure subscription. The subscription ID forms part of the URI
|
22
|
+
# for every service call.
|
23
|
+
attr_accessor :subscription_id
|
24
|
+
|
25
|
+
# @return [String] Client Api Version.
|
26
|
+
attr_reader :api_version
|
27
|
+
|
28
|
+
# @return [String] Gets or sets the preferred language for the response.
|
29
|
+
attr_accessor :accept_language
|
30
|
+
|
31
|
+
# @return [Integer] Gets or sets the retry timeout in seconds for Long
|
32
|
+
# Running Operations. Default value is 30.
|
33
|
+
attr_accessor :long_running_operation_retry_timeout
|
34
|
+
|
35
|
+
# @return [Boolean] When set to true a unique x-ms-client-request-id value
|
36
|
+
# is generated and included in each request. Default is true.
|
37
|
+
attr_accessor :generate_client_request_id
|
38
|
+
|
39
|
+
# @return [Disks] disks
|
40
|
+
attr_reader :disks
|
41
|
+
|
42
|
+
# @return [Snapshots] snapshots
|
43
|
+
attr_reader :snapshots
|
44
|
+
|
45
|
+
#
|
46
|
+
# Creates initializes a new instance of the ComputeManagementClient class.
|
47
|
+
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
48
|
+
# @param base_url [String] the base URI of the service.
|
49
|
+
# @param options [Array] filters to be applied to the HTTP requests.
|
50
|
+
#
|
51
|
+
def initialize(credentials = nil, base_url = nil, options = nil)
|
52
|
+
super(credentials, options)
|
53
|
+
@base_url = base_url || 'https://management.azure.com'
|
54
|
+
|
55
|
+
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
56
|
+
@credentials = credentials
|
57
|
+
|
58
|
+
@disks = Disks.new(self)
|
59
|
+
@snapshots = Snapshots.new(self)
|
60
|
+
@api_version = '2018-04-01'
|
61
|
+
@accept_language = 'en-US'
|
62
|
+
@long_running_operation_retry_timeout = 30
|
63
|
+
@generate_client_request_id = true
|
64
|
+
add_telemetry
|
65
|
+
end
|
66
|
+
|
67
|
+
#
|
68
|
+
# Makes a request and returns the body of the response.
|
69
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
70
|
+
# @param path [String] the path, relative to {base_url}.
|
71
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
72
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
73
|
+
# Example:
|
74
|
+
#
|
75
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
76
|
+
# path = "/path"
|
77
|
+
# options = {
|
78
|
+
# body: request_content,
|
79
|
+
# query_params: {'api-version' => '2016-02-01'}
|
80
|
+
# }
|
81
|
+
# result = @client.make_request(:put, path, options)
|
82
|
+
#
|
83
|
+
def make_request(method, path, options = {})
|
84
|
+
result = make_request_with_http_info(method, path, options)
|
85
|
+
result.body unless result.nil?
|
86
|
+
end
|
87
|
+
|
88
|
+
#
|
89
|
+
# Makes a request and returns the operation response.
|
90
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
91
|
+
# @param path [String] the path, relative to {base_url}.
|
92
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
93
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
94
|
+
#
|
95
|
+
def make_request_with_http_info(method, path, options = {})
|
96
|
+
result = make_request_async(method, path, options).value!
|
97
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
98
|
+
result
|
99
|
+
end
|
100
|
+
|
101
|
+
#
|
102
|
+
# Makes a request asynchronously.
|
103
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
104
|
+
# @param path [String] the path, relative to {base_url}.
|
105
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
106
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
107
|
+
#
|
108
|
+
def make_request_async(method, path, options = {})
|
109
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
110
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
111
|
+
|
112
|
+
request_url = options[:base_url] || @base_url
|
113
|
+
if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
|
114
|
+
@request_headers['Content-Type'] = options[:headers]['Content-Type']
|
115
|
+
end
|
116
|
+
|
117
|
+
request_headers = @request_headers
|
118
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
119
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
120
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
121
|
+
|
122
|
+
super(request_url, method, path, options)
|
123
|
+
end
|
124
|
+
|
125
|
+
|
126
|
+
private
|
127
|
+
#
|
128
|
+
# Adds telemetry information.
|
129
|
+
#
|
130
|
+
def add_telemetry
|
131
|
+
sdk_information = 'azure_mgmt_compute'
|
132
|
+
sdk_information = "#{sdk_information}/0.17.0"
|
133
|
+
add_user_agent_information(sdk_information)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|