fog-azure-rm 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +17 -0
- data/.gitignore +6 -0
- data/.hound.yml +2 -0
- data/.rubocop.yml +36 -0
- data/.travis.yml +14 -0
- data/CHANGELOG.md +28 -0
- data/CONTRIBUTING.md +2 -0
- data/CONTRIBUTORS.md +2 -0
- data/Gemfile +3 -0
- data/fog-azure-rm.gemspec +34 -0
- data/lib/fog/azurerm.rb +1 -0
- data/lib/fog/azurerm/compute.rb +0 -1
- data/lib/fog/azurerm/config.rb +4 -0
- data/lib/fog/azurerm/credentials.rb +10 -3
- data/lib/fog/azurerm/docs/compute.md +172 -0
- data/lib/fog/azurerm/docs/dns.md +112 -0
- data/lib/fog/azurerm/docs/network.md +794 -0
- data/lib/fog/azurerm/docs/resources.md +155 -0
- data/lib/fog/azurerm/docs/storage.md +222 -0
- data/lib/fog/azurerm/docs/structure.md +53 -0
- data/lib/fog/azurerm/models/compute/server.rb +3 -2
- data/lib/fog/azurerm/models/network/frontend_ip_configuration.rb +5 -1
- data/lib/fog/azurerm/models/network/network_interface.rb +49 -4
- data/lib/fog/azurerm/models/network/network_interfaces.rb +4 -2
- data/lib/fog/azurerm/models/network/network_security_group.rb +27 -4
- data/lib/fog/azurerm/models/network/network_security_groups.rb +4 -2
- data/lib/fog/azurerm/models/network/network_security_rule.rb +1 -1
- data/lib/fog/azurerm/models/network/subnet.rb +26 -6
- data/lib/fog/azurerm/models/network/subnets.rb +4 -2
- data/lib/fog/azurerm/models/network/virtual_network.rb +72 -10
- data/lib/fog/azurerm/models/network/virtual_networks.rb +4 -2
- data/lib/fog/azurerm/models/resources/azure_resource.rb +25 -0
- data/lib/fog/azurerm/models/resources/azure_resources.rb +31 -0
- data/lib/fog/azurerm/models/resources/dependency.rb +27 -0
- data/lib/fog/azurerm/models/resources/deployment.rb +65 -0
- data/lib/fog/azurerm/models/resources/deployments.rb +27 -0
- data/lib/fog/azurerm/models/resources/provider.rb +27 -0
- data/lib/fog/azurerm/models/resources/provider_resource_type.rb +22 -0
- data/lib/fog/azurerm/models/storage/blob.rb +13 -0
- data/lib/fog/azurerm/models/storage/blobs.rb +22 -0
- data/lib/fog/azurerm/models/storage/container.rb +65 -0
- data/lib/fog/azurerm/models/storage/containers.rb +44 -0
- data/lib/fog/azurerm/models/storage/data_disk.rb +26 -0
- data/lib/fog/azurerm/models/storage/storage_account.rb +4 -0
- data/lib/fog/azurerm/network.rb +21 -3
- data/lib/fog/azurerm/requests/network/add_address_prefixes_in_virtual_network.rb +68 -0
- data/lib/fog/azurerm/requests/network/add_dns_servers_in_virtual_network.rb +74 -0
- data/lib/fog/azurerm/requests/network/add_security_rules.rb +152 -0
- data/lib/fog/azurerm/requests/network/add_subnets_in_virtual_network.rb +69 -0
- data/lib/fog/azurerm/requests/network/attach_network_security_group_to_subnet.rb +59 -0
- data/lib/fog/azurerm/requests/network/attach_resource_to_nic.rb +88 -0
- data/lib/fog/azurerm/requests/network/attach_route_table_to_subnet.rb +59 -0
- data/lib/fog/azurerm/requests/network/create_load_balancer.rb +4 -4
- data/lib/fog/azurerm/requests/network/{create_network_interface.rb → create_or_update_network_interface.rb} +14 -13
- data/lib/fog/azurerm/requests/network/{create_network_security_group.rb → create_or_update_network_security_group.rb} +17 -35
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network.rb +116 -0
- data/lib/fog/azurerm/requests/network/create_subnet.rb +28 -14
- data/lib/fog/azurerm/requests/network/detach_network_security_group_from_subnet.rb +53 -0
- data/lib/fog/azurerm/requests/network/detach_resource_from_nic.rb +80 -0
- data/lib/fog/azurerm/requests/network/detach_route_table_from_subnet.rb +53 -0
- data/lib/fog/azurerm/requests/network/get_network_interface.rb +60 -0
- data/lib/fog/azurerm/requests/network/get_network_security_group.rb +161 -0
- data/lib/fog/azurerm/requests/network/get_subnet.rb +36 -0
- data/lib/fog/azurerm/requests/network/get_virtual_network.rb +64 -0
- data/lib/fog/azurerm/requests/network/remove_address_prefixes_from_virtual_network.rb +67 -0
- data/lib/fog/azurerm/requests/network/remove_dns_servers_from_virtual_network.rb +67 -0
- data/lib/fog/azurerm/requests/network/remove_security_rule.rb +155 -0
- data/lib/fog/azurerm/requests/network/remove_subnets_from_virtual_network.rb +57 -0
- data/lib/fog/azurerm/requests/resources/create_deployment.rb +90 -0
- data/lib/fog/azurerm/requests/resources/delete_deployment.rb +28 -0
- data/lib/fog/azurerm/requests/resources/delete_resource_tag.rb +48 -0
- data/lib/fog/azurerm/requests/resources/list_deployments.rb +75 -0
- data/lib/fog/azurerm/requests/resources/list_tagged_resources.rb +46 -0
- data/lib/fog/azurerm/requests/resources/tag_resource.rb +46 -0
- data/lib/fog/azurerm/requests/storage/create_container.rb +37 -0
- data/lib/fog/azurerm/requests/storage/delete_container.rb +26 -0
- data/lib/fog/azurerm/requests/storage/delete_disk.rb +36 -0
- data/lib/fog/azurerm/requests/storage/get_blob_metadata.rb +30 -0
- data/lib/fog/azurerm/requests/storage/get_container_access_control_list.rb +29 -0
- data/lib/fog/azurerm/requests/storage/get_container_metadata.rb +31 -0
- data/lib/fog/azurerm/requests/storage/get_container_properties.rb +36 -0
- data/lib/fog/azurerm/requests/storage/get_storage_access_keys.rb +31 -0
- data/lib/fog/azurerm/requests/storage/list_containers.rb +49 -0
- data/lib/fog/azurerm/requests/storage/list_storage_account_for_rg.rb +0 -1
- data/lib/fog/azurerm/requests/storage/set_blob_metadata.rb +26 -0
- data/lib/fog/azurerm/requests/storage/set_container_metadata.rb +26 -0
- data/lib/fog/azurerm/resources.rb +13 -0
- data/lib/fog/azurerm/storage.rb +46 -6
- data/lib/fog/azurerm/utilities/general.rb +18 -0
- data/lib/fog/azurerm/version.rb +1 -1
- data/rakefile +21 -0
- data/test/api_stub.rb +44 -0
- data/test/api_stub/models/compute/availability_set.rb +21 -0
- data/test/api_stub/models/compute/server.rb +191 -0
- data/test/api_stub/models/dns/record_set.rb +59 -0
- data/test/api_stub/models/dns/zone.rb +47 -0
- data/test/api_stub/models/network/application_gateway.rb +135 -0
- data/test/api_stub/models/network/load_balancer.rb +132 -0
- data/test/api_stub/models/network/network_interface.rb +71 -0
- data/test/api_stub/models/network/network_security_group.rb +94 -0
- data/test/api_stub/models/network/public_ip.rb +35 -0
- data/test/api_stub/models/network/subnet.rb +35 -0
- data/test/api_stub/models/network/traffic_manager_end_point.rb +26 -0
- data/test/api_stub/models/network/traffic_manager_profile.rb +74 -0
- data/test/api_stub/models/network/virtual_network.rb +61 -0
- data/test/api_stub/models/resources/deployment.rb +110 -0
- data/test/api_stub/models/resources/resource.rb +40 -0
- data/test/api_stub/models/resources/resource_group.rb +38 -0
- data/test/api_stub/models/storage/blob.rb +17 -0
- data/test/api_stub/models/storage/container.rb +92 -0
- data/test/api_stub/models/storage/data_disk.rb +30 -0
- data/test/api_stub/models/storage/storageaccount.rb +29 -0
- data/test/api_stub/requests/compute/availability_set.rb +46 -0
- data/test/api_stub/requests/compute/virtual_machine.rb +654 -0
- data/test/api_stub/requests/dns/record_set.rb +105 -0
- data/test/api_stub/requests/dns/zone.rb +67 -0
- data/test/api_stub/requests/network/application_gateway.rb +433 -0
- data/test/api_stub/requests/network/load_balancer.rb +366 -0
- data/test/api_stub/requests/network/network_interface.rb +268 -0
- data/test/api_stub/requests/network/network_security_group.rb +240 -0
- data/test/api_stub/requests/network/public_ip.rb +73 -0
- data/test/api_stub/requests/network/subnet.rb +73 -0
- data/test/api_stub/requests/network/traffic_manager_endpoint.rb +25 -0
- data/test/api_stub/requests/network/traffic_manager_profile.rb +140 -0
- data/test/api_stub/requests/network/virtual_network.rb +127 -0
- data/test/api_stub/requests/resources/deployment.rb +23 -0
- data/test/api_stub/requests/resources/resource.rb +47 -0
- data/test/api_stub/requests/resources/resource_group.rb +53 -0
- data/test/api_stub/requests/storage/blob.rb +24 -0
- data/test/api_stub/requests/storage/container.rb +95 -0
- data/test/api_stub/requests/storage/storageaccount.rb +112 -0
- data/test/integration/README.md +14 -0
- data/test/integration/application_gateway.rb +129 -0
- data/test/integration/availability_set.rb +56 -0
- data/test/integration/container.rb +81 -0
- data/test/integration/credentials/azure.yml +4 -0
- data/test/integration/external_load_balancer.rb +119 -0
- data/test/integration/internal_load_balancer.rb +126 -0
- data/test/integration/network_interface.rb +135 -0
- data/test/integration/network_security_group.rb +104 -0
- data/test/integration/public_ip.rb +63 -0
- data/test/integration/record_set.rb +88 -0
- data/test/integration/server.rb +139 -0
- data/test/integration/storage_account.rb +62 -0
- data/test/integration/subnet.rb +91 -0
- data/test/integration/traffic_manager.rb +81 -0
- data/test/integration/virtual_network.rb +124 -0
- data/test/integration/zone.rb +64 -0
- data/test/models/compute/test_availability_set.rb +53 -0
- data/test/models/compute/test_availability_sets.rb +41 -0
- data/test/models/compute/test_server.rb +143 -0
- data/test/models/compute/test_servers.rb +49 -0
- data/test/models/dns/test_record_set.rb +59 -0
- data/test/models/dns/test_record_sets.rb +51 -0
- data/test/models/dns/test_zone.rb +49 -0
- data/test/models/dns/test_zones.rb +49 -0
- data/test/models/network/test_application_gateway.rb +62 -0
- data/test/models/network/test_application_gateways.rb +42 -0
- data/test/models/network/test_load_balancer.rb +56 -0
- data/test/models/network/test_load_balancers.rb +42 -0
- data/test/models/network/test_network_interface.rb +106 -0
- data/test/models/network/test_network_interfaces.rb +41 -0
- data/test/models/network/test_network_security_group.rb +88 -0
- data/test/models/network/test_network_security_groups.rb +40 -0
- data/test/models/network/test_network_security_rule.rb +30 -0
- data/test/models/network/test_public_ip.rb +58 -0
- data/test/models/network/test_public_ips.rb +55 -0
- data/test/models/network/test_subnet.rb +84 -0
- data/test/models/network/test_subnets.rb +42 -0
- data/test/models/network/test_traffic_manager_end_point.rb +53 -0
- data/test/models/network/test_traffic_manager_end_points.rb +42 -0
- data/test/models/network/test_traffic_manager_profile.rb +54 -0
- data/test/models/network/test_traffic_manager_profiles.rb +41 -0
- data/test/models/network/test_virtual_network.rb +112 -0
- data/test/models/network/test_virtual_networks.rb +54 -0
- data/test/models/resources/test_deployment.rb +54 -0
- data/test/models/resources/test_deployments.rb +37 -0
- data/test/models/resources/test_resource.rb +22 -0
- data/test/models/resources/test_resource_group.rb +43 -0
- data/test/models/resources/test_resource_groups.rb +37 -0
- data/test/models/resources/test_resources.rb +38 -0
- data/test/models/storage/test_blobs.rb +32 -0
- data/test/models/storage/test_container.rb +67 -0
- data/test/models/storage/test_containers.rb +56 -0
- data/test/models/storage/test_data_disk.rb +29 -0
- data/test/models/storage/test_storage_account.rb +62 -0
- data/test/models/storage/test_storage_accounts.rb +65 -0
- data/test/requests/compute/test_attach_data_disk_to_vm.rb +175 -0
- data/test/requests/compute/test_create_availability_set.rb +30 -0
- data/test/requests/compute/test_create_virtual_machine.rb +50 -0
- data/test/requests/compute/test_deallocate_virtual_machine.rb +29 -0
- data/test/requests/compute/test_delete_availability_set.rb +29 -0
- data/test/requests/compute/test_delete_virtual_machine.rb +29 -0
- data/test/requests/compute/test_detach_data_disk_from_vm.rb +53 -0
- data/test/requests/compute/test_generalize_virtual_machine.rb +29 -0
- data/test/requests/compute/test_get_virtual_machine.rb +31 -0
- data/test/requests/compute/test_get_vm_status.rb +31 -0
- data/test/requests/compute/test_list_availability_sets.rb +30 -0
- data/test/requests/compute/test_list_available_sizes_for_virtual_machine.rb +31 -0
- data/test/requests/compute/test_list_virtual_machines.rb +30 -0
- data/test/requests/compute/test_power_off_virtual_machine.rb +29 -0
- data/test/requests/compute/test_redeploy_virtual_machine.rb +29 -0
- data/test/requests/compute/test_restart_virtual_machine.rb +29 -0
- data/test/requests/compute/test_start_virtual_machine.rb +29 -0
- data/test/requests/dns/test_check_for_zone.rb +52 -0
- data/test/requests/dns/test_create_record_set.rb +45 -0
- data/test/requests/dns/test_create_zone.rb +36 -0
- data/test/requests/dns/test_delete_record_set.rb +35 -0
- data/test/requests/dns/test_delete_zone.rb +35 -0
- data/test/requests/dns/test_get_records_from_record_set.rb +55 -0
- data/test/requests/dns/test_list_record_sets.rb +36 -0
- data/test/requests/dns/test_list_zones.rb +40 -0
- data/test/requests/network/test_add_address_prefixes_in_virtual_network.rb +45 -0
- data/test/requests/network/test_add_dns_servers_in_virtual_network.rb +45 -0
- data/test/requests/network/test_add_security_rules.rb +63 -0
- data/test/requests/network/test_add_subnets_in_virtual_network.rb +45 -0
- data/test/requests/network/test_attach_network_security_group_to_subnet.rb +33 -0
- data/test/requests/network/test_attach_resource_to_nic.rb +65 -0
- data/test/requests/network/test_attach_route_table_to_subnet.rb +33 -0
- data/test/requests/network/test_check_for_public_ip.rb +38 -0
- data/test/requests/network/test_check_for_virtual_network.rb +38 -0
- data/test/requests/network/test_create_application_gateway.rb +61 -0
- data/test/requests/network/test_create_load_balancer.rb +56 -0
- data/test/requests/network/test_create_network_interface.rb +54 -0
- data/test/requests/network/test_create_network_security_group.rb +45 -0
- data/test/requests/network/test_create_or_update_virtual_network.rb +63 -0
- data/test/requests/network/test_create_public_ip.rb +44 -0
- data/test/requests/network/test_create_subnet.rb +44 -0
- data/test/requests/network/test_create_traffic_manager_endpoint.rb +32 -0
- data/test/requests/network/test_create_traffic_manager_profile.rb +32 -0
- data/test/requests/network/test_delete_application_gateway.rb +30 -0
- data/test/requests/network/test_delete_load_balancer.rb +30 -0
- data/test/requests/network/test_delete_network_interface.rb +30 -0
- data/test/requests/network/test_delete_network_security_group.rb +32 -0
- data/test/requests/network/test_delete_public_ip.rb +30 -0
- data/test/requests/network/test_delete_subnet.rb +30 -0
- data/test/requests/network/test_delete_traffic_manager_endpoint.rb +28 -0
- data/test/requests/network/test_delete_traffic_manager_profile.rb +28 -0
- data/test/requests/network/test_delete_virtual_network.rb +30 -0
- data/test/requests/network/test_detach_network_security_group_from_subnet.rb +33 -0
- data/test/requests/network/test_detach_resource_from_nic.rb +60 -0
- data/test/requests/network/test_detach_route_table_from_subnet.rb +33 -0
- data/test/requests/network/test_get_network_interface.rb +31 -0
- data/test/requests/network/test_get_network_security_group.rb +33 -0
- data/test/requests/network/test_get_subnet.rb +33 -0
- data/test/requests/network/test_get_traffic_manager_profile.rb +29 -0
- data/test/requests/network/test_list_application_gateways.rb +31 -0
- data/test/requests/network/test_list_load_balancers.rb +31 -0
- data/test/requests/network/test_list_network_interfaces.rb +31 -0
- data/test/requests/network/test_list_network_security_groups.rb +33 -0
- data/test/requests/network/test_list_public_ips.rb +31 -0
- data/test/requests/network/test_list_subnets.rb +31 -0
- data/test/requests/network/test_list_traffic_manager_profiles.rb +29 -0
- data/test/requests/network/test_list_virtual_networks.rb +31 -0
- data/test/requests/network/test_remove_address_prefixes_from_virtual_network.rb +45 -0
- data/test/requests/network/test_remove_dns_servers_from_virtual_network.rb +45 -0
- data/test/requests/network/test_remove_security_rule.rb +49 -0
- data/test/requests/network/test_remove_subnets_from_virtual_network.rb +45 -0
- data/test/requests/resources/test_create_deployment.rb +49 -0
- data/test/requests/resources/test_create_resource_group.rb +31 -0
- data/test/requests/resources/test_delete_deployment.rb +31 -0
- data/test/requests/resources/test_delete_resource_group.rb +30 -0
- data/test/requests/resources/test_delete_resource_tag.rb +51 -0
- data/test/requests/resources/test_list_deployments.rb +32 -0
- data/test/requests/resources/test_list_resource_groups.rb +31 -0
- data/test/requests/resources/test_list_tagged_resources.rb +31 -0
- data/test/requests/resources/test_tag_resource.rb +51 -0
- data/test/requests/storage/test_check_storage_account_name_availability.rb +59 -0
- data/test/requests/storage/test_create_container.rb +31 -0
- data/test/requests/storage/test_create_storage_account.rb +56 -0
- data/test/requests/storage/test_delete_container.rb +30 -0
- data/test/requests/storage/test_delete_storage_account.rb +34 -0
- data/test/requests/storage/test_get_blob_metadata.rb +18 -0
- data/test/requests/storage/test_get_container_access_control_list.rb +31 -0
- data/test/requests/storage/test_get_container_metadata.rb +18 -0
- data/test/requests/storage/test_get_container_properties.rb +31 -0
- data/test/requests/storage/test_get_storage_access_keys.rb +31 -0
- data/test/requests/storage/test_list_containers.rb +23 -0
- data/test/requests/storage/test_list_storage_accounts.rb +47 -0
- data/test/requests/storage/test_list_storage_accounts_for_rg.rb +51 -0
- data/test/requests/storage/test_set_blob_metadata.rb +17 -0
- data/test/requests/storage/test_set_container_metadata.rb +17 -0
- data/test/test_credentials.rb +39 -0
- data/test/test_helper.rb +428 -0
- metadata +273 -14
- data/lib/fog/azurerm/models/compute/data_disk.rb +0 -26
- data/lib/fog/azurerm/requests/network/create_virtual_network.rb +0 -115
@@ -0,0 +1,38 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Models
|
3
|
+
module Resources
|
4
|
+
# Mock class for Resource Group Model
|
5
|
+
class ResourceGroup
|
6
|
+
def self.create_resource_group_response
|
7
|
+
body = '{
|
8
|
+
"id": "/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg",
|
9
|
+
"name": "fog-test-rg",
|
10
|
+
"location": "westus",
|
11
|
+
"tags": {
|
12
|
+
"tagname1": "tagvalue1"
|
13
|
+
},
|
14
|
+
"properties": {
|
15
|
+
"provisioning_state": "Succeeded"
|
16
|
+
}
|
17
|
+
}'
|
18
|
+
JSON.load(body)
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.list_resource_groups_response
|
22
|
+
body = '{
|
23
|
+
"id": "/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg",
|
24
|
+
"name": "fog-test-rg",
|
25
|
+
"location": "westus",
|
26
|
+
"tags": {
|
27
|
+
"tagname1": "tagvalue1"
|
28
|
+
},
|
29
|
+
"properties": {
|
30
|
+
"provisioning_state": "Succeeded"
|
31
|
+
}
|
32
|
+
}'
|
33
|
+
JSON.load(body)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Models
|
3
|
+
module Storage
|
4
|
+
# Mock class for Data Disk Model
|
5
|
+
class Blob
|
6
|
+
def self.test_get_blob_metadata
|
7
|
+
{
|
8
|
+
'container-name' => 'Test-container',
|
9
|
+
'blob-name' => 'Test_Blob',
|
10
|
+
'category' => 'Images',
|
11
|
+
'resolution' => 'High'
|
12
|
+
}
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Models
|
3
|
+
module Storage
|
4
|
+
# Mock class for Data Disk Model
|
5
|
+
class Container
|
6
|
+
def self.test_get_container_metadata
|
7
|
+
{
|
8
|
+
'container-name' => 'Test-container',
|
9
|
+
'created-by' => 'User',
|
10
|
+
'source-machine' => 'Test-machine',
|
11
|
+
'category' => 'guidance',
|
12
|
+
'doctype' => 'textDocuments'
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.create_container
|
17
|
+
{
|
18
|
+
'name' => 'testcontainer1',
|
19
|
+
'properties' =>
|
20
|
+
{
|
21
|
+
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
22
|
+
'etag' => '0x8D3A3B5F017F52D',
|
23
|
+
'lease_status' => 'unlocked',
|
24
|
+
'lease_state' => 'available'
|
25
|
+
},
|
26
|
+
'public_access_level' => nil,
|
27
|
+
'metadata' => {}
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.list_containers
|
32
|
+
[
|
33
|
+
{
|
34
|
+
'name' => 'testcontainer1',
|
35
|
+
'properties' =>
|
36
|
+
{
|
37
|
+
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
38
|
+
'etag' => '0x8D3A3B5F017F52D',
|
39
|
+
'lease_status' => 'unlocked',
|
40
|
+
'lease_state' => 'available'
|
41
|
+
},
|
42
|
+
'metadata' => {}
|
43
|
+
},
|
44
|
+
{
|
45
|
+
'name' => 'testcontainer2',
|
46
|
+
'properties' =>
|
47
|
+
{
|
48
|
+
'last_modified' => 'Tue, 04 Aug 2015 06:01:08 GMT',
|
49
|
+
'etag' => '0x8D29C92176C8352',
|
50
|
+
'lease_status' => 'unlocked',
|
51
|
+
'lease_state' => 'available'
|
52
|
+
},
|
53
|
+
'metadata' => {}
|
54
|
+
},
|
55
|
+
{
|
56
|
+
'name' => 'testcontainer3',
|
57
|
+
'properties' =>
|
58
|
+
{
|
59
|
+
'last_modified' => 'Tue, 01 Sep 2015 05:15:36 GMT',
|
60
|
+
'etag' => '0x8D2B28C5EB36458',
|
61
|
+
'lease_status' => 'unlocked',
|
62
|
+
'lease_state' => 'available'
|
63
|
+
},
|
64
|
+
'metadata' => {}
|
65
|
+
}
|
66
|
+
]
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.get_container_properties
|
70
|
+
{
|
71
|
+
'name' => 'testcontainer1',
|
72
|
+
'properties' =>
|
73
|
+
{
|
74
|
+
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
75
|
+
'etag' => '0x8D3A3B5F017F52D',
|
76
|
+
'lease_status' => 'unlocked',
|
77
|
+
'lease_state' => 'available'
|
78
|
+
},
|
79
|
+
'metadata' => {}
|
80
|
+
}
|
81
|
+
end
|
82
|
+
|
83
|
+
def self.get_container_access_control_list
|
84
|
+
[{
|
85
|
+
'name' => 'testcontainer1',
|
86
|
+
'public_access_level' => 'blob'
|
87
|
+
}, {}]
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Models
|
3
|
+
module Storage
|
4
|
+
# Mock class for Data Disk Model
|
5
|
+
class DataDisk
|
6
|
+
def self.create_data_disk_response
|
7
|
+
{
|
8
|
+
'lun' => 0,
|
9
|
+
'name' => 'disk1',
|
10
|
+
'vhd' => {
|
11
|
+
'uri' => 'https://confizrg7443.blob.core.windows.net/vhds/disk1.vhd'
|
12
|
+
},
|
13
|
+
'createOption' => 'empty',
|
14
|
+
'diskSizeGB' => '10'
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.expected_create_data_disk_response
|
19
|
+
{
|
20
|
+
'lun' => 0,
|
21
|
+
'name' => 'disk1',
|
22
|
+
'vhd_uri' => 'https://confizrg7443.blob.core.windows.net/vhds/disk1.vhd',
|
23
|
+
'create_option' => 'empty',
|
24
|
+
'disk_size_gb' => '10'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Models
|
3
|
+
module Storage
|
4
|
+
class StorageAccount
|
5
|
+
def self.create_storage_account
|
6
|
+
{
|
7
|
+
'location' => 'west us',
|
8
|
+
'properties' =>
|
9
|
+
{
|
10
|
+
'accountType' => 'Standard_LRS'
|
11
|
+
}
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.list_storage_account
|
16
|
+
{
|
17
|
+
'id' => '/subscriptions/67f2116d-4ea2-4c6c-b20a-f92183dbe3cb/resourceGroups/fog_test_rg/providers/Microsoft.Storage/storageAccounts/fogtestsasecond',
|
18
|
+
'name' => 'fog-test-storage-account',
|
19
|
+
'location' => 'westus',
|
20
|
+
'properties' =>
|
21
|
+
{
|
22
|
+
'accountType' => 'Standard_LRS'
|
23
|
+
}
|
24
|
+
}
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Requests
|
3
|
+
module Compute
|
4
|
+
# Mock class for Availability Set Requests
|
5
|
+
class AvailabilitySet
|
6
|
+
def self.create_availability_set_response
|
7
|
+
body = '{
|
8
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/myrg1/providers/Microsoft.Compute/availabilitySets/avset1",
|
9
|
+
"name":"myavset1",
|
10
|
+
"type":"Microsoft.Compute/availabilitySets",
|
11
|
+
"location":"westus",
|
12
|
+
"tags": {},
|
13
|
+
"properties": {
|
14
|
+
"platformUpdateDomainCount":5,
|
15
|
+
"platformFaultDomainCount":3,
|
16
|
+
"virtualMachines":[]
|
17
|
+
}
|
18
|
+
}'
|
19
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
20
|
+
result.body = Azure::ARM::Compute::Models::AvailabilitySet.deserialize_object(JSON.load(body))
|
21
|
+
result
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.list_availability_set_response
|
25
|
+
body = '{
|
26
|
+
"value": [ {
|
27
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/myrg1/providers/Microsoft.Compute/availabilitySets/avset1",
|
28
|
+
"name":"myavset1",
|
29
|
+
"type":"Microsoft.Compute/availabilitySets",
|
30
|
+
"location":"westus",
|
31
|
+
"tags": {},
|
32
|
+
"properties": {
|
33
|
+
"platformUpdateDomainCount":5,
|
34
|
+
"platformFaultDomainCount":3,
|
35
|
+
"virtualMachines":[]
|
36
|
+
}
|
37
|
+
} ]
|
38
|
+
}'
|
39
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
40
|
+
result.body = Azure::ARM::Compute::Models::AvailabilitySetListResult.deserialize_object(JSON.load(body))
|
41
|
+
result
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,654 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Requests
|
3
|
+
module Compute
|
4
|
+
# Mock class for Virtual Machine Requests
|
5
|
+
class VirtualMachine
|
6
|
+
def self.create_virtual_machine_response
|
7
|
+
body = '{
|
8
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/fog-test-rg/providers/Microsoft.Compute/virtualMachines/fog-test-server",
|
9
|
+
"name":"fog-test-server",
|
10
|
+
"type":"Microsoft.Compute/virtualMachines",
|
11
|
+
"location":"westus",
|
12
|
+
"tags": {
|
13
|
+
"department":"finance"
|
14
|
+
},
|
15
|
+
"properties": {
|
16
|
+
"availabilitySet": {
|
17
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.Compute/availabilitySets/myav1"
|
18
|
+
},
|
19
|
+
"hardwareProfile": {
|
20
|
+
"vmSize":"Standard_A0"
|
21
|
+
},
|
22
|
+
"storageProfile": {
|
23
|
+
"imageReference": {
|
24
|
+
"publisher":"MicrosoftWindowsServerEssentials",
|
25
|
+
"offer":"WindowsServerEssentials",
|
26
|
+
"sku":"WindowsServerEssentials",
|
27
|
+
"version":"latest"
|
28
|
+
},
|
29
|
+
"osDisk": {
|
30
|
+
"name":"myosdisk1",
|
31
|
+
"vhd": {
|
32
|
+
"uri":"http://mystorage1.blob.core.windows.net/vhds/myosdisk1.vhd"
|
33
|
+
},
|
34
|
+
"caching":"ReadWrite",
|
35
|
+
"createOption":"FromImage"
|
36
|
+
},
|
37
|
+
"dataDisks": [ {
|
38
|
+
"name":"mydatadisk1",
|
39
|
+
"diskSizeGB":"1",
|
40
|
+
"lun": 0,
|
41
|
+
"vhd": {
|
42
|
+
"uri" : "http://mystorage1.blob.core.windows.net/vhds/mydatadisk1.vhd"
|
43
|
+
},
|
44
|
+
"createOption":"Empty"
|
45
|
+
} ]
|
46
|
+
},
|
47
|
+
"osProfile": {
|
48
|
+
"computerName":"fog-test-server",
|
49
|
+
"adminUsername":"fog",
|
50
|
+
"adminPassword":"fog",
|
51
|
+
"customData":"",
|
52
|
+
"windowsConfiguration": {
|
53
|
+
"provisionVMAgent":true,
|
54
|
+
"winRM": {
|
55
|
+
"listeners": [ {
|
56
|
+
"protocol": "https",
|
57
|
+
"certificateUrl": "url-to-certificate"
|
58
|
+
} ]
|
59
|
+
},
|
60
|
+
"enableAutomaticUpdates":true
|
61
|
+
},
|
62
|
+
"secrets":[ {
|
63
|
+
"sourceVault": {
|
64
|
+
"id": "/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.KeyVault/vaults/myvault1"
|
65
|
+
},
|
66
|
+
"vaultCertificates": [ {
|
67
|
+
"certificateUrl": "https://myvault1.vault.azure.net/secrets/{secretName}/{secretVersion}",
|
68
|
+
"certificateStore": "{certificateStoreName}"
|
69
|
+
} ]
|
70
|
+
} ]
|
71
|
+
},
|
72
|
+
"networkProfile": {
|
73
|
+
"networkInterfaces": [ {
|
74
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/myresourceGroup1/providers /Microsoft.Network/networkInterfaces/mynic1"
|
75
|
+
} ]
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}'
|
79
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
80
|
+
result.body = Azure::ARM::Compute::Models::VirtualMachine.deserialize_object(JSON.load(body))
|
81
|
+
result
|
82
|
+
end
|
83
|
+
|
84
|
+
def self.detach_data_disk_from_vm_response
|
85
|
+
body = '{
|
86
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/fog-test-rg/providers/Microsoft.Compute/virtualMachines/fog-test-server",
|
87
|
+
"name":"fog-test-server",
|
88
|
+
"type":"Microsoft.Compute/virtualMachines",
|
89
|
+
"location":"westus",
|
90
|
+
"tags": {
|
91
|
+
"department":"finance"
|
92
|
+
},
|
93
|
+
"properties": {
|
94
|
+
"availabilitySet": {
|
95
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.Compute/availabilitySets/myav1"
|
96
|
+
},
|
97
|
+
"hardwareProfile": {
|
98
|
+
"vmSize":"Standard_A0"
|
99
|
+
},
|
100
|
+
"storageProfile": {
|
101
|
+
"imageReference": {
|
102
|
+
"publisher":"MicrosoftWindowsServerEssentials",
|
103
|
+
"offer":"WindowsServerEssentials",
|
104
|
+
"sku":"WindowsServerEssentials",
|
105
|
+
"version":"latest"
|
106
|
+
},
|
107
|
+
"osDisk": {
|
108
|
+
"name":"myosdisk1",
|
109
|
+
"vhd": {
|
110
|
+
"uri":"http://mystorage1.blob.core.windows.net/vhds/myosdisk1.vhd"
|
111
|
+
},
|
112
|
+
"caching":"ReadWrite",
|
113
|
+
"createOption":"FromImage"
|
114
|
+
},
|
115
|
+
"dataDisks": []
|
116
|
+
},
|
117
|
+
"osProfile": {
|
118
|
+
"computerName":"fog-test-server",
|
119
|
+
"adminUsername":"fog",
|
120
|
+
"adminPassword":"fog",
|
121
|
+
"customData":"",
|
122
|
+
"windowsConfiguration": {
|
123
|
+
"provisionVMAgent":true,
|
124
|
+
"winRM": {
|
125
|
+
"listeners": [ {
|
126
|
+
"protocol": "https",
|
127
|
+
"certificateUrl": "url-to-certificate"
|
128
|
+
} ]
|
129
|
+
},
|
130
|
+
"enableAutomaticUpdates":true
|
131
|
+
},
|
132
|
+
"secrets":[ {
|
133
|
+
"sourceVault": {
|
134
|
+
"id": "/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.KeyVault/vaults/myvault1"
|
135
|
+
},
|
136
|
+
"vaultCertificates": [ {
|
137
|
+
"certificateUrl": "https://myvault1.vault.azure.net/secrets/{secretName}/{secretVersion}",
|
138
|
+
"certificateStore": "{certificateStoreName}"
|
139
|
+
} ]
|
140
|
+
} ]
|
141
|
+
},
|
142
|
+
"networkProfile": {
|
143
|
+
"networkInterfaces": [ {
|
144
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/myresourceGroup1/providers /Microsoft.Network/networkInterfaces/mynic1"
|
145
|
+
} ]
|
146
|
+
}
|
147
|
+
}
|
148
|
+
}'
|
149
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
150
|
+
result.body = Azure::ARM::Compute::Models::VirtualMachine.deserialize_object(JSON.load(body))
|
151
|
+
result
|
152
|
+
end
|
153
|
+
|
154
|
+
def self.virtual_machine_response
|
155
|
+
{
|
156
|
+
'location' => 'westus',
|
157
|
+
'id' => '/subscriptions/{subscription-id}/resourceGroups/fog-test-rg/providers/Microsoft.Compute/virtualMachines/fog-test-server',
|
158
|
+
'name' => 'fog-test-server',
|
159
|
+
'type' => 'Microsoft.Compute/virtualMachines',
|
160
|
+
'tags' =>
|
161
|
+
{
|
162
|
+
'department' => 'finance'
|
163
|
+
},
|
164
|
+
'properties' =>
|
165
|
+
{
|
166
|
+
'hardwareProfile' =>
|
167
|
+
{
|
168
|
+
'vmSize' => 'Standard_A0'
|
169
|
+
},
|
170
|
+
'storageProfile' =>
|
171
|
+
{
|
172
|
+
'imageReference' =>
|
173
|
+
{
|
174
|
+
'publisher' => 'MicrosoftWindowsServerEssentials',
|
175
|
+
'offer' => 'WindowsServerEssentials',
|
176
|
+
'sku' => 'WindowsServerEssentials',
|
177
|
+
'version' => 'latest'
|
178
|
+
},
|
179
|
+
'osDisk' =>
|
180
|
+
{
|
181
|
+
'name' => 'myosdisk1',
|
182
|
+
'vhd' =>
|
183
|
+
{
|
184
|
+
'uri' => 'http://mystorage1.blob.core.windows.net/vhds/myosdisk1.vhd'
|
185
|
+
},
|
186
|
+
'createOption' => 'FromImage',
|
187
|
+
'caching' => 'ReadWrite'
|
188
|
+
},
|
189
|
+
'dataDisks' =>
|
190
|
+
[
|
191
|
+
{
|
192
|
+
'lun' => 0,
|
193
|
+
'name' => 'mydatadisk1',
|
194
|
+
'vhd' =>
|
195
|
+
{
|
196
|
+
'uri' => 'http://mystorage1.blob.core.windows.net/vhds/mydatadisk1.vhd'
|
197
|
+
},
|
198
|
+
'createOption' => 'Empty',
|
199
|
+
'diskSizeGB' => 1
|
200
|
+
}
|
201
|
+
]
|
202
|
+
},
|
203
|
+
'osProfile' =>
|
204
|
+
{
|
205
|
+
'computerName' => 'fog-test-server',
|
206
|
+
'adminUsername' => 'fog',
|
207
|
+
'adminPassword' => 'fog',
|
208
|
+
'customData' => '',
|
209
|
+
'windowsConfiguration' =>
|
210
|
+
{
|
211
|
+
'provisionVMAgent' => true,
|
212
|
+
'enableAutomaticUpdates' => true,
|
213
|
+
'winRM' =>
|
214
|
+
{
|
215
|
+
'listeners' =>
|
216
|
+
[
|
217
|
+
{
|
218
|
+
'protocol' => 'https',
|
219
|
+
'certificateUrl' => 'url-to-certificate'
|
220
|
+
}
|
221
|
+
]
|
222
|
+
}
|
223
|
+
},
|
224
|
+
'secrets' =>
|
225
|
+
[
|
226
|
+
{
|
227
|
+
'sourceVault' =>
|
228
|
+
{
|
229
|
+
'id' => '/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.KeyVault/vaults/myvault1'
|
230
|
+
},
|
231
|
+
'vaultCertificates' =>
|
232
|
+
[
|
233
|
+
{
|
234
|
+
'certificateUrl' => 'https://myvault1.vault.azure.net/secrets/{secretName}/{secretVersion}',
|
235
|
+
'certificateStore' => '{certificateStoreName}'
|
236
|
+
}
|
237
|
+
]
|
238
|
+
}
|
239
|
+
]
|
240
|
+
},
|
241
|
+
'networkProfile' =>
|
242
|
+
{
|
243
|
+
'networkInterfaces' =>
|
244
|
+
[
|
245
|
+
{
|
246
|
+
'id' => '/subscriptions/{subscription-id}/resourceGroups/myresourceGroup1/providers /Microsoft.Network/networkInterfaces/mynic1'
|
247
|
+
}
|
248
|
+
]
|
249
|
+
},
|
250
|
+
'availabilitySet' =>
|
251
|
+
{
|
252
|
+
'id' => '/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.Compute/availabilitySets/myav1'
|
253
|
+
}
|
254
|
+
}
|
255
|
+
}
|
256
|
+
end
|
257
|
+
|
258
|
+
def self.list_virtual_machines_response
|
259
|
+
body = '{
|
260
|
+
"value": [
|
261
|
+
{
|
262
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/fog-test-rg/providers/Microsoft.Compute/virtualMachines/fog-test-server",
|
263
|
+
"name":"fog-test-server",
|
264
|
+
"type":"Microsoft.Compute/virtualMachines",
|
265
|
+
"location":"westus",
|
266
|
+
"tags": {
|
267
|
+
"department":"finance"
|
268
|
+
},
|
269
|
+
"properties": {
|
270
|
+
"availabilitySet": {
|
271
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.Compute/availabilitySets/myav1"
|
272
|
+
},
|
273
|
+
"hardwareProfile": {
|
274
|
+
"vmSize":"Standard_A0"
|
275
|
+
},
|
276
|
+
"storageProfile": {
|
277
|
+
"imageReference": {
|
278
|
+
"publisher":"MicrosoftWindowsServerEssentials",
|
279
|
+
"offer":"WindowsServerEssentials",
|
280
|
+
"sku":"WindowsServerEssentials",
|
281
|
+
"version":"latest"
|
282
|
+
},
|
283
|
+
"osDisk": {
|
284
|
+
"name":"myosdisk1",
|
285
|
+
"vhd": {
|
286
|
+
"uri":"http://mystorage1.blob.core.windows.net/vhds/myosdisk1.vhd"
|
287
|
+
},
|
288
|
+
"caching":"ReadWrite",
|
289
|
+
"createOption":"FromImage"
|
290
|
+
},
|
291
|
+
"dataDisks": [ {
|
292
|
+
"name":"mydatadisk1",
|
293
|
+
"diskSizeGB":"1",
|
294
|
+
"lun": 0,
|
295
|
+
"vhd": {
|
296
|
+
"uri" : "http://mystorage1.blob.core.windows.net/vhds/mydatadisk1.vhd"
|
297
|
+
},
|
298
|
+
"createOption":"Empty"
|
299
|
+
} ]
|
300
|
+
},
|
301
|
+
"osProfile": {
|
302
|
+
"computerName":"fog-test-server",
|
303
|
+
"adminUsername":"fog",
|
304
|
+
"adminPassword":"fog",
|
305
|
+
"customData":"",
|
306
|
+
"windowsConfiguration": {
|
307
|
+
"provisionVMAgent":true,
|
308
|
+
"winRM": {
|
309
|
+
"listeners": [ {
|
310
|
+
"protocol": "https",
|
311
|
+
"certificateUrl": "url-to-certificate"
|
312
|
+
} ]
|
313
|
+
},
|
314
|
+
"enableAutomaticUpdates":true
|
315
|
+
},
|
316
|
+
"secrets":[ {
|
317
|
+
"sourceVault": {
|
318
|
+
"id": "/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.KeyVault/vaults/myvault1"
|
319
|
+
},
|
320
|
+
"vaultCertificates": [ {
|
321
|
+
"certificateUrl": "https://myvault1.vault.azure.net/secrets/{secretName}/{secretVersion}",
|
322
|
+
"certificateStore": "{certificateStoreName}"
|
323
|
+
} ]
|
324
|
+
} ]
|
325
|
+
},
|
326
|
+
"networkProfile": {
|
327
|
+
"networkInterfaces": [ {
|
328
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/myresourceGroup1/providers /Microsoft.Network/networkInterfaces/mynic1"
|
329
|
+
} ]
|
330
|
+
}
|
331
|
+
}
|
332
|
+
}
|
333
|
+
]
|
334
|
+
}'
|
335
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
336
|
+
result.body = Azure::ARM::Compute::Models::VirtualMachineListResult.deserialize_object(JSON.load(body))
|
337
|
+
result
|
338
|
+
end
|
339
|
+
|
340
|
+
def self.list_available_sizes_for_virtual_machine_response
|
341
|
+
body = '{
|
342
|
+
"value": [
|
343
|
+
{
|
344
|
+
"name": "Standard_A0",
|
345
|
+
"numberOfCores": 1,
|
346
|
+
"osDiskSizeInMB": 130048,
|
347
|
+
"resourceDiskSizeInMB": 20480,
|
348
|
+
"memoryInMB": 768,
|
349
|
+
"maxDataDiskCount": 1
|
350
|
+
}
|
351
|
+
]
|
352
|
+
}'
|
353
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
354
|
+
result.body = Azure::ARM::Compute::Models::VirtualMachineSizeListResult.deserialize_object(JSON.load(body))
|
355
|
+
result
|
356
|
+
end
|
357
|
+
|
358
|
+
def self.virtual_machine_instance_view_response
|
359
|
+
body = '{
|
360
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/fog-test-rg/providers/Microsoft.Compute/virtualMachines/fog-test-server",
|
361
|
+
"name":"fog-test-server",
|
362
|
+
"type":"Microsoft.Compute/virtualMachines",
|
363
|
+
"location":"westus",
|
364
|
+
"tags": {
|
365
|
+
"department":"finance"
|
366
|
+
},
|
367
|
+
"properties":
|
368
|
+
{
|
369
|
+
"instanceView":
|
370
|
+
{
|
371
|
+
"platformUpdateDomain": 0,
|
372
|
+
"platformFaultDomain": 0,
|
373
|
+
"vmAgent":
|
374
|
+
{
|
375
|
+
"vmAgentVersion": "2.5.1198.709",
|
376
|
+
"statuses": [
|
377
|
+
{
|
378
|
+
"code": "ProvisioningState/succeeded",
|
379
|
+
"level": "Info",
|
380
|
+
"displayStatus": "Ready",
|
381
|
+
"message": "GuestAgent is running and accepting new configurations.",
|
382
|
+
"time": "2015-04-21T11:42:44-07:00"
|
383
|
+
}]
|
384
|
+
},
|
385
|
+
"disks": [
|
386
|
+
{
|
387
|
+
"name": "msvm-os-20150410-074408-487548",
|
388
|
+
"statuses": [
|
389
|
+
{
|
390
|
+
"code": "ProvisioningState/succeeded",
|
391
|
+
"level": "Info",
|
392
|
+
"displayStatus": "Provisioning succeeded",
|
393
|
+
"time": "2015-04-10T12:44:10.4562812-07:00"
|
394
|
+
}]
|
395
|
+
}],
|
396
|
+
"statuses": [
|
397
|
+
{
|
398
|
+
"code": "ProvisioningState/succeeded",
|
399
|
+
"level": "Info",
|
400
|
+
"displayStatus": "Provisioning succeeded",
|
401
|
+
"time": "2015-04-10T12:50:09.0031588-07:00"
|
402
|
+
},
|
403
|
+
{
|
404
|
+
"code": "PowerState/running",
|
405
|
+
"level": "Info",
|
406
|
+
"displayStatus": "VM running"
|
407
|
+
}]
|
408
|
+
}
|
409
|
+
}
|
410
|
+
}'
|
411
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
412
|
+
result.body = Azure::ARM::Compute::Models::VirtualMachine.deserialize_object(JSON.load(body))
|
413
|
+
result
|
414
|
+
end
|
415
|
+
|
416
|
+
def self.vm_status_response
|
417
|
+
'running'
|
418
|
+
end
|
419
|
+
|
420
|
+
def self.update_virtual_machine_response
|
421
|
+
body = '
|
422
|
+
{
|
423
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/fog-test-rg/providers/Microsoft.Compute/virtualMachines/fog-test-server",
|
424
|
+
"name":"fog-test-server",
|
425
|
+
"type":"Microsoft.Compute/virtualMachines",
|
426
|
+
"location":"westus",
|
427
|
+
"tags": {
|
428
|
+
"department":"finance"
|
429
|
+
},
|
430
|
+
"properties": {
|
431
|
+
"availabilitySet": {
|
432
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.Compute/availabilitySets/myav1"
|
433
|
+
},
|
434
|
+
"hardwareProfile": {
|
435
|
+
"vmSize":"Standard_A0"
|
436
|
+
},
|
437
|
+
"storageProfile": {
|
438
|
+
"imageReference": {
|
439
|
+
"publisher":"MicrosoftWindowsServerEssentials",
|
440
|
+
"offer":"WindowsServerEssentials",
|
441
|
+
"sku":"WindowsServerEssentials",
|
442
|
+
"version":"latest"
|
443
|
+
},
|
444
|
+
"osDisk": {
|
445
|
+
"name":"myosdisk1",
|
446
|
+
"vhd": {
|
447
|
+
"uri":"http://mystorage1.blob.core.windows.net/vhds/myosdisk1.vhd"
|
448
|
+
},
|
449
|
+
"caching":"ReadWrite",
|
450
|
+
"createOption":"FromImage"
|
451
|
+
},
|
452
|
+
"dataDisks": [ {
|
453
|
+
"name":"mydatadisk1",
|
454
|
+
"diskSizeGB":"1",
|
455
|
+
"lun": 0,
|
456
|
+
"vhd": {
|
457
|
+
"uri" : "http://mystorage1.blob.core.windows.net/vhds/mydatadisk1.vhd"
|
458
|
+
},
|
459
|
+
"createOption":"Empty"
|
460
|
+
},
|
461
|
+
{
|
462
|
+
"name":"disk1",
|
463
|
+
"diskSizeGB":"1",
|
464
|
+
"lun": 0,
|
465
|
+
"vhd": {
|
466
|
+
"uri" : "http://mystorage1.blob.core.windows.net/vhds/mydatadisk1.vhd"
|
467
|
+
},
|
468
|
+
"createOption":"Empty"
|
469
|
+
}]
|
470
|
+
},
|
471
|
+
"osProfile": {
|
472
|
+
"computerName":"fog-test-server",
|
473
|
+
"adminUsername":"fog",
|
474
|
+
"adminPassword":"fog",
|
475
|
+
"customData":"",
|
476
|
+
"windowsConfiguration": {
|
477
|
+
"provisionVMAgent":true,
|
478
|
+
"winRM": {
|
479
|
+
"listeners": [ {
|
480
|
+
"protocol": "https",
|
481
|
+
"certificateUrl": "url-to-certificate"
|
482
|
+
} ]
|
483
|
+
},
|
484
|
+
"enableAutomaticUpdates":true
|
485
|
+
},
|
486
|
+
"secrets":[ {
|
487
|
+
"sourceVault": {
|
488
|
+
"id": "/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.KeyVault/vaults/myvault1"
|
489
|
+
},
|
490
|
+
"vaultCertificates": [ {
|
491
|
+
"certificateUrl": "https://myvault1.vault.azure.net/secrets/{secretName}/{secretVersion}",
|
492
|
+
"certificateStore": "{certificateStoreName}"
|
493
|
+
} ]
|
494
|
+
} ]
|
495
|
+
},
|
496
|
+
"networkProfile": {
|
497
|
+
"networkInterfaces": [ {
|
498
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/myresourceGroup1/providers /Microsoft.Network/networkInterfaces/mynic1"
|
499
|
+
} ]
|
500
|
+
}
|
501
|
+
}
|
502
|
+
}'
|
503
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
504
|
+
result.body = Azure::ARM::Compute::Models::VirtualMachine.deserialize_object(JSON.load(body))
|
505
|
+
result
|
506
|
+
end
|
507
|
+
|
508
|
+
def self.virtual_machine_15_data_disks_response
|
509
|
+
body = '
|
510
|
+
{
|
511
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/fog-test-rg/providers/Microsoft.Compute/virtualMachines/fog-test-server",
|
512
|
+
"name":"fog-test-server",
|
513
|
+
"type":"Microsoft.Compute/virtualMachines",
|
514
|
+
"location":"westus",
|
515
|
+
"tags": {
|
516
|
+
"department":"finance"
|
517
|
+
},
|
518
|
+
"properties": {
|
519
|
+
"availabilitySet": {
|
520
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.Compute/availabilitySets/myav1"
|
521
|
+
},
|
522
|
+
"hardwareProfile": {
|
523
|
+
"vmSize":"Standard_A0"
|
524
|
+
},
|
525
|
+
"storageProfile": {
|
526
|
+
"imageReference": {
|
527
|
+
"publisher":"MicrosoftWindowsServerEssentials",
|
528
|
+
"offer":"WindowsServerEssentials",
|
529
|
+
"sku":"WindowsServerEssentials",
|
530
|
+
"version":"latest"
|
531
|
+
},
|
532
|
+
"osDisk": {
|
533
|
+
"name":"myosdisk1",
|
534
|
+
"vhd": {
|
535
|
+
"uri":"http://mystorage1.blob.core.windows.net/vhds/myosdisk1.vhd"
|
536
|
+
},
|
537
|
+
"caching":"ReadWrite",
|
538
|
+
"createOption":"FromImage"
|
539
|
+
},
|
540
|
+
"dataDisks": [ {
|
541
|
+
"name":"mydatadisk1",
|
542
|
+
"diskSizeGB":"1",
|
543
|
+
"lun": 0,
|
544
|
+
"vhd": {
|
545
|
+
"uri" : "http://mystorage1.blob.core.windows.net/vhds/mydatadisk1.vhd"
|
546
|
+
},
|
547
|
+
"createOption":"Empty"
|
548
|
+
},
|
549
|
+
{
|
550
|
+
"name":"disk1",
|
551
|
+
"diskSizeGB":"1",
|
552
|
+
"lun": 1,
|
553
|
+
"vhd": {
|
554
|
+
"uri" : "http://mystorage1.blob.core.windows.net/vhds/mydatadisk1.vhd"
|
555
|
+
},
|
556
|
+
"createOption":"Empty"
|
557
|
+
},
|
558
|
+
{
|
559
|
+
"name":"disk2",
|
560
|
+
"lun": 2
|
561
|
+
},
|
562
|
+
{
|
563
|
+
"name":"disk3",
|
564
|
+
"lun": 3
|
565
|
+
},
|
566
|
+
{
|
567
|
+
"name":"disk3",
|
568
|
+
"lun": 4
|
569
|
+
},
|
570
|
+
{
|
571
|
+
"name":"disk4",
|
572
|
+
"lun": 5
|
573
|
+
},
|
574
|
+
{
|
575
|
+
"name":"disk5",
|
576
|
+
"lun": 6
|
577
|
+
},
|
578
|
+
{
|
579
|
+
"name":"disk6",
|
580
|
+
"lun": 7
|
581
|
+
},
|
582
|
+
{
|
583
|
+
"name":"disk7",
|
584
|
+
"lun": 8
|
585
|
+
},
|
586
|
+
{
|
587
|
+
"name":"disk8",
|
588
|
+
"lun": 9
|
589
|
+
},
|
590
|
+
{
|
591
|
+
"name":"disk9",
|
592
|
+
"lun": 10
|
593
|
+
},
|
594
|
+
{
|
595
|
+
"name":"disk10",
|
596
|
+
"lun": 11
|
597
|
+
},
|
598
|
+
{
|
599
|
+
"name":"disk11",
|
600
|
+
"lun": 12
|
601
|
+
},
|
602
|
+
{
|
603
|
+
"name":"disk12",
|
604
|
+
"lun": 13
|
605
|
+
},
|
606
|
+
{
|
607
|
+
"name":"disk13",
|
608
|
+
"lun": 14
|
609
|
+
},
|
610
|
+
{
|
611
|
+
"name":"disk14",
|
612
|
+
"lun": 15
|
613
|
+
}]
|
614
|
+
},
|
615
|
+
"osProfile": {
|
616
|
+
"computerName":"fog-test-server",
|
617
|
+
"adminUsername":"fog",
|
618
|
+
"adminPassword":"fog",
|
619
|
+
"customData":"",
|
620
|
+
"windowsConfiguration": {
|
621
|
+
"provisionVMAgent":true,
|
622
|
+
"winRM": {
|
623
|
+
"listeners": [ {
|
624
|
+
"protocol": "https",
|
625
|
+
"certificateUrl": "url-to-certificate"
|
626
|
+
} ]
|
627
|
+
},
|
628
|
+
"enableAutomaticUpdates":true
|
629
|
+
},
|
630
|
+
"secrets":[ {
|
631
|
+
"sourceVault": {
|
632
|
+
"id": "/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.KeyVault/vaults/myvault1"
|
633
|
+
},
|
634
|
+
"vaultCertificates": [ {
|
635
|
+
"certificateUrl": "https://myvault1.vault.azure.net/secrets/{secretName}/{secretVersion}",
|
636
|
+
"certificateStore": "{certificateStoreName}"
|
637
|
+
} ]
|
638
|
+
} ]
|
639
|
+
},
|
640
|
+
"networkProfile": {
|
641
|
+
"networkInterfaces": [ {
|
642
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/myresourceGroup1/providers /Microsoft.Network/networkInterfaces/mynic1"
|
643
|
+
} ]
|
644
|
+
}
|
645
|
+
}
|
646
|
+
}'
|
647
|
+
result = MsRestAzure::AzureOperationResponse.new(MsRest::HttpOperationRequest.new('', '', ''), Faraday::Response.new)
|
648
|
+
result.body = Azure::ARM::Compute::Models::VirtualMachine.deserialize_object(JSON.load(body))
|
649
|
+
result
|
650
|
+
end
|
651
|
+
end
|
652
|
+
end
|
653
|
+
end
|
654
|
+
end
|