azure_mgmt_compute 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generated/azure_mgmt_compute.rb +14 -0
- data/lib/generated/azure_mgmt_compute/availability_sets.rb +11 -11
- data/lib/generated/azure_mgmt_compute/compute_management_client.rb +4 -4
- data/lib/generated/azure_mgmt_compute/container_service_operations.rb +524 -0
- data/lib/generated/azure_mgmt_compute/models/container_service.rb +167 -0
- data/lib/generated/azure_mgmt_compute/models/container_service_agent_pool_profile.rb +104 -0
- data/lib/generated/azure_mgmt_compute/models/container_service_diagnostics_profile.rb +46 -0
- data/lib/generated/azure_mgmt_compute/models/container_service_linux_profile.rb +56 -0
- data/lib/generated/azure_mgmt_compute/models/container_service_list_result.rb +52 -0
- data/lib/generated/azure_mgmt_compute/models/container_service_master_profile.rb +65 -0
- data/lib/generated/azure_mgmt_compute/models/container_service_ochestrator_types.rb +16 -0
- data/lib/generated/azure_mgmt_compute/models/container_service_orchestrator_profile.rb +47 -0
- data/lib/generated/azure_mgmt_compute/models/container_service_ssh_configuration.rb +53 -0
- data/lib/generated/azure_mgmt_compute/models/container_service_ssh_public_key.rb +46 -0
- data/lib/generated/azure_mgmt_compute/models/container_service_vmdiagnostics.rb +57 -0
- data/lib/generated/azure_mgmt_compute/models/container_service_vmsize_types.rb +61 -0
- data/lib/generated/azure_mgmt_compute/models/container_service_windows_profile.rb +54 -0
- data/lib/generated/azure_mgmt_compute/usage_operations.rb +4 -3
- data/lib/generated/azure_mgmt_compute/version.rb +1 -1
- data/lib/generated/azure_mgmt_compute/virtual_machine_extension_images.rb +7 -7
- data/lib/generated/azure_mgmt_compute/virtual_machine_extensions.rb +11 -7
- data/lib/generated/azure_mgmt_compute/virtual_machine_images.rb +11 -11
- data/lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb +32 -19
- data/lib/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb +50 -29
- data/lib/generated/azure_mgmt_compute/virtual_machine_sizes.rb +3 -3
- data/lib/generated/azure_mgmt_compute/virtual_machines.rb +45 -27
- metadata +20 -133
- data/.rspec +0 -3
- data/.yardoc/checksums +0 -106
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Rakefile +0 -5
- data/azure_mgmt_compute.gemspec +0 -32
- data/doc/Azure.html +0 -129
- data/doc/Azure/ARM.html +0 -117
- data/doc/Azure/ARM/Compute.html +0 -143
- data/doc/Azure/ARM/Compute/AvailabilitySets.html +0 -2935
- data/doc/Azure/ARM/Compute/ComputeManagementClient.html +0 -1759
- data/doc/Azure/ARM/Compute/Models.html +0 -126
- data/doc/Azure/ARM/Compute/Models/AdditionalUnattendContent.html +0 -674
- data/doc/Azure/ARM/Compute/Models/ApiEntityReference.html +0 -353
- data/doc/Azure/ARM/Compute/Models/ApiError.html +0 -779
- data/doc/Azure/ARM/Compute/Models/ApiErrorBase.html +0 -557
- data/doc/Azure/ARM/Compute/Models/AvailabilitySet.html +0 -784
- data/doc/Azure/ARM/Compute/Models/AvailabilitySetListResult.html +0 -369
- data/doc/Azure/ARM/Compute/Models/BootDiagnostics.html +0 -455
- data/doc/Azure/ARM/Compute/Models/BootDiagnosticsInstanceView.html +0 -455
- data/doc/Azure/ARM/Compute/Models/CachingTypes.html +0 -138
- data/doc/Azure/ARM/Compute/Models/ComponentNames.html +0 -128
- data/doc/Azure/ARM/Compute/Models/ComputeLongRunningOperationProperties.html +0 -353
- data/doc/Azure/ARM/Compute/Models/DataDisk.html +0 -977
- data/doc/Azure/ARM/Compute/Models/DataDiskImage.html +0 -357
- data/doc/Azure/ARM/Compute/Models/DiagnosticsProfile.html +0 -355
- data/doc/Azure/ARM/Compute/Models/DiskCreateOptionTypes.html +0 -138
- data/doc/Azure/ARM/Compute/Models/DiskEncryptionSettings.html +0 -561
- data/doc/Azure/ARM/Compute/Models/DiskInstanceView.html +0 -471
- data/doc/Azure/ARM/Compute/Models/HardwareProfile.html +0 -401
- data/doc/Azure/ARM/Compute/Models/ImageReference.html +0 -660
- data/doc/Azure/ARM/Compute/Models/InnerError.html +0 -455
- data/doc/Azure/ARM/Compute/Models/InstanceViewStatus.html +0 -763
- data/doc/Azure/ARM/Compute/Models/InstanceViewTypes.html +0 -128
- data/doc/Azure/ARM/Compute/Models/KeyVaultKeyReference.html +0 -457
- data/doc/Azure/ARM/Compute/Models/KeyVaultSecretReference.html +0 -457
- data/doc/Azure/ARM/Compute/Models/LinuxConfiguration.html +0 -457
- data/doc/Azure/ARM/Compute/Models/ListUsagesResult.html +0 -745
- data/doc/Azure/ARM/Compute/Models/NetworkInterfaceReference.html +0 -370
- data/doc/Azure/ARM/Compute/Models/NetworkProfile.html +0 -369
- data/doc/Azure/ARM/Compute/Models/OSDisk.html +0 -1083
- data/doc/Azure/ARM/Compute/Models/OSDiskImage.html +0 -355
- data/doc/Azure/ARM/Compute/Models/OSProfile.html +0 -985
- data/doc/Azure/ARM/Compute/Models/OperatingSystemTypes.html +0 -133
- data/doc/Azure/ARM/Compute/Models/PassNames.html +0 -128
- data/doc/Azure/ARM/Compute/Models/Plan.html +0 -659
- data/doc/Azure/ARM/Compute/Models/ProtocolTypes.html +0 -133
- data/doc/Azure/ARM/Compute/Models/PurchasePlan.html +0 -558
- data/doc/Azure/ARM/Compute/Models/SettingNames.html +0 -133
- data/doc/Azure/ARM/Compute/Models/Sku.html +0 -557
- data/doc/Azure/ARM/Compute/Models/SshConfiguration.html +0 -369
- data/doc/Azure/ARM/Compute/Models/SshPublicKey.html +0 -457
- data/doc/Azure/ARM/Compute/Models/StatusLevelTypes.html +0 -138
- data/doc/Azure/ARM/Compute/Models/StorageProfile.html +0 -577
- data/doc/Azure/ARM/Compute/Models/UpgradeMode.html +0 -133
- data/doc/Azure/ARM/Compute/Models/UpgradePolicy.html +0 -355
- data/doc/Azure/ARM/Compute/Models/Usage.html +0 -665
- data/doc/Azure/ARM/Compute/Models/UsageName.html +0 -455
- data/doc/Azure/ARM/Compute/Models/VaultCertificate.html +0 -456
- data/doc/Azure/ARM/Compute/Models/VaultSecretGroup.html +0 -473
- data/doc/Azure/ARM/Compute/Models/VirtualHardDisk.html +0 -353
- data/doc/Azure/ARM/Compute/Models/VirtualMachine.html +0 -1608
- data/doc/Azure/ARM/Compute/Models/VirtualMachineAgentInstanceView.html +0 -589
- data/doc/Azure/ARM/Compute/Models/VirtualMachineCaptureParameters.html +0 -557
- data/doc/Azure/ARM/Compute/Models/VirtualMachineCaptureResult.html +0 -370
- data/doc/Azure/ARM/Compute/Models/VirtualMachineExtension.html +0 -1266
- data/doc/Azure/ARM/Compute/Models/VirtualMachineExtensionHandlerInstanceView.html +0 -559
- data/doc/Azure/ARM/Compute/Models/VirtualMachineExtensionImage.html +0 -858
- data/doc/Azure/ARM/Compute/Models/VirtualMachineExtensionInstanceView.html +0 -793
- data/doc/Azure/ARM/Compute/Models/VirtualMachineImage.html +0 -637
- data/doc/Azure/ARM/Compute/Models/VirtualMachineImageResource.html +0 -592
- data/doc/Azure/ARM/Compute/Models/VirtualMachineInstanceView.html +0 -1119
- data/doc/Azure/ARM/Compute/Models/VirtualMachineListResult.html +0 -744
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSet.html +0 -862
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetExtension.html +0 -1086
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetExtensionProfile.html +0 -369
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetIPConfiguration.html +0 -829
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetInstanceView.html +0 -595
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetInstanceViewStatusesSummary.html +0 -373
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetListResult.html +0 -744
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetListSkusResult.html +0 -747
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetListWithLinkResult.html +0 -747
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetNetworkConfiguration.html +0 -591
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetNetworkProfile.html +0 -369
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetOSDisk.html +0 -889
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetOSProfile.html +0 -985
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetSku.html +0 -567
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetSkuCapacity.html +0 -669
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetSkuScaleType.html +0 -133
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetStorageProfile.html +0 -459
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetVM.html +0 -1818
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetVMExtensionsSummary.html +0 -475
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetVMInstanceIDs.html +0 -367
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetVMInstanceRequiredIDs.html +0 -367
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetVMInstanceView.html +0 -1119
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetVMListResult.html +0 -744
- data/doc/Azure/ARM/Compute/Models/VirtualMachineScaleSetVMProfile.html +0 -667
- data/doc/Azure/ARM/Compute/Models/VirtualMachineSize.html +0 -863
- data/doc/Azure/ARM/Compute/Models/VirtualMachineSizeListResult.html +0 -369
- data/doc/Azure/ARM/Compute/Models/VirtualMachineSizeTypes.html +0 -438
- data/doc/Azure/ARM/Compute/Models/VirtualMachineStatusCodeCount.html +0 -460
- data/doc/Azure/ARM/Compute/Models/WinRMConfiguration.html +0 -369
- data/doc/Azure/ARM/Compute/Models/WinRMListener.html +0 -458
- data/doc/Azure/ARM/Compute/Models/WindowsConfiguration.html +0 -781
- data/doc/Azure/ARM/Compute/UsageOperations.html +0 -1425
- data/doc/Azure/ARM/Compute/VirtualMachineExtensionImages.html +0 -2116
- data/doc/Azure/ARM/Compute/VirtualMachineExtensions.html +0 -2862
- data/doc/Azure/ARM/Compute/VirtualMachineImages.html +0 -3218
- data/doc/Azure/ARM/Compute/VirtualMachineScaleSetVMs.html +0 -7957
- data/doc/Azure/ARM/Compute/VirtualMachineScaleSets.html +0 -12417
- data/doc/Azure/ARM/Compute/VirtualMachineSizes.html +0 -823
- data/doc/Azure/ARM/Compute/VirtualMachines.html +0 -10514
- data/doc/_index.html +0 -970
- data/doc/class_list.html +0 -51
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -58
- data/doc/css/style.css +0 -474
- data/doc/file.README.html +0 -199
- data/doc/file_list.html +0 -56
- data/doc/frames.html +0 -17
- data/doc/index.html +0 -199
- data/doc/js/app.js +0 -243
- data/doc/js/full_list.js +0 -216
- data/doc/js/jquery.js +0 -4
- data/doc/method_list.html +0 -5147
- data/doc/top-level-namespace.html +0 -112
data/doc/file.README.html
DELETED
@@ -1,199 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="UTF-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>
|
7
|
-
File: README
|
8
|
-
|
9
|
-
— Documentation by YARD 0.9.2
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
pathId = "README";
|
19
|
-
relpath = '';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
|
23
|
-
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
-
|
25
|
-
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="file_list.html"></iframe>
|
32
|
-
<div id="resizer"></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="main" tabindex="-1">
|
36
|
-
<div id="header">
|
37
|
-
<div id="menu">
|
38
|
-
|
39
|
-
<a href="_index.html">Index</a> »
|
40
|
-
<span class="title">File: README</span>
|
41
|
-
|
42
|
-
</div>
|
43
|
-
|
44
|
-
<div id="search">
|
45
|
-
|
46
|
-
<a class="full_list_link" id="class_list_link"
|
47
|
-
href="class_list.html">
|
48
|
-
|
49
|
-
<svg width="24" height="24">
|
50
|
-
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
51
|
-
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
52
|
-
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
-
</svg>
|
54
|
-
</a>
|
55
|
-
|
56
|
-
</div>
|
57
|
-
<div class="clear"></div>
|
58
|
-
</div>
|
59
|
-
|
60
|
-
<iframe id="search_frame" src="file_list.html"></iframe>
|
61
|
-
|
62
|
-
<div id="content"><div id='filecontents'>
|
63
|
-
<h1 id="label-Intro">Intro</h1>
|
64
|
-
|
65
|
-
<p>This project provides a Ruby gem for easy access to the Azure ARM Compute
|
66
|
-
API. With this gem you can create/update/list/delete virtual machines,
|
67
|
-
virtual machine images and virtual machine extensions. Usage operations
|
68
|
-
aren't supported yet.</p>
|
69
|
-
|
70
|
-
<h1 id="label-Supported+Ruby+Versions">Supported Ruby Versions</h1>
|
71
|
-
<ul><li>
|
72
|
-
<p>Ruby 2+</p>
|
73
|
-
</li></ul>
|
74
|
-
|
75
|
-
<p>Note: x64 Ruby for Windows is known to have some compatibility issues.</p>
|
76
|
-
|
77
|
-
<h1 id="label-Getting+started">Getting started</h1>
|
78
|
-
|
79
|
-
<h2 id="label-Setting+up+the+service+principal">Setting up the service principal</h2>
|
80
|
-
|
81
|
-
<p>First of all to start interacting with the ARM compute you will need to
|
82
|
-
setup a service principal. Service principal is an Azure application which
|
83
|
-
allows you to authenticate to Azure and access Azure services. The detailed
|
84
|
-
steps of how to setup a service principal can be found in this article: <a
|
85
|
-
href="http://aka.ms/cli-service-principal">aka.ms/cli-service-principal</a>.
|
86
|
-
In the result of setting up service principal you will get tenant id,
|
87
|
-
client id and client secret data.</p>
|
88
|
-
|
89
|
-
<h2 id="label-Installation">Installation</h2>
|
90
|
-
|
91
|
-
<p>install the appropriate gem:</p>
|
92
|
-
|
93
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='id identifier rubyid_install'>install</span> <span class='id identifier rubyid_azure_mgmt_compute'>azure_mgmt_compute</span>
|
94
|
-
</code></pre>
|
95
|
-
|
96
|
-
<p>and reference it in your code:</p>
|
97
|
-
|
98
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>azure_mgmt_compute</span><span class='tstring_end'>'</span></span>
|
99
|
-
</code></pre>
|
100
|
-
|
101
|
-
<p>After that you should be ready to start using SDK!</p>
|
102
|
-
|
103
|
-
<h2 id="label-Authentication">Authentication</h2>
|
104
|
-
|
105
|
-
<pre class="code ruby"><code class="ruby"><span class='comment'># Create authentication objects
|
106
|
-
</span><span class='id identifier rubyid_token_provider'>token_provider</span> <span class='op'>=</span> <span class='const'>MsRestAzure</span><span class='op'>::</span><span class='const'>ApplicationTokenProvider</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_tenant_id'>tenant_id</span><span class='comma'>,</span> <span class='id identifier rubyid_client_id'>client_id</span><span class='comma'>,</span> <span class='id identifier rubyid_secret'>secret</span><span class='rparen'>)</span>
|
107
|
-
<span class='id identifier rubyid_credentials'>credentials</span> <span class='op'>=</span> <span class='const'>MsRest</span><span class='op'>::</span><span class='const'>TokenCredentials</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_token_provider'>token_provider</span><span class='rparen'>)</span>
|
108
|
-
</code></pre>
|
109
|
-
|
110
|
-
<p>To get tenant_id, client_id and secret for your Azure application visit
|
111
|
-
Azure portal or copy them from the powershell script from the article
|
112
|
-
mentioned above.</p>
|
113
|
-
|
114
|
-
<h2 id="label-Creating+new+virtual+machine">Creating new virtual machine</h2>
|
115
|
-
|
116
|
-
<pre class="code ruby"><code class="ruby"><span class='comment'># Include SDK modules to ease access to compute classes.
|
117
|
-
</span><span class='id identifier rubyid_include'>include</span> <span class='const'>Azure</span><span class='op'>::</span><span class='const'>ARM</span><span class='op'>::</span><span class='const'>Compute</span>
|
118
|
-
<span class='id identifier rubyid_include'>include</span> <span class='const'>Azure</span><span class='op'>::</span><span class='const'>ARM</span><span class='op'>::</span><span class='const'>Compute</span><span class='op'>::</span><span class='const'>Models</span>
|
119
|
-
|
120
|
-
<span class='comment'># Create a client - a point of access to the API and set the subscription id
|
121
|
-
</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'>ComputeManagementClient</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_credentials'>credentials</span><span class='rparen'>)</span>
|
122
|
-
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_subscription_id'>subscription_id</span> <span class='op'>=</span> <span class='id identifier rubyid_subscription_id'>subscription_id</span>
|
123
|
-
|
124
|
-
<span class='comment'># Create a model for new virtual machine
|
125
|
-
</span><span class='id identifier rubyid_props'>props</span> <span class='op'>=</span> <span class='const'>VirtualMachineProperties</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
126
|
-
|
127
|
-
<span class='id identifier rubyid_windows_config'>windows_config</span> <span class='op'>=</span> <span class='const'>WindowsConfiguration</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
128
|
-
<span class='id identifier rubyid_windows_config'>windows_config</span><span class='period'>.</span><span class='id identifier rubyid_provision_vmagent'>provision_vmagent</span> <span class='op'>=</span> <span class='kw'>true</span>
|
129
|
-
<span class='id identifier rubyid_windows_config'>windows_config</span><span class='period'>.</span><span class='id identifier rubyid_enable_automatic_updates'>enable_automatic_updates</span> <span class='op'>=</span> <span class='kw'>true</span>
|
130
|
-
|
131
|
-
<span class='id identifier rubyid_os_profile'>os_profile</span> <span class='op'>=</span> <span class='const'>OSProfile</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
132
|
-
<span class='id identifier rubyid_os_profile'>os_profile</span><span class='period'>.</span><span class='id identifier rubyid_computer_name'>computer_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>testvm1</span><span class='tstring_end'>'</span></span>
|
133
|
-
<span class='id identifier rubyid_os_profile'>os_profile</span><span class='period'>.</span><span class='id identifier rubyid_admin_username'>admin_username</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>testvm1</span><span class='tstring_end'>'</span></span>
|
134
|
-
<span class='id identifier rubyid_os_profile'>os_profile</span><span class='period'>.</span><span class='id identifier rubyid_admin_password'>admin_password</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>P@ssword1</span><span class='tstring_end'>'</span></span>
|
135
|
-
<span class='id identifier rubyid_os_profile'>os_profile</span><span class='period'>.</span><span class='id identifier rubyid_windows_configuration'>windows_configuration</span> <span class='op'>=</span> <span class='id identifier rubyid_windows_config'>windows_config</span>
|
136
|
-
<span class='id identifier rubyid_os_profile'>os_profile</span><span class='period'>.</span><span class='id identifier rubyid_secrets'>secrets</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
137
|
-
<span class='id identifier rubyid_props'>props</span><span class='period'>.</span><span class='id identifier rubyid_os_profile'>os_profile</span> <span class='op'>=</span> <span class='id identifier rubyid_os_profile'>os_profile</span>
|
138
|
-
|
139
|
-
<span class='id identifier rubyid_hardware_profile'>hardware_profile</span> <span class='op'>=</span> <span class='const'>HardwareProfile</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
140
|
-
<span class='id identifier rubyid_hardware_profile'>hardware_profile</span><span class='period'>.</span><span class='id identifier rubyid_vm_size'>vm_size</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Standard_A0</span><span class='tstring_end'>'</span></span>
|
141
|
-
<span class='id identifier rubyid_props'>props</span><span class='period'>.</span><span class='id identifier rubyid_hardware_profile'>hardware_profile</span> <span class='op'>=</span> <span class='id identifier rubyid_hardware_profile'>hardware_profile</span>
|
142
|
-
|
143
|
-
<span class='comment'># create_storage_profile it is hypotetical helper method which creates storage
|
144
|
-
</span><span class='comment'># profile by means of ARM Storage SDK.
|
145
|
-
</span><span class='id identifier rubyid_props'>props</span><span class='period'>.</span><span class='id identifier rubyid_storage_profile'>storage_profile</span> <span class='op'>=</span> <span class='id identifier rubyid_create_storage_profile'>create_storage_profile</span>
|
146
|
-
|
147
|
-
<span class='comment'># create_storage_profile it is hypotetical helper method which creates network
|
148
|
-
</span><span class='comment'># profile my means of ARM Network SDK.
|
149
|
-
</span><span class='id identifier rubyid_props'>props</span><span class='period'>.</span><span class='id identifier rubyid_network_profile'>network_profile</span> <span class='op'>=</span> <span class='id identifier rubyid_create_network_profile'>create_network_profile</span>
|
150
|
-
|
151
|
-
<span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='const'>VirtualMachine</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
152
|
-
<span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Microsoft.Compute/virtualMachines</span><span class='tstring_end'>'</span></span>
|
153
|
-
<span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_properties'>properties</span> <span class='op'>=</span> <span class='id identifier rubyid_props'>props</span>
|
154
|
-
<span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_location'>location</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>westus</span><span class='tstring_end'>'</span></span>
|
155
|
-
|
156
|
-
<span class='id identifier rubyid_promise'>promise</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_virtual_machines'>virtual_machines</span><span class='period'>.</span><span class='id identifier rubyid_create_or_update_async'>create_or_update_async</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>existing_resource_group_name</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>name_of_new_vm</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
|
157
|
-
</code></pre>
|
158
|
-
|
159
|
-
<p>The SDK method returns a promise which you can utilize depending on your
|
160
|
-
needs. E.g. if you need to get result immediately via sync blocking call -
|
161
|
-
do the following:</p>
|
162
|
-
|
163
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_promise'>promise</span><span class='period'>.</span><span class='id identifier rubyid_value!'>value!</span>
|
164
|
-
</code></pre>
|
165
|
-
|
166
|
-
<p>If you need to follow async flow - provide a block which will be executed
|
167
|
-
in off main thread:</p>
|
168
|
-
|
169
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_promise'>promise</span> <span class='op'>=</span> <span class='id identifier rubyid_promise'>promise</span><span class='period'>.</span><span class='id identifier rubyid_then'>then</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_result'>result</span><span class='op'>|</span>
|
170
|
-
<span class='comment'># Handle the result
|
171
|
-
</span><span class='kw'>end</span>
|
172
|
-
</code></pre>
|
173
|
-
|
174
|
-
<p>In both cases you're returned an instance of
|
175
|
-
MsRestAzure::AzureOperationResponse which contains HTTP requests/response
|
176
|
-
objects and response body. Response body is a deserialized object
|
177
|
-
representing the received information. In case of code above - newly
|
178
|
-
created virtual machine. To get data from it:</p>
|
179
|
-
|
180
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_vm'>vm</span> <span class='op'>=</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
|
181
|
-
|
182
|
-
<span class='id identifier rubyid_p'>p</span> <span class='id identifier rubyid_vm'>vm</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='comment'># name of the new vm
|
183
|
-
</span><span class='id identifier rubyid_p'>p</span> <span class='id identifier rubyid_vm'>vm</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='comment'># id of the new vm
|
184
|
-
</span></code></pre>
|
185
|
-
|
186
|
-
<p>Congrats, you've create new virtual machine. We encourage you to try
|
187
|
-
more stuff and let us know your feedback! For advanced SDK usage please
|
188
|
-
reference to the spec files.</p>
|
189
|
-
</div></div>
|
190
|
-
|
191
|
-
<div id="footer">
|
192
|
-
Generated on Thu Jul 21 16:09:34 2016 by
|
193
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
194
|
-
0.9.2 (ruby-2.3.0).
|
195
|
-
</div>
|
196
|
-
|
197
|
-
</div>
|
198
|
-
</body>
|
199
|
-
</html>
|
data/doc/file_list.html
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
5
|
-
<meta charset="utf-8" />
|
6
|
-
|
7
|
-
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
-
|
9
|
-
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
14
|
-
|
15
|
-
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
16
|
-
|
17
|
-
|
18
|
-
<title>File List</title>
|
19
|
-
<base id="base_target" target="_parent" />
|
20
|
-
</head>
|
21
|
-
<body>
|
22
|
-
<div id="content">
|
23
|
-
<div class="fixed_header">
|
24
|
-
<h1 id="full_list_header">File List</h1>
|
25
|
-
<div id="full_list_nav">
|
26
|
-
|
27
|
-
<span><a target="_self" href="class_list.html">
|
28
|
-
Classes
|
29
|
-
</a></span>
|
30
|
-
|
31
|
-
<span><a target="_self" href="method_list.html">
|
32
|
-
Methods
|
33
|
-
</a></span>
|
34
|
-
|
35
|
-
<span><a target="_self" href="file_list.html">
|
36
|
-
Files
|
37
|
-
</a></span>
|
38
|
-
|
39
|
-
</div>
|
40
|
-
|
41
|
-
<div id="search">Search: <input type="text" /></div>
|
42
|
-
</div>
|
43
|
-
|
44
|
-
<ul id="full_list" class="file">
|
45
|
-
|
46
|
-
|
47
|
-
<li id="object_README" class="odd">
|
48
|
-
<div class="item"><span class="object_link"><a href="index.html" title="README">README</a></span></div>
|
49
|
-
</li>
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
</ul>
|
54
|
-
</div>
|
55
|
-
</body>
|
56
|
-
</html>
|
data/doc/frames.html
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<title>Documentation by YARD 0.9.2</title>
|
6
|
-
</head>
|
7
|
-
<script type="text/javascript" charset="utf-8">
|
8
|
-
var match = unescape(window.location.hash).match(/^#!(.+)/);
|
9
|
-
var name = match ? match[1] : 'index.html';
|
10
|
-
name = name.replace(/^(\w+):\/\//, '').replace(/^\/\//, '');
|
11
|
-
window.top.location = name;
|
12
|
-
</script>
|
13
|
-
<noscript>
|
14
|
-
<h1>Oops!</h1>
|
15
|
-
<h2>YARD requires JavaScript!</h2>
|
16
|
-
</noscript>
|
17
|
-
</html>
|
data/doc/index.html
DELETED
@@ -1,199 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="UTF-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>
|
7
|
-
File: README
|
8
|
-
|
9
|
-
— Documentation by YARD 0.9.2
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
pathId = "README";
|
19
|
-
relpath = '';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
|
23
|
-
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
-
|
25
|
-
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="class_list.html"></iframe>
|
32
|
-
<div id="resizer"></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="main" tabindex="-1">
|
36
|
-
<div id="header">
|
37
|
-
<div id="menu">
|
38
|
-
|
39
|
-
<a href="_index.html">Index</a> »
|
40
|
-
<span class="title">File: README</span>
|
41
|
-
|
42
|
-
</div>
|
43
|
-
|
44
|
-
<div id="search">
|
45
|
-
|
46
|
-
<a class="full_list_link" id="class_list_link"
|
47
|
-
href="class_list.html">
|
48
|
-
|
49
|
-
<svg width="24" height="24">
|
50
|
-
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
51
|
-
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
52
|
-
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
-
</svg>
|
54
|
-
</a>
|
55
|
-
|
56
|
-
</div>
|
57
|
-
<div class="clear"></div>
|
58
|
-
</div>
|
59
|
-
|
60
|
-
<iframe id="search_frame" src="class_list.html"></iframe>
|
61
|
-
|
62
|
-
<div id="content"><div id='filecontents'>
|
63
|
-
<h1 id="label-Intro">Intro</h1>
|
64
|
-
|
65
|
-
<p>This project provides a Ruby gem for easy access to the Azure ARM Compute
|
66
|
-
API. With this gem you can create/update/list/delete virtual machines,
|
67
|
-
virtual machine images and virtual machine extensions. Usage operations
|
68
|
-
aren't supported yet.</p>
|
69
|
-
|
70
|
-
<h1 id="label-Supported+Ruby+Versions">Supported Ruby Versions</h1>
|
71
|
-
<ul><li>
|
72
|
-
<p>Ruby 2+</p>
|
73
|
-
</li></ul>
|
74
|
-
|
75
|
-
<p>Note: x64 Ruby for Windows is known to have some compatibility issues.</p>
|
76
|
-
|
77
|
-
<h1 id="label-Getting+started">Getting started</h1>
|
78
|
-
|
79
|
-
<h2 id="label-Setting+up+the+service+principal">Setting up the service principal</h2>
|
80
|
-
|
81
|
-
<p>First of all to start interacting with the ARM compute you will need to
|
82
|
-
setup a service principal. Service principal is an Azure application which
|
83
|
-
allows you to authenticate to Azure and access Azure services. The detailed
|
84
|
-
steps of how to setup a service principal can be found in this article: <a
|
85
|
-
href="http://aka.ms/cli-service-principal">aka.ms/cli-service-principal</a>.
|
86
|
-
In the result of setting up service principal you will get tenant id,
|
87
|
-
client id and client secret data.</p>
|
88
|
-
|
89
|
-
<h2 id="label-Installation">Installation</h2>
|
90
|
-
|
91
|
-
<p>install the appropriate gem:</p>
|
92
|
-
|
93
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='id identifier rubyid_install'>install</span> <span class='id identifier rubyid_azure_mgmt_compute'>azure_mgmt_compute</span>
|
94
|
-
</code></pre>
|
95
|
-
|
96
|
-
<p>and reference it in your code:</p>
|
97
|
-
|
98
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>azure_mgmt_compute</span><span class='tstring_end'>'</span></span>
|
99
|
-
</code></pre>
|
100
|
-
|
101
|
-
<p>After that you should be ready to start using SDK!</p>
|
102
|
-
|
103
|
-
<h2 id="label-Authentication">Authentication</h2>
|
104
|
-
|
105
|
-
<pre class="code ruby"><code class="ruby"><span class='comment'># Create authentication objects
|
106
|
-
</span><span class='id identifier rubyid_token_provider'>token_provider</span> <span class='op'>=</span> <span class='const'>MsRestAzure</span><span class='op'>::</span><span class='const'>ApplicationTokenProvider</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_tenant_id'>tenant_id</span><span class='comma'>,</span> <span class='id identifier rubyid_client_id'>client_id</span><span class='comma'>,</span> <span class='id identifier rubyid_secret'>secret</span><span class='rparen'>)</span>
|
107
|
-
<span class='id identifier rubyid_credentials'>credentials</span> <span class='op'>=</span> <span class='const'>MsRest</span><span class='op'>::</span><span class='const'>TokenCredentials</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_token_provider'>token_provider</span><span class='rparen'>)</span>
|
108
|
-
</code></pre>
|
109
|
-
|
110
|
-
<p>To get tenant_id, client_id and secret for your Azure application visit
|
111
|
-
Azure portal or copy them from the powershell script from the article
|
112
|
-
mentioned above.</p>
|
113
|
-
|
114
|
-
<h2 id="label-Creating+new+virtual+machine">Creating new virtual machine</h2>
|
115
|
-
|
116
|
-
<pre class="code ruby"><code class="ruby"><span class='comment'># Include SDK modules to ease access to compute classes.
|
117
|
-
</span><span class='id identifier rubyid_include'>include</span> <span class='const'>Azure</span><span class='op'>::</span><span class='const'>ARM</span><span class='op'>::</span><span class='const'>Compute</span>
|
118
|
-
<span class='id identifier rubyid_include'>include</span> <span class='const'>Azure</span><span class='op'>::</span><span class='const'>ARM</span><span class='op'>::</span><span class='const'>Compute</span><span class='op'>::</span><span class='const'>Models</span>
|
119
|
-
|
120
|
-
<span class='comment'># Create a client - a point of access to the API and set the subscription id
|
121
|
-
</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'>ComputeManagementClient</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_credentials'>credentials</span><span class='rparen'>)</span>
|
122
|
-
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_subscription_id'>subscription_id</span> <span class='op'>=</span> <span class='id identifier rubyid_subscription_id'>subscription_id</span>
|
123
|
-
|
124
|
-
<span class='comment'># Create a model for new virtual machine
|
125
|
-
</span><span class='id identifier rubyid_props'>props</span> <span class='op'>=</span> <span class='const'>VirtualMachineProperties</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
126
|
-
|
127
|
-
<span class='id identifier rubyid_windows_config'>windows_config</span> <span class='op'>=</span> <span class='const'>WindowsConfiguration</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
128
|
-
<span class='id identifier rubyid_windows_config'>windows_config</span><span class='period'>.</span><span class='id identifier rubyid_provision_vmagent'>provision_vmagent</span> <span class='op'>=</span> <span class='kw'>true</span>
|
129
|
-
<span class='id identifier rubyid_windows_config'>windows_config</span><span class='period'>.</span><span class='id identifier rubyid_enable_automatic_updates'>enable_automatic_updates</span> <span class='op'>=</span> <span class='kw'>true</span>
|
130
|
-
|
131
|
-
<span class='id identifier rubyid_os_profile'>os_profile</span> <span class='op'>=</span> <span class='const'>OSProfile</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
132
|
-
<span class='id identifier rubyid_os_profile'>os_profile</span><span class='period'>.</span><span class='id identifier rubyid_computer_name'>computer_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>testvm1</span><span class='tstring_end'>'</span></span>
|
133
|
-
<span class='id identifier rubyid_os_profile'>os_profile</span><span class='period'>.</span><span class='id identifier rubyid_admin_username'>admin_username</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>testvm1</span><span class='tstring_end'>'</span></span>
|
134
|
-
<span class='id identifier rubyid_os_profile'>os_profile</span><span class='period'>.</span><span class='id identifier rubyid_admin_password'>admin_password</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>P@ssword1</span><span class='tstring_end'>'</span></span>
|
135
|
-
<span class='id identifier rubyid_os_profile'>os_profile</span><span class='period'>.</span><span class='id identifier rubyid_windows_configuration'>windows_configuration</span> <span class='op'>=</span> <span class='id identifier rubyid_windows_config'>windows_config</span>
|
136
|
-
<span class='id identifier rubyid_os_profile'>os_profile</span><span class='period'>.</span><span class='id identifier rubyid_secrets'>secrets</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
137
|
-
<span class='id identifier rubyid_props'>props</span><span class='period'>.</span><span class='id identifier rubyid_os_profile'>os_profile</span> <span class='op'>=</span> <span class='id identifier rubyid_os_profile'>os_profile</span>
|
138
|
-
|
139
|
-
<span class='id identifier rubyid_hardware_profile'>hardware_profile</span> <span class='op'>=</span> <span class='const'>HardwareProfile</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
140
|
-
<span class='id identifier rubyid_hardware_profile'>hardware_profile</span><span class='period'>.</span><span class='id identifier rubyid_vm_size'>vm_size</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Standard_A0</span><span class='tstring_end'>'</span></span>
|
141
|
-
<span class='id identifier rubyid_props'>props</span><span class='period'>.</span><span class='id identifier rubyid_hardware_profile'>hardware_profile</span> <span class='op'>=</span> <span class='id identifier rubyid_hardware_profile'>hardware_profile</span>
|
142
|
-
|
143
|
-
<span class='comment'># create_storage_profile it is hypotetical helper method which creates storage
|
144
|
-
</span><span class='comment'># profile by means of ARM Storage SDK.
|
145
|
-
</span><span class='id identifier rubyid_props'>props</span><span class='period'>.</span><span class='id identifier rubyid_storage_profile'>storage_profile</span> <span class='op'>=</span> <span class='id identifier rubyid_create_storage_profile'>create_storage_profile</span>
|
146
|
-
|
147
|
-
<span class='comment'># create_storage_profile it is hypotetical helper method which creates network
|
148
|
-
</span><span class='comment'># profile my means of ARM Network SDK.
|
149
|
-
</span><span class='id identifier rubyid_props'>props</span><span class='period'>.</span><span class='id identifier rubyid_network_profile'>network_profile</span> <span class='op'>=</span> <span class='id identifier rubyid_create_network_profile'>create_network_profile</span>
|
150
|
-
|
151
|
-
<span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='const'>VirtualMachine</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
152
|
-
<span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Microsoft.Compute/virtualMachines</span><span class='tstring_end'>'</span></span>
|
153
|
-
<span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_properties'>properties</span> <span class='op'>=</span> <span class='id identifier rubyid_props'>props</span>
|
154
|
-
<span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_location'>location</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>westus</span><span class='tstring_end'>'</span></span>
|
155
|
-
|
156
|
-
<span class='id identifier rubyid_promise'>promise</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_virtual_machines'>virtual_machines</span><span class='period'>.</span><span class='id identifier rubyid_create_or_update_async'>create_or_update_async</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>existing_resource_group_name</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>name_of_new_vm</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
|
157
|
-
</code></pre>
|
158
|
-
|
159
|
-
<p>The SDK method returns a promise which you can utilize depending on your
|
160
|
-
needs. E.g. if you need to get result immediately via sync blocking call -
|
161
|
-
do the following:</p>
|
162
|
-
|
163
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_promise'>promise</span><span class='period'>.</span><span class='id identifier rubyid_value!'>value!</span>
|
164
|
-
</code></pre>
|
165
|
-
|
166
|
-
<p>If you need to follow async flow - provide a block which will be executed
|
167
|
-
in off main thread:</p>
|
168
|
-
|
169
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_promise'>promise</span> <span class='op'>=</span> <span class='id identifier rubyid_promise'>promise</span><span class='period'>.</span><span class='id identifier rubyid_then'>then</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_result'>result</span><span class='op'>|</span>
|
170
|
-
<span class='comment'># Handle the result
|
171
|
-
</span><span class='kw'>end</span>
|
172
|
-
</code></pre>
|
173
|
-
|
174
|
-
<p>In both cases you're returned an instance of
|
175
|
-
MsRestAzure::AzureOperationResponse which contains HTTP requests/response
|
176
|
-
objects and response body. Response body is a deserialized object
|
177
|
-
representing the received information. In case of code above - newly
|
178
|
-
created virtual machine. To get data from it:</p>
|
179
|
-
|
180
|
-
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_vm'>vm</span> <span class='op'>=</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
|
181
|
-
|
182
|
-
<span class='id identifier rubyid_p'>p</span> <span class='id identifier rubyid_vm'>vm</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='comment'># name of the new vm
|
183
|
-
</span><span class='id identifier rubyid_p'>p</span> <span class='id identifier rubyid_vm'>vm</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='comment'># id of the new vm
|
184
|
-
</span></code></pre>
|
185
|
-
|
186
|
-
<p>Congrats, you've create new virtual machine. We encourage you to try
|
187
|
-
more stuff and let us know your feedback! For advanced SDK usage please
|
188
|
-
reference to the spec files.</p>
|
189
|
-
</div></div>
|
190
|
-
|
191
|
-
<div id="footer">
|
192
|
-
Generated on Thu Jul 21 16:09:33 2016 by
|
193
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
194
|
-
0.9.2 (ruby-2.3.0).
|
195
|
-
</div>
|
196
|
-
|
197
|
-
</div>
|
198
|
-
</body>
|
199
|
-
</html>
|