azure_mgmt_compute 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +3 -0
- data/.travis.yml +3 -0
- data/Gemfile +17 -0
- data/LICENSE.txt +21 -0
- data/README.md +139 -0
- data/Rakefile +5 -0
- data/azure_mgmt_compute.gemspec +39 -0
- data/lib/azure_mgmt_compute.rb +103 -0
- data/lib/azure_mgmt_compute/Models/additional_unattend_content.rb +108 -0
- data/lib/azure_mgmt_compute/Models/api_error.rb +121 -0
- data/lib/azure_mgmt_compute/Models/api_error_base.rb +76 -0
- data/lib/azure_mgmt_compute/Models/availability_set.rb +94 -0
- data/lib/azure_mgmt_compute/Models/availability_set_list_result.rb +79 -0
- data/lib/azure_mgmt_compute/Models/availability_set_properties.rb +130 -0
- data/lib/azure_mgmt_compute/Models/caching_types.rb +17 -0
- data/lib/azure_mgmt_compute/Models/component_names.rb +15 -0
- data/lib/azure_mgmt_compute/Models/compute_long_running_operation_properties.rb +58 -0
- data/lib/azure_mgmt_compute/Models/compute_long_running_operation_result.rb +126 -0
- data/lib/azure_mgmt_compute/Models/compute_operation_status.rb +18 -0
- data/lib/azure_mgmt_compute/Models/data_disk.rb +142 -0
- data/lib/azure_mgmt_compute/Models/data_disk_image.rb +62 -0
- data/lib/azure_mgmt_compute/Models/delete_operation_result.rb +109 -0
- data/lib/azure_mgmt_compute/Models/disk_create_option_types.rb +17 -0
- data/lib/azure_mgmt_compute/Models/disk_instance_view.rb +88 -0
- data/lib/azure_mgmt_compute/Models/hardware_profile.rb +67 -0
- data/lib/azure_mgmt_compute/Models/image_reference.rb +87 -0
- data/lib/azure_mgmt_compute/Models/inner_error.rb +68 -0
- data/lib/azure_mgmt_compute/Models/instance_view_status.rb +102 -0
- data/lib/azure_mgmt_compute/Models/linux_configuration.rb +75 -0
- data/lib/azure_mgmt_compute/Models/list_usages_result.rb +78 -0
- data/lib/azure_mgmt_compute/Models/network_interface_reference.rb +70 -0
- data/lib/azure_mgmt_compute/Models/network_interface_reference_properties.rb +59 -0
- data/lib/azure_mgmt_compute/Models/network_profile.rb +79 -0
- data/lib/azure_mgmt_compute/Models/operating_system_types.rb +16 -0
- data/lib/azure_mgmt_compute/Models/operation_status.rb +17 -0
- data/lib/azure_mgmt_compute/Models/osdisk.rb +135 -0
- data/lib/azure_mgmt_compute/Models/osdisk_image.rb +63 -0
- data/lib/azure_mgmt_compute/Models/osprofile.rb +149 -0
- data/lib/azure_mgmt_compute/Models/pass_names.rb +15 -0
- data/lib/azure_mgmt_compute/Models/plan.rb +85 -0
- data/lib/azure_mgmt_compute/Models/protocol_types.rb +16 -0
- data/lib/azure_mgmt_compute/Models/purchase_plan.rb +77 -0
- data/lib/azure_mgmt_compute/Models/setting_names.rb +16 -0
- data/lib/azure_mgmt_compute/Models/ssh_configuration.rb +79 -0
- data/lib/azure_mgmt_compute/Models/ssh_public_key.rb +72 -0
- data/lib/azure_mgmt_compute/Models/status_level_types.rb +17 -0
- data/lib/azure_mgmt_compute/Models/storage_profile.rb +110 -0
- data/lib/azure_mgmt_compute/Models/usage.rb +98 -0
- data/lib/azure_mgmt_compute/Models/usage_name.rb +68 -0
- data/lib/azure_mgmt_compute/Models/usage_unit.rb +15 -0
- data/lib/azure_mgmt_compute/Models/vault_certificate.rb +70 -0
- data/lib/azure_mgmt_compute/Models/vault_secret_group.rb +96 -0
- data/lib/azure_mgmt_compute/Models/virtual_hard_disk.rb +59 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine.rb +142 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_agent_instance_view.rb +119 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_capture_parameters.rb +78 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_extension.rb +94 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_extension_handler_instance_view.rb +85 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_extension_image.rb +99 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_extension_image_properties.rb +102 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_extension_instance_view.rb +139 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_extension_properties.rb +133 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_image.rb +99 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_image_properties.rb +110 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_image_resource.rb +83 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_instance_view.rb +188 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_list_result.rb +89 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_properties.rb +156 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_size.rb +111 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_size_list_result.rb +79 -0
- data/lib/azure_mgmt_compute/Models/virtual_machine_size_types.rb +34 -0
- data/lib/azure_mgmt_compute/Models/win_rmconfiguration.rb +79 -0
- data/lib/azure_mgmt_compute/Models/win_rmlistener.rb +73 -0
- data/lib/azure_mgmt_compute/Models/windows_configuration.rb +126 -0
- data/lib/azure_mgmt_compute/availability_sets.rb +473 -0
- data/lib/azure_mgmt_compute/compute_management_client.rb +85 -0
- data/lib/azure_mgmt_compute/module_definition.rb +6 -0
- data/lib/azure_mgmt_compute/usage_operations.rb +113 -0
- data/lib/azure_mgmt_compute/version.rb +6 -0
- data/lib/azure_mgmt_compute/virtual_machine_extension_images.rb +325 -0
- data/lib/azure_mgmt_compute/virtual_machine_extensions.rb +384 -0
- data/lib/azure_mgmt_compute/virtual_machine_images.rb +525 -0
- data/lib/azure_mgmt_compute/virtual_machine_sizes.rb +114 -0
- data/lib/azure_mgmt_compute/virtual_machines.rb +1412 -0
- metadata +303 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 27d32c64a143075b94e6cb7285f63a8f6613f345
|
4
|
+
data.tar.gz: dba1136554435d2f9d7846c227afab8f4c37cacc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 362d22874bd9680de59fe3da344d2aad333b34d867e80ec7ec86a4d4a92730180bd713093a19649053fe9003f75509bb5295635627d167f83d0418020ae93769
|
7
|
+
data.tar.gz: 787ac6d3e0b2f1f41952bdfa0c3af5cd16accdd029e1472a92788232694b88f21f540c028f8ba33f75330d6617179d33b219b204f669e495e9f87b45afc06ba2
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
4
|
+
|
5
|
+
source 'https://rubygems.org'
|
6
|
+
|
7
|
+
gemspec
|
8
|
+
|
9
|
+
group :development do
|
10
|
+
gem 'azure_mgmt_resources', path: '../azure_mgmt_resources'
|
11
|
+
gem 'azure_mgmt_storage', path: '../azure_mgmt_storage'
|
12
|
+
gem 'azure_mgmt_network', path: '../azure_mgmt_network'
|
13
|
+
end
|
14
|
+
|
15
|
+
group :test do
|
16
|
+
gem 'rspec'
|
17
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Microsoft Corporation
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
# Intro
|
2
|
+
|
3
|
+
This project provides a Ruby gem for easy access to the Azure ARM Compute API. With this gem you can create/update/list/delete virtual machines, virtual machine images and virtual machine extensions. Usage operations aren't supported yet.
|
4
|
+
|
5
|
+
# Supported Ruby Versions
|
6
|
+
|
7
|
+
* Ruby 2+
|
8
|
+
|
9
|
+
Note: x64 Ruby for Windows is known to have some compatibility issues.
|
10
|
+
|
11
|
+
# Getting started
|
12
|
+
|
13
|
+
## Setting up the service principal
|
14
|
+
|
15
|
+
First of all to start interacting with the ARM compute you will need to setup a service principal. Service principal is an Azure application which allows you to authenticate to Azure and access Azure services. The detailed steps of how to setup a service principal can be found in this article: http://aka.ms/cli-service-principal. In the result of setting up service principal you will get tenant id, client id and client secret data.
|
16
|
+
|
17
|
+
## Installation
|
18
|
+
|
19
|
+
install the appropriate gem:
|
20
|
+
|
21
|
+
```
|
22
|
+
gem install azure_mgmt_compute
|
23
|
+
```
|
24
|
+
|
25
|
+
and reference it in your code:
|
26
|
+
|
27
|
+
```Ruby
|
28
|
+
require 'azure_mgmt_compute'
|
29
|
+
```
|
30
|
+
|
31
|
+
After that you should be ready to start using SDK!
|
32
|
+
|
33
|
+
## Authentication
|
34
|
+
|
35
|
+
```Ruby
|
36
|
+
# Create authentication objects
|
37
|
+
token_provider = MsRestAzure::ApplicationTokenProvider.new(tenant_id, client_id, secret)
|
38
|
+
credentials = MsRest::TokenCredentials.new(token_provider)
|
39
|
+
```
|
40
|
+
|
41
|
+
To get tenant_id, client_id and secret for your Azure application visit Azure portal or copy them from the powershell script from the article mentioned above.
|
42
|
+
|
43
|
+
## Creating new virtual machine
|
44
|
+
|
45
|
+
```Ruby
|
46
|
+
# Include SDK modules to ease access to compute classes.
|
47
|
+
include Azure::ARM::Compute
|
48
|
+
include Azure::ARM::Compute::Models
|
49
|
+
|
50
|
+
# Create a client - a point of access to the API and set the subscription id
|
51
|
+
client = ComputeManagementClient.new(credentials)
|
52
|
+
client.subscription_id = subscription_id
|
53
|
+
|
54
|
+
# Create a model for new virtual machine
|
55
|
+
props = VirtualMachineProperties.new
|
56
|
+
|
57
|
+
windows_config = WindowsConfiguration.new
|
58
|
+
windows_config.provision_vmagent = true
|
59
|
+
windows_config.enable_automatic_updates = true
|
60
|
+
|
61
|
+
os_profile = OSProfile.new
|
62
|
+
os_profile.computer_name = 'testvm1'
|
63
|
+
os_profile.admin_username = 'testvm1'
|
64
|
+
os_profile.admin_password = 'P@ssword1'
|
65
|
+
os_profile.windows_configuration = windows_config
|
66
|
+
os_profile.secrets = []
|
67
|
+
props.os_profile = os_profile
|
68
|
+
|
69
|
+
hardware_profile = HardwareProfile.new
|
70
|
+
hardware_profile.vm_size = 'Standard_A0'
|
71
|
+
props.hardware_profile = hardware_profile
|
72
|
+
|
73
|
+
# create_storage_profile it is hypotetical helper method which creates storage
|
74
|
+
# profile by means of ARM Storage SDK.
|
75
|
+
props.storage_profile = create_storage_profile
|
76
|
+
|
77
|
+
# create_storage_profile it is hypotetical helper method which creates network
|
78
|
+
# profile my means of ARM Network SDK.
|
79
|
+
props.network_profile = create_network_profile
|
80
|
+
|
81
|
+
params = VirtualMachine.new
|
82
|
+
params.type = 'Microsoft.Compute/virtualMachines'
|
83
|
+
params.properties = props
|
84
|
+
params.location = 'westus'
|
85
|
+
|
86
|
+
promise = client.virtual_machines.create_or_update('existing_resource_group_name', 'name_of_new_vm', params)
|
87
|
+
```
|
88
|
+
|
89
|
+
The SDK method returns a promise which you can utilize depending on your needs. E.g. if you need to get result immediately via sync blocking call - do the following:
|
90
|
+
|
91
|
+
```Ruby
|
92
|
+
result = promise.value!
|
93
|
+
```
|
94
|
+
|
95
|
+
If you need to follow async flow - provide a block which will be executed in off main thread:
|
96
|
+
|
97
|
+
```Ruby
|
98
|
+
promise = promise.then do |result|
|
99
|
+
# Handle the result
|
100
|
+
end
|
101
|
+
```
|
102
|
+
|
103
|
+
In both cases you're returned an instance of MsRestAzure::AzureOperationResponse which contains HTTP requests/response objects and response body. Response body is a deserialized object representing the received information. In case of code above - newly created virtual machine. To get data from it:
|
104
|
+
|
105
|
+
```Ruby
|
106
|
+
vm = result.body
|
107
|
+
|
108
|
+
p vm.name # name of the new vm
|
109
|
+
p vm.id # id of the new vm
|
110
|
+
```
|
111
|
+
|
112
|
+
Congrats, you've create new virtual machine. We encourage you to try more stuff and let us know your feedback!
|
113
|
+
For advanced SDK usage please reference to the spec files.
|
114
|
+
|
115
|
+
# Running tests
|
116
|
+
|
117
|
+
## Adding env variables
|
118
|
+
|
119
|
+
To run the tests you would need to set the following environment variables with your real Azure data:
|
120
|
+
|
121
|
+
* azure_tenant_id
|
122
|
+
* azure_client_id
|
123
|
+
* azure_client_secret
|
124
|
+
* subscription_id
|
125
|
+
|
126
|
+
* run_long_tasks - set this to '1' only if you would like to run time consuming tests like VM creation.
|
127
|
+
|
128
|
+
## Starting tests
|
129
|
+
|
130
|
+
Just run 'rspec' command from the current gem folder.
|
131
|
+
|
132
|
+
# Contribution
|
133
|
+
|
134
|
+
All the SDK code was generated by tool 'AutoRest' - https://github.com/Azure/autorest
|
135
|
+
So if you have found a bug or have an idea for a new feature - suggest, discuss and contribute it into the AutoRest repository. After that SDK maintainers will update the sources and the gem.
|
136
|
+
|
137
|
+
# Provide feedback
|
138
|
+
|
139
|
+
Send email to the azsdkteam@microsoft.com or file new issue in this repository.
|
data/Rakefile
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
4
|
+
|
5
|
+
lib = File.expand_path('../lib', __FILE__)
|
6
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
7
|
+
|
8
|
+
require 'azure_mgmt_compute/module_definition'
|
9
|
+
require 'azure_mgmt_compute/version'
|
10
|
+
|
11
|
+
Gem::Specification.new do |spec|
|
12
|
+
spec.name = 'azure_mgmt_compute'
|
13
|
+
spec.version = Azure::ARM::Compute::VERSION
|
14
|
+
spec.authors = 'Microsoft Corporation'
|
15
|
+
spec.email = 'azsdkteam@microsoft.com'
|
16
|
+
spec.description = 'Microsoft Azure Compute Management Client Library for Ruby'
|
17
|
+
spec.summary = 'Official ruby client library to consume Microsoft Azure Compute Management services.'
|
18
|
+
spec.homepage = 'http://github.com/azure/azure-sdk-for-ruby'
|
19
|
+
spec.license = 'MIT'
|
20
|
+
|
21
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
+
spec.bindir = 'bin'
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ['lib']
|
25
|
+
|
26
|
+
spec.add_development_dependency 'bundler', '~> 1.9'
|
27
|
+
spec.add_development_dependency 'rake', '~> 10'
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3'
|
29
|
+
spec.add_development_dependency 'dotenv', '~> 2'
|
30
|
+
spec.add_development_dependency 'azure_mgmt_resources', '~> 0.1'
|
31
|
+
spec.add_development_dependency 'azure_mgmt_storage', '~> 0.1'
|
32
|
+
spec.add_development_dependency 'azure_mgmt_network', '~> 0.1'
|
33
|
+
|
34
|
+
spec.add_runtime_dependency 'json', '~> 1.8'
|
35
|
+
spec.add_runtime_dependency 'concurrent-ruby', ['>= 1.0.0.pre1', '<2']
|
36
|
+
spec.add_runtime_dependency 'faraday', '~> 0.9'
|
37
|
+
spec.add_runtime_dependency 'faraday-cookie_jar', '~> 0.0.6'
|
38
|
+
spec.add_runtime_dependency 'ms_rest_azure', '~> 0.1'
|
39
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.11.0.0
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
|
7
|
+
require 'uri'
|
8
|
+
require 'cgi'
|
9
|
+
require 'date'
|
10
|
+
require 'json'
|
11
|
+
require 'base64'
|
12
|
+
require 'erb'
|
13
|
+
require 'securerandom'
|
14
|
+
require 'time'
|
15
|
+
require 'timeliness'
|
16
|
+
require 'faraday'
|
17
|
+
require 'faraday-cookie_jar'
|
18
|
+
require 'concurrent'
|
19
|
+
require 'ms_rest'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
require 'azure_mgmt_compute/module_definition'
|
23
|
+
require 'azure_mgmt_compute/version'
|
24
|
+
|
25
|
+
module Azure::ARM::Compute
|
26
|
+
autoload :AvailabilitySets, 'azure_mgmt_compute/availability_sets.rb'
|
27
|
+
autoload :VirtualMachineImages, 'azure_mgmt_compute/virtual_machine_images.rb'
|
28
|
+
autoload :VirtualMachineExtensionImages, 'azure_mgmt_compute/virtual_machine_extension_images.rb'
|
29
|
+
autoload :VirtualMachineExtensions, 'azure_mgmt_compute/virtual_machine_extensions.rb'
|
30
|
+
autoload :UsageOperations, 'azure_mgmt_compute/usage_operations.rb'
|
31
|
+
autoload :VirtualMachineSizes, 'azure_mgmt_compute/virtual_machine_sizes.rb'
|
32
|
+
autoload :VirtualMachines, 'azure_mgmt_compute/virtual_machines.rb'
|
33
|
+
autoload :ComputeManagementClient, 'azure_mgmt_compute/compute_management_client.rb'
|
34
|
+
|
35
|
+
module Models
|
36
|
+
autoload :InstanceViewStatus, 'azure_mgmt_compute/models/instance_view_status.rb'
|
37
|
+
autoload :AvailabilitySetProperties, 'azure_mgmt_compute/models/availability_set_properties.rb'
|
38
|
+
autoload :AvailabilitySetListResult, 'azure_mgmt_compute/models/availability_set_list_result.rb'
|
39
|
+
autoload :VirtualMachineSize, 'azure_mgmt_compute/models/virtual_machine_size.rb'
|
40
|
+
autoload :VirtualMachineSizeListResult, 'azure_mgmt_compute/models/virtual_machine_size_list_result.rb'
|
41
|
+
autoload :PurchasePlan, 'azure_mgmt_compute/models/purchase_plan.rb'
|
42
|
+
autoload :OSDiskImage, 'azure_mgmt_compute/models/osdisk_image.rb'
|
43
|
+
autoload :DataDiskImage, 'azure_mgmt_compute/models/data_disk_image.rb'
|
44
|
+
autoload :VirtualMachineImageProperties, 'azure_mgmt_compute/models/virtual_machine_image_properties.rb'
|
45
|
+
autoload :VirtualMachineExtensionImageProperties, 'azure_mgmt_compute/models/virtual_machine_extension_image_properties.rb'
|
46
|
+
autoload :VirtualMachineExtensionInstanceView, 'azure_mgmt_compute/models/virtual_machine_extension_instance_view.rb'
|
47
|
+
autoload :VirtualMachineExtensionProperties, 'azure_mgmt_compute/models/virtual_machine_extension_properties.rb'
|
48
|
+
autoload :UsageName, 'azure_mgmt_compute/models/usage_name.rb'
|
49
|
+
autoload :Usage, 'azure_mgmt_compute/models/usage.rb'
|
50
|
+
autoload :ListUsagesResult, 'azure_mgmt_compute/models/list_usages_result.rb'
|
51
|
+
autoload :VirtualMachineCaptureParameters, 'azure_mgmt_compute/models/virtual_machine_capture_parameters.rb'
|
52
|
+
autoload :ComputeLongRunningOperationProperties, 'azure_mgmt_compute/models/compute_long_running_operation_properties.rb'
|
53
|
+
autoload :ApiErrorBase, 'azure_mgmt_compute/models/api_error_base.rb'
|
54
|
+
autoload :InnerError, 'azure_mgmt_compute/models/inner_error.rb'
|
55
|
+
autoload :ApiError, 'azure_mgmt_compute/models/api_error.rb'
|
56
|
+
autoload :ComputeLongRunningOperationResult, 'azure_mgmt_compute/models/compute_long_running_operation_result.rb'
|
57
|
+
autoload :Plan, 'azure_mgmt_compute/models/plan.rb'
|
58
|
+
autoload :HardwareProfile, 'azure_mgmt_compute/models/hardware_profile.rb'
|
59
|
+
autoload :ImageReference, 'azure_mgmt_compute/models/image_reference.rb'
|
60
|
+
autoload :VirtualHardDisk, 'azure_mgmt_compute/models/virtual_hard_disk.rb'
|
61
|
+
autoload :OSDisk, 'azure_mgmt_compute/models/osdisk.rb'
|
62
|
+
autoload :DataDisk, 'azure_mgmt_compute/models/data_disk.rb'
|
63
|
+
autoload :StorageProfile, 'azure_mgmt_compute/models/storage_profile.rb'
|
64
|
+
autoload :AdditionalUnattendContent, 'azure_mgmt_compute/models/additional_unattend_content.rb'
|
65
|
+
autoload :WinRMListener, 'azure_mgmt_compute/models/win_rmlistener.rb'
|
66
|
+
autoload :WinRMConfiguration, 'azure_mgmt_compute/models/win_rmconfiguration.rb'
|
67
|
+
autoload :WindowsConfiguration, 'azure_mgmt_compute/models/windows_configuration.rb'
|
68
|
+
autoload :SshPublicKey, 'azure_mgmt_compute/models/ssh_public_key.rb'
|
69
|
+
autoload :SshConfiguration, 'azure_mgmt_compute/models/ssh_configuration.rb'
|
70
|
+
autoload :LinuxConfiguration, 'azure_mgmt_compute/models/linux_configuration.rb'
|
71
|
+
autoload :VaultCertificate, 'azure_mgmt_compute/models/vault_certificate.rb'
|
72
|
+
autoload :VaultSecretGroup, 'azure_mgmt_compute/models/vault_secret_group.rb'
|
73
|
+
autoload :OSProfile, 'azure_mgmt_compute/models/osprofile.rb'
|
74
|
+
autoload :NetworkInterfaceReferenceProperties, 'azure_mgmt_compute/models/network_interface_reference_properties.rb'
|
75
|
+
autoload :NetworkProfile, 'azure_mgmt_compute/models/network_profile.rb'
|
76
|
+
autoload :VirtualMachineExtensionHandlerInstanceView, 'azure_mgmt_compute/models/virtual_machine_extension_handler_instance_view.rb'
|
77
|
+
autoload :VirtualMachineAgentInstanceView, 'azure_mgmt_compute/models/virtual_machine_agent_instance_view.rb'
|
78
|
+
autoload :DiskInstanceView, 'azure_mgmt_compute/models/disk_instance_view.rb'
|
79
|
+
autoload :VirtualMachineInstanceView, 'azure_mgmt_compute/models/virtual_machine_instance_view.rb'
|
80
|
+
autoload :VirtualMachineProperties, 'azure_mgmt_compute/models/virtual_machine_properties.rb'
|
81
|
+
autoload :VirtualMachineListResult, 'azure_mgmt_compute/models/virtual_machine_list_result.rb'
|
82
|
+
autoload :DeleteOperationResult, 'azure_mgmt_compute/models/delete_operation_result.rb'
|
83
|
+
autoload :AvailabilitySet, 'azure_mgmt_compute/models/availability_set.rb'
|
84
|
+
autoload :VirtualMachineImage, 'azure_mgmt_compute/models/virtual_machine_image.rb'
|
85
|
+
autoload :VirtualMachineImageResource, 'azure_mgmt_compute/models/virtual_machine_image_resource.rb'
|
86
|
+
autoload :VirtualMachineExtensionImage, 'azure_mgmt_compute/models/virtual_machine_extension_image.rb'
|
87
|
+
autoload :VirtualMachineExtension, 'azure_mgmt_compute/models/virtual_machine_extension.rb'
|
88
|
+
autoload :NetworkInterfaceReference, 'azure_mgmt_compute/models/network_interface_reference.rb'
|
89
|
+
autoload :VirtualMachine, 'azure_mgmt_compute/models/virtual_machine.rb'
|
90
|
+
autoload :StatusLevelTypes, 'azure_mgmt_compute/models/status_level_types.rb'
|
91
|
+
autoload :OperatingSystemTypes, 'azure_mgmt_compute/models/operating_system_types.rb'
|
92
|
+
autoload :UsageUnit, 'azure_mgmt_compute/models/usage_unit.rb'
|
93
|
+
autoload :ComputeOperationStatus, 'azure_mgmt_compute/models/compute_operation_status.rb'
|
94
|
+
autoload :VirtualMachineSizeTypes, 'azure_mgmt_compute/models/virtual_machine_size_types.rb'
|
95
|
+
autoload :CachingTypes, 'azure_mgmt_compute/models/caching_types.rb'
|
96
|
+
autoload :DiskCreateOptionTypes, 'azure_mgmt_compute/models/disk_create_option_types.rb'
|
97
|
+
autoload :PassNames, 'azure_mgmt_compute/models/pass_names.rb'
|
98
|
+
autoload :ComponentNames, 'azure_mgmt_compute/models/component_names.rb'
|
99
|
+
autoload :SettingNames, 'azure_mgmt_compute/models/setting_names.rb'
|
100
|
+
autoload :ProtocolTypes, 'azure_mgmt_compute/models/protocol_types.rb'
|
101
|
+
autoload :OperationStatus, 'azure_mgmt_compute/models/operation_status.rb'
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.11.0.0
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::ARM::Compute
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Gets or sets additional XML formatted information that can be included
|
10
|
+
# in the Unattend.xml file, which is used by Windows Setup. Contents are
|
11
|
+
# defined by setting name, component name, and the pass in which the
|
12
|
+
# content is a applied.
|
13
|
+
#
|
14
|
+
class AdditionalUnattendContent
|
15
|
+
|
16
|
+
include MsRestAzure
|
17
|
+
|
18
|
+
# @return [PassNames] Gets or sets the pass name. Currently, the only
|
19
|
+
# allowable value is oobeSystem. Possible values for this property
|
20
|
+
# include: 'oobeSystem'.
|
21
|
+
attr_accessor :pass_name
|
22
|
+
|
23
|
+
# @return [ComponentNames] Gets or sets the component name. Currently,
|
24
|
+
# the only allowable value is Microsoft-Windows-Shell-Setup. Possible
|
25
|
+
# values for this property include: 'Microsoft-Windows-Shell-Setup'.
|
26
|
+
attr_accessor :component_name
|
27
|
+
|
28
|
+
# @return [SettingNames] Gets or sets setting name (e.g.
|
29
|
+
# FirstLogonCommands, AutoLogon ). Possible values for this property
|
30
|
+
# include: 'AutoLogon', 'FirstLogonCommands'.
|
31
|
+
attr_accessor :setting_name
|
32
|
+
|
33
|
+
# @return [String] Gets or sets XML formatted content that is added to
|
34
|
+
# the unattend.xml file in the specified pass and component.The XML
|
35
|
+
# must be less than 4 KB and must include the root element for the
|
36
|
+
# setting or feature that is being inserted.
|
37
|
+
attr_accessor :content
|
38
|
+
|
39
|
+
#
|
40
|
+
# Validate the object. Throws ValidationError if validation fails.
|
41
|
+
#
|
42
|
+
def validate
|
43
|
+
end
|
44
|
+
|
45
|
+
#
|
46
|
+
# Serializes given Model object into Ruby Hash.
|
47
|
+
# @param object Model object to serialize.
|
48
|
+
# @return [Hash] Serialized object in form of Ruby Hash.
|
49
|
+
#
|
50
|
+
def self.serialize_object(object)
|
51
|
+
object.validate
|
52
|
+
output_object = {}
|
53
|
+
|
54
|
+
serialized_property = object.pass_name
|
55
|
+
output_object['passName'] = serialized_property unless serialized_property.nil?
|
56
|
+
|
57
|
+
serialized_property = object.component_name
|
58
|
+
output_object['componentName'] = serialized_property unless serialized_property.nil?
|
59
|
+
|
60
|
+
serialized_property = object.setting_name
|
61
|
+
output_object['settingName'] = serialized_property unless serialized_property.nil?
|
62
|
+
|
63
|
+
serialized_property = object.content
|
64
|
+
output_object['content'] = serialized_property unless serialized_property.nil?
|
65
|
+
|
66
|
+
output_object
|
67
|
+
end
|
68
|
+
|
69
|
+
#
|
70
|
+
# Deserializes given Ruby Hash into Model object.
|
71
|
+
# @param object [Hash] Ruby Hash object to deserialize.
|
72
|
+
# @return [AdditionalUnattendContent] Deserialized object.
|
73
|
+
#
|
74
|
+
def self.deserialize_object(object)
|
75
|
+
return if object.nil?
|
76
|
+
output_object = AdditionalUnattendContent.new
|
77
|
+
|
78
|
+
deserialized_property = object['passName']
|
79
|
+
if (!deserialized_property.nil? && !deserialized_property.empty?)
|
80
|
+
enum_is_valid = PassNames.constants.any? { |e| PassNames.const_get(e).to_s.downcase == deserialized_property.downcase }
|
81
|
+
fail MsRest::DeserializationError.new('Error occured while deserializing the enum', nil, nil, nil) unless enum_is_valid
|
82
|
+
end
|
83
|
+
output_object.pass_name = deserialized_property
|
84
|
+
|
85
|
+
deserialized_property = object['componentName']
|
86
|
+
if (!deserialized_property.nil? && !deserialized_property.empty?)
|
87
|
+
enum_is_valid = ComponentNames.constants.any? { |e| ComponentNames.const_get(e).to_s.downcase == deserialized_property.downcase }
|
88
|
+
fail MsRest::DeserializationError.new('Error occured while deserializing the enum', nil, nil, nil) unless enum_is_valid
|
89
|
+
end
|
90
|
+
output_object.component_name = deserialized_property
|
91
|
+
|
92
|
+
deserialized_property = object['settingName']
|
93
|
+
if (!deserialized_property.nil? && !deserialized_property.empty?)
|
94
|
+
enum_is_valid = SettingNames.constants.any? { |e| SettingNames.const_get(e).to_s.downcase == deserialized_property.downcase }
|
95
|
+
fail MsRest::DeserializationError.new('Error occured while deserializing the enum', nil, nil, nil) unless enum_is_valid
|
96
|
+
end
|
97
|
+
output_object.setting_name = deserialized_property
|
98
|
+
|
99
|
+
deserialized_property = object['content']
|
100
|
+
output_object.content = deserialized_property
|
101
|
+
|
102
|
+
output_object.validate
|
103
|
+
|
104
|
+
output_object
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|