fog-azure-rm 0.0.6 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/fog/azurerm/compute.rb +6 -0
- data/lib/fog/azurerm/docs/compute.md +67 -11
- data/lib/fog/azurerm/docs/network.md +59 -0
- data/lib/fog/azurerm/docs/storage.md +107 -35
- data/lib/fog/azurerm/models/compute/server.rb +15 -9
- data/lib/fog/azurerm/models/compute/virtual_machine_extension.rb +78 -0
- data/lib/fog/azurerm/models/compute/virtual_machine_extensions.rb +30 -0
- data/lib/fog/azurerm/models/network/express_route_circuit.rb +21 -21
- data/lib/fog/azurerm/models/network/express_route_circuit_peering.rb +21 -21
- data/lib/fog/azurerm/models/network/express_route_service_provider.rb +8 -8
- data/lib/fog/azurerm/models/network/network_security_rule.rb +27 -0
- data/lib/fog/azurerm/models/network/network_security_rules.rb +31 -0
- data/lib/fog/azurerm/models/network/subnet.rb +16 -12
- data/lib/fog/azurerm/models/network/virtual_network_gateway.rb +6 -6
- data/lib/fog/azurerm/models/storage/{containers.rb → directories.rb} +10 -10
- data/lib/fog/azurerm/models/storage/{container.rb → directory.rb} +13 -13
- data/lib/fog/azurerm/models/storage/file.rb +151 -0
- data/lib/fog/azurerm/models/storage/files.rb +31 -0
- data/lib/fog/azurerm/network.rb +6 -0
- data/lib/fog/azurerm/requests/compute/create_or_update_vm_extension.rb +63 -0
- data/lib/fog/azurerm/requests/compute/create_virtual_machine.rb +45 -8
- data/lib/fog/azurerm/requests/compute/delete_vm_extension.rb +28 -0
- data/lib/fog/azurerm/requests/compute/get_vm_extension.rb +46 -0
- data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit.rb +44 -31
- data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit_peering.rb +23 -13
- data/lib/fog/azurerm/requests/network/create_or_update_network_security_rule.rb +59 -0
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network_gateway.rb +23 -15
- data/lib/fog/azurerm/requests/network/delete_network_security_rule.rb +30 -0
- data/lib/fog/azurerm/requests/network/get_available_ipaddresses_count.rb +23 -0
- data/lib/fog/azurerm/requests/network/get_network_security_rule.rb +47 -0
- data/lib/fog/azurerm/requests/network/list_network_security_groups.rb +1 -1
- data/lib/fog/azurerm/requests/network/list_network_security_rules.rb +51 -0
- data/lib/fog/azurerm/requests/storage/acquire_blob_lease.rb +29 -0
- data/lib/fog/azurerm/requests/storage/acquire_container_lease.rb +29 -0
- data/lib/fog/azurerm/requests/storage/check_blob_exist.rb +25 -0
- data/lib/fog/azurerm/requests/storage/compare_blob.rb +73 -0
- data/lib/fog/azurerm/requests/storage/copy_blob.rb +30 -0
- data/lib/fog/azurerm/requests/storage/copy_blob_from_uri.rb +30 -0
- data/lib/fog/azurerm/requests/storage/delete_blob.rb +27 -0
- data/lib/fog/azurerm/requests/storage/download_blob_to_file.rb +56 -0
- data/lib/fog/azurerm/requests/storage/get_blob_metadata.rb +37 -9
- data/lib/fog/azurerm/requests/storage/get_blob_properties.rb +53 -0
- data/lib/fog/azurerm/requests/storage/get_container_metadata.rb +2 -2
- data/lib/fog/azurerm/requests/storage/list_blobs.rb +82 -0
- data/lib/fog/azurerm/requests/storage/list_containers.rb +1 -1
- data/lib/fog/azurerm/requests/storage/release_blob_lease.rb +27 -0
- data/lib/fog/azurerm/requests/storage/release_container_lease.rb +27 -0
- data/lib/fog/azurerm/requests/storage/set_blob_metadata.rb +4 -4
- data/lib/fog/azurerm/requests/storage/set_blob_properties.rb +26 -0
- data/lib/fog/azurerm/requests/storage/set_container_metadata.rb +3 -3
- data/lib/fog/azurerm/requests/storage/upload_block_blob_from_file.rb +60 -0
- data/lib/fog/azurerm/storage.rb +26 -8
- data/lib/fog/azurerm/utilities/general.rb +14 -1
- data/lib/fog/azurerm/version.rb +1 -1
- data/test/api_stub.rb +8 -4
- data/test/api_stub/models/compute/virtual_machine_extension.rb +31 -0
- data/test/api_stub/models/network/network_security_rule.rb +30 -0
- data/test/api_stub/models/storage/{container.rb → directory.rb} +1 -1
- data/test/api_stub/models/storage/file.rb +178 -0
- data/test/api_stub/requests/compute/virtual_machine.rb +119 -0
- data/test/api_stub/requests/compute/virtual_machine_extension.rb +46 -0
- data/test/api_stub/requests/network/network_security_rule.rb +72 -0
- data/test/api_stub/requests/storage/{container.rb → directory.rb} +2 -2
- data/test/api_stub/requests/storage/file.rb +164 -0
- data/test/integration/availability_set.rb +6 -0
- data/test/integration/blob.rb +205 -0
- data/test/integration/credentials/azure.yml +4 -4
- data/test/integration/deployment.rb +9 -0
- data/test/integration/external_load_balancer.rb +9 -0
- data/test/integration/internal_load_balancer.rb +8 -0
- data/test/integration/network_security_group.rb +9 -0
- data/test/integration/network_security_rule.rb +86 -0
- data/test/integration/server.rb +62 -9
- data/test/integration/server_custom_image.rb +118 -0
- data/test/integration/subnet.rb +12 -1
- data/test/integration/virtual_machine_extension.rb +148 -0
- data/test/integration/virtual_network.rb +9 -1
- data/test/integration/virtual_network_gateway.rb +7 -29
- data/test/integration/virtual_network_gateway_connection_to_express_route.rb +116 -0
- data/test/models/compute/test_virtual_machine_extension.rb +61 -0
- data/test/models/compute/test_virtual_machine_extensions.rb +36 -0
- data/test/models/network/test_express_route_circuit.rb +4 -10
- data/test/models/network/test_express_route_circuit_peering.rb +4 -10
- data/test/models/network/test_network_interface.rb +4 -8
- data/test/models/network/test_network_security_rule.rb +14 -0
- data/test/models/network/test_network_security_rules.rb +42 -0
- data/test/models/network/test_subnet.rb +5 -0
- data/test/models/storage/test_directories.rb +106 -0
- data/test/models/storage/test_directory.rb +125 -0
- data/test/models/storage/test_file.rb +258 -0
- data/test/models/storage/test_files.rb +67 -0
- data/test/models/storage/test_storage_account.rb +2 -4
- data/test/requests/compute/test_create_virtual_machine.rb +19 -5
- data/test/requests/compute/test_create_vm_extension.rb +35 -0
- data/test/requests/compute/test_get_vm_extension.rb +26 -0
- data/test/requests/compute/test_update_vm_extension.rb +35 -0
- data/test/requests/network/test_create_or_update_network_security_rule.rb +28 -0
- data/test/requests/network/test_delete_network_security_rule.rb +25 -0
- data/test/requests/network/test_get_available_ipaddresses_count.rb +18 -0
- data/test/requests/network/test_get_network_security_rule.rb +26 -0
- data/test/requests/network/test_list_network_security_groups.rb +2 -2
- data/test/requests/network/test_list_network_security_rules.rb +26 -0
- data/test/requests/storage/test_acquire_blob_lease.rb +17 -0
- data/test/requests/storage/test_acquire_container_lease.rb +17 -0
- data/test/requests/storage/test_check_blob_exist.rb +17 -0
- data/test/requests/storage/test_compare_blob.rb +17 -0
- data/test/requests/storage/test_copy_blob.rb +17 -0
- data/test/requests/storage/test_copy_blob_from_uri.rb +17 -0
- data/test/requests/storage/test_create_container.rb +2 -2
- data/test/requests/storage/test_delete_blob.rb +22 -0
- data/test/requests/storage/test_delete_container.rb +1 -1
- data/test/requests/storage/test_download_blob_to_file.rb +25 -0
- data/test/requests/storage/test_get_blob_metadata.rb +2 -2
- data/test/requests/storage/test_get_blob_properties.rb +23 -0
- data/test/requests/storage/test_get_container_access_control_list.rb +2 -2
- data/test/requests/storage/test_get_container_metadata.rb +2 -2
- data/test/requests/storage/test_get_container_properties.rb +2 -2
- data/test/requests/storage/test_list_blobs_in_container.rb +23 -0
- data/test/requests/storage/test_list_containers.rb +2 -2
- data/test/requests/storage/test_release_blob_lease.rb +16 -0
- data/test/requests/storage/test_release_container_lease.rb +16 -0
- data/test/requests/storage/test_set_blob_metadata.rb +1 -1
- data/test/requests/storage/test_set_blob_properties.rb +16 -0
- data/test/requests/storage/test_set_container_metadata.rb +1 -1
- data/test/requests/storage/test_upload_block_blob_from_file.rb +23 -0
- data/test/test_helper.rb +116 -3
- metadata +73 -15
- data/.DS_Store +0 -0
- data/lib/fog/azurerm/fog_azure_rm_exception.rb +0 -13
- data/lib/fog/azurerm/models/storage/blob.rb +0 -13
- data/lib/fog/azurerm/models/storage/blobs.rb +0 -22
- data/test/api_stub/models/storage/blob.rb +0 -17
- data/test/api_stub/requests/storage/blob.rb +0 -24
- data/test/models/storage/test_blobs.rb +0 -32
- data/test/models/storage/test_container.rb +0 -67
- data/test/models/storage/test_containers.rb +0 -56
@@ -101,6 +101,48 @@ module ApiStub
|
|
101
101
|
}
|
102
102
|
end
|
103
103
|
|
104
|
+
def self.linux_virtual_machine_with_custom_image_params
|
105
|
+
{
|
106
|
+
resource_group: 'fog-test-rg',
|
107
|
+
name: 'fog-test-server',
|
108
|
+
location: 'westus',
|
109
|
+
vm_size: 'Basic_A0',
|
110
|
+
storage_account_name: 'fogstrg',
|
111
|
+
username: 'fog',
|
112
|
+
password: 'fog',
|
113
|
+
disable_password_authentication: false,
|
114
|
+
ssh_key_path: '/home',
|
115
|
+
ssh_key_data: 'key',
|
116
|
+
network_interface_card_id: 'nic-id',
|
117
|
+
availability_set_id: 'as-id',
|
118
|
+
platform: 'Linux',
|
119
|
+
provision_vm_agent: nil,
|
120
|
+
enable_automatic_updates: nil,
|
121
|
+
vhd_path: 'https://fogstrg.blob.core.windows.net/customvhd/ubuntu-image.vhd'
|
122
|
+
}
|
123
|
+
end
|
124
|
+
|
125
|
+
def self.windows_virtual_machine_with_custom_image_params
|
126
|
+
{
|
127
|
+
resource_group: 'fog-test-rg',
|
128
|
+
name: 'fog-test-server',
|
129
|
+
location: 'westus',
|
130
|
+
vm_size: 'Basic_A0',
|
131
|
+
storage_account_name: 'fogstrg',
|
132
|
+
username: 'fog',
|
133
|
+
password: 'fog',
|
134
|
+
disable_password_authentication: nil,
|
135
|
+
ssh_key_path: '/home',
|
136
|
+
ssh_key_data: 'key',
|
137
|
+
network_interface_card_id: 'nic-id',
|
138
|
+
availability_set_id: 'as-id',
|
139
|
+
platform: 'Windows',
|
140
|
+
provision_vm_agent: true,
|
141
|
+
enable_automatic_updates: true,
|
142
|
+
vhd_path: 'https://fogstrg.blob.core.windows.net/customvhd/windows-image.vhd'
|
143
|
+
}
|
144
|
+
end
|
145
|
+
|
104
146
|
def self.create_virtual_machine_response(compute_client)
|
105
147
|
body = '{
|
106
148
|
"id":"/subscriptions/{subscription-id}/resourceGroups/fog-test-rg/providers/Microsoft.Compute/virtualMachines/fog-test-server",
|
@@ -255,6 +297,83 @@ module ApiStub
|
|
255
297
|
compute_client.deserialize(vm_mapper, JSON.load(body), 'result.body')
|
256
298
|
end
|
257
299
|
|
300
|
+
def self.create_virtual_machine_from_custom_image_response(compute_client)
|
301
|
+
body = '{
|
302
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/fog-test-rg/providers/Microsoft.Compute/virtualMachines/fog-test-server",
|
303
|
+
"name":"fog-test-server",
|
304
|
+
"type":"Microsoft.Compute/virtualMachines",
|
305
|
+
"location":"westus",
|
306
|
+
"tags": {
|
307
|
+
"department":"finance"
|
308
|
+
},
|
309
|
+
"properties": {
|
310
|
+
"availabilitySet": {
|
311
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.Compute/availabilitySets/myav1"
|
312
|
+
},
|
313
|
+
"hardwareProfile": {
|
314
|
+
"vmSize":"Standard_A0"
|
315
|
+
},
|
316
|
+
"storageProfile": {
|
317
|
+
"imageReference": {
|
318
|
+
"publisher":"",
|
319
|
+
"offer":"",
|
320
|
+
"sku":"",
|
321
|
+
"version":""
|
322
|
+
},
|
323
|
+
"osDisk": {
|
324
|
+
"name":"myosdisk1",
|
325
|
+
"vhd": {
|
326
|
+
"uri":"https://custimagestorage.blob.core.windows.net/customimage/trusty-server-cloudimg-amd64-disk1.vhd"
|
327
|
+
},
|
328
|
+
"caching":"ReadWrite",
|
329
|
+
"createOption":"FromImage"
|
330
|
+
},
|
331
|
+
"dataDisks": [ {
|
332
|
+
"name":"mydatadisk1",
|
333
|
+
"diskSizeGB":"1",
|
334
|
+
"lun": 0,
|
335
|
+
"vhd": {
|
336
|
+
"uri" : "http://mystorage1.blob.core.windows.net/vhds/mydatadisk1.vhd"
|
337
|
+
},
|
338
|
+
"createOption":"Empty"
|
339
|
+
} ]
|
340
|
+
},
|
341
|
+
"osProfile": {
|
342
|
+
"computerName":"fog-test-server",
|
343
|
+
"adminUsername":"fog",
|
344
|
+
"adminPassword":"fog",
|
345
|
+
"customData":"",
|
346
|
+
"windowsConfiguration": {
|
347
|
+
"provisionVMAgent":true,
|
348
|
+
"winRM": {
|
349
|
+
"listeners": [ {
|
350
|
+
"protocol": "https",
|
351
|
+
"certificateUrl": "url-to-certificate"
|
352
|
+
} ]
|
353
|
+
},
|
354
|
+
"enableAutomaticUpdates":true
|
355
|
+
},
|
356
|
+
"secrets":[ {
|
357
|
+
"sourceVault": {
|
358
|
+
"id": "/subscriptions/{subscription-id}/resourceGroups/myresourcegroup1/providers/Microsoft.KeyVault/vaults/myvault1"
|
359
|
+
},
|
360
|
+
"vaultCertificates": [ {
|
361
|
+
"certificateUrl": "https://myvault1.vault.azure.net/secrets/{secretName}/{secretVersion}",
|
362
|
+
"certificateStore": "{certificateStoreName}"
|
363
|
+
} ]
|
364
|
+
} ]
|
365
|
+
},
|
366
|
+
"networkProfile": {
|
367
|
+
"networkInterfaces": [ {
|
368
|
+
"id":"/subscriptions/{subscription-id}/resourceGroups/myresourceGroup1/providers /Microsoft.Network/networkInterfaces/mynic1"
|
369
|
+
} ]
|
370
|
+
}
|
371
|
+
}
|
372
|
+
}'
|
373
|
+
vm_mapper = Azure::ARM::Compute::Models::VirtualMachine.mapper
|
374
|
+
compute_client.deserialize(vm_mapper, JSON.load(body), 'result.body')
|
375
|
+
end
|
376
|
+
|
258
377
|
def self.detach_data_disk_from_vm_response(compute_client)
|
259
378
|
body = '{
|
260
379
|
"id":"/subscriptions/{subscription-id}/resourceGroups/fog-test-rg/providers/Microsoft.Compute/virtualMachines/fog-test-server",
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Requests
|
3
|
+
module Compute
|
4
|
+
# Mock class for VirtualMachineExtension Requests
|
5
|
+
class VirtualMachineExtension
|
6
|
+
def self.create_vm_extension_response(compute_client)
|
7
|
+
body = {
|
8
|
+
'id' => '/subscriptions/########-####-####-####-############/resourceGroups/TestRG/providers/Microsoft.Compute/virtualMachines/TestVM/extensions/IaaSAntimalware',
|
9
|
+
'name' => 'IaasAntimalware',
|
10
|
+
'resource_group' => 'fog-test-rg',
|
11
|
+
'location' => 'West US',
|
12
|
+
'properties' => {
|
13
|
+
'publisher' => 'Microsoft.Azure.Security',
|
14
|
+
'type' => 'IaaSAntimalware',
|
15
|
+
'typeHandlerVersion' => '1.3',
|
16
|
+
'autoUpgradeMinorVersion' => 'true',
|
17
|
+
'forceUpdateTag' => 'RerunExtension',
|
18
|
+
'settings' => {
|
19
|
+
'AnitmalwareEnabled' => 'true',
|
20
|
+
'RealtimeProtectionEnabled' => 'false'
|
21
|
+
},
|
22
|
+
'protected_settings' => {}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
extension_mapper = Azure::ARM::Compute::Models::VirtualMachineExtension.mapper
|
26
|
+
compute_client.deserialize(extension_mapper, body, 'result.body')
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.vm_extension_params
|
30
|
+
{
|
31
|
+
resource_group: 'TestRG',
|
32
|
+
location: 'eastus',
|
33
|
+
vm_name: 'TestVM',
|
34
|
+
name: 'IaaSAntimalware',
|
35
|
+
publisher: 'Microsoft.Azure.Security',
|
36
|
+
type: 'IaaSAntimalware',
|
37
|
+
type_handler_version: '1.3',
|
38
|
+
auto_upgrade_minor_version: true,
|
39
|
+
settings: '{"AntimalwareEnabled": "true", "RealtimeProtectionEnabled": "false", "ScheduledScanSettings": {"isEnabled": "false", "day": "7", "time": "120", "scanType": "Quick"}, "Exclusions": {"Extensions": "", "Paths": "", "Processes": ""}}',
|
40
|
+
protected_settings: '{}'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Requests
|
3
|
+
module Network
|
4
|
+
# Mock class for Network Security Rule Request
|
5
|
+
class NetworkSecurityRule
|
6
|
+
def self.create_network_security_rule_response(network_client)
|
7
|
+
nsr = '{
|
8
|
+
"name":"myNsRule",
|
9
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/myNsg/securityRules/myNsRule",
|
10
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
11
|
+
"properties":{
|
12
|
+
"provisioningState":"Succeeded",
|
13
|
+
"description":"description-of-this-rule",
|
14
|
+
"protocol": "*",
|
15
|
+
"sourcePortRange":"source-port-range",
|
16
|
+
"destinationPortRange":"destination-port-range",
|
17
|
+
"sourceAddressPrefix":"*",
|
18
|
+
"destinationAddressPrefix":"*",
|
19
|
+
"access":"Allow",
|
20
|
+
"priority":6500,
|
21
|
+
"direction":"Inbound"
|
22
|
+
}
|
23
|
+
}'
|
24
|
+
nsr_mapper = Azure::ARM::Network::Models::SecurityRule.mapper
|
25
|
+
network_client.deserialize(nsr_mapper, JSON.load(nsr), 'result.body')
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.network_security_rule_paramteres_hash
|
29
|
+
{
|
30
|
+
name: 'testRule',
|
31
|
+
resource_group: 'TestRG-NSR',
|
32
|
+
protocol: 'tcp',
|
33
|
+
network_security_group_name: 'testGroup',
|
34
|
+
source_port_range: '22',
|
35
|
+
destination_port_range: '22',
|
36
|
+
source_address_prefix: '0.0.0.0/0',
|
37
|
+
destination_address_prefix: '0.0.0.0/0',
|
38
|
+
access: 'Allow',
|
39
|
+
priority: '100',
|
40
|
+
direction: 'Inbound'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.list_network_security_rules(network_client)
|
45
|
+
nsr_list = '{
|
46
|
+
"value":[
|
47
|
+
{
|
48
|
+
"name":"myNsRule",
|
49
|
+
"id":"/subscriptions/{guid}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/myNsg/securityRules/myNsRule",
|
50
|
+
"etag":"W/\"00000000-0000-0000-0000-000000000000\"",
|
51
|
+
"properties":{
|
52
|
+
"provisioningState":"Succeeded",
|
53
|
+
"description":"description-of-this-rule",
|
54
|
+
"protocol": "*",
|
55
|
+
"sourcePortRange":"source-port-range",
|
56
|
+
"destinationPortRange":"destination-port-range",
|
57
|
+
"sourceAddressPrefix":"*",
|
58
|
+
"destinationAddressPrefix":"*",
|
59
|
+
"access":"Allow",
|
60
|
+
"priority":100,
|
61
|
+
"direction":"Inbound"
|
62
|
+
}
|
63
|
+
}
|
64
|
+
]
|
65
|
+
}'
|
66
|
+
nsr_mapper = Azure::ARM::Network::Models::SecurityRuleListResult.mapper
|
67
|
+
network_client.deserialize(nsr_mapper, JSON.load(nsr_list), 'result.body')
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -2,7 +2,7 @@ module ApiStub
|
|
2
2
|
module Requests
|
3
3
|
module Storage
|
4
4
|
# Mock class for Deployment Requests
|
5
|
-
class
|
5
|
+
class Directory
|
6
6
|
def self.test_get_container_metadata
|
7
7
|
container = Azure::Storage::Blob::Container::Container.new
|
8
8
|
container.name = 'test-container'
|
@@ -26,7 +26,7 @@ module ApiStub
|
|
26
26
|
'properties' =>
|
27
27
|
{
|
28
28
|
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
29
|
-
'etag' => '0x8D3A3B5F017F52D'
|
29
|
+
'etag' => '0x8D3A3B5F017F52D'
|
30
30
|
}
|
31
31
|
}
|
32
32
|
end
|
@@ -0,0 +1,164 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Requests
|
3
|
+
module Storage
|
4
|
+
# Mock class for Deployment Requests
|
5
|
+
class File
|
6
|
+
def self.test_get_blob_metadata
|
7
|
+
container = Azure::Storage::Blob::Blob.new
|
8
|
+
container.name = 'Test-blob'
|
9
|
+
container.metadata = metadata_response
|
10
|
+
container
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.metadata_response
|
14
|
+
{
|
15
|
+
'container-name' => 'Test-container',
|
16
|
+
'blob-name' => 'Test-blob',
|
17
|
+
'category' => 'Images',
|
18
|
+
'resolution' => 'High'
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.get_blob_properties
|
23
|
+
{
|
24
|
+
'name' => 'testblob1',
|
25
|
+
'snapshot' => nil,
|
26
|
+
'metadata' => {},
|
27
|
+
'properties' =>
|
28
|
+
{
|
29
|
+
'last_modified' => 'Mon, 04 Jul 2016 09:30:31 GMT',
|
30
|
+
'etag' => '0x8D3A3EDD7C2B777',
|
31
|
+
'lease_status' => 'unlocked',
|
32
|
+
'lease_state' => 'available',
|
33
|
+
'lease_duration' => nil,
|
34
|
+
'content_length' => 4_194_304,
|
35
|
+
'content_type' => 'application/octet-stream',
|
36
|
+
'content_encoding' => nil,
|
37
|
+
'content_language' => nil,
|
38
|
+
'content_disposition' => nil,
|
39
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
40
|
+
'cache_control' => nil,
|
41
|
+
'sequence_number' => 0,
|
42
|
+
'blob_type' => 'PageBlob',
|
43
|
+
'copy_id' => '095adc3b-e277-4c3d-97e0-0abca881f60c',
|
44
|
+
'copy_status' => 'success',
|
45
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/testblob/4m?snapshot=2016-02-04T08%3A35%3A50.3157696Z',
|
46
|
+
'copy_progress' => '4194304/4194304',
|
47
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:35:52 GMT',
|
48
|
+
'copy_status_description' => nil,
|
49
|
+
'accept_ranges' => 0
|
50
|
+
}
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.upload_block_blob_from_file
|
55
|
+
{
|
56
|
+
'name' => 'testblob1',
|
57
|
+
'properties' =>
|
58
|
+
{
|
59
|
+
'last_modified' => 'Thu, 28 Jul 2016 06:53:05 GMT',
|
60
|
+
'etag' => '0x8D3B6B3D353FFCA',
|
61
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw=='
|
62
|
+
}
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.download_blob_to_file
|
67
|
+
{
|
68
|
+
'name' => 'testblob1',
|
69
|
+
'metadata' => {},
|
70
|
+
'properties' =>
|
71
|
+
{
|
72
|
+
'last_modified' => 'Thu, 28 Jul 2016 06:53:05 GMT',
|
73
|
+
'etag' => '0x8D3B6B3D353FFCA',
|
74
|
+
'lease_status' => 'unlocked',
|
75
|
+
'lease_state' => 'available',
|
76
|
+
'lease_duration' => nil,
|
77
|
+
'content_length' => 4_194_304,
|
78
|
+
'content_type' => 'application/atom+xml; charset=utf-8',
|
79
|
+
'content_encoding' => 'ASCII-8BIT',
|
80
|
+
'content_language' => nil,
|
81
|
+
'content_disposition' => nil,
|
82
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
83
|
+
'cache_control' => nil,
|
84
|
+
'blob_type' => 'BlockBlob',
|
85
|
+
'copy_id' => nil,
|
86
|
+
'copy_status' => nil,
|
87
|
+
'copy_source' => nil,
|
88
|
+
'copy_progress' => nil,
|
89
|
+
'copy_completion_time' => nil,
|
90
|
+
'copy_status_description' => nil,
|
91
|
+
'accept_ranges' => 0
|
92
|
+
}
|
93
|
+
}
|
94
|
+
end
|
95
|
+
|
96
|
+
def self.copy_blob
|
97
|
+
{
|
98
|
+
'copyId' => 'abc123',
|
99
|
+
'copyStatus' => 'pending'
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
103
|
+
def self.list_blobs_response
|
104
|
+
[
|
105
|
+
{
|
106
|
+
'name' => 'testblob1',
|
107
|
+
'properties' =>
|
108
|
+
{
|
109
|
+
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
110
|
+
'etag' => '0x8D3A3B5F017F52D',
|
111
|
+
'lease_status' => 'unlocked',
|
112
|
+
'lease_state' => 'available',
|
113
|
+
'content_length' => 4_194_304,
|
114
|
+
'content_type' => 'application/octet-stream',
|
115
|
+
'content_encoding' => nil,
|
116
|
+
'content_language' => nil,
|
117
|
+
'content_disposition' => nil,
|
118
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
119
|
+
'cache_control' => nil,
|
120
|
+
'sequence_number' => 0,
|
121
|
+
'blob_type' => 'PageBlob',
|
122
|
+
'copy_id' => '095adc3b-e277-4c3d-97e0-0abca881f60c',
|
123
|
+
'copy_status' => 'success',
|
124
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/testblob/testblob1?snapshot=2016-02-04T08%3A35%3A50.3256874Z',
|
125
|
+
'copy_progress' => '4194304/4194304',
|
126
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:35:52 GMT',
|
127
|
+
'copy_status_description' => nil,
|
128
|
+
'accept_ranges' => 0
|
129
|
+
},
|
130
|
+
'metadata' => {}
|
131
|
+
},
|
132
|
+
{
|
133
|
+
'name' => 'testblob2',
|
134
|
+
'properties' =>
|
135
|
+
{
|
136
|
+
'last_modified' => 'Tue, 04 Aug 2015 06:02:08 GMT',
|
137
|
+
'etag' => '0x8D29C92173526C8',
|
138
|
+
'lease_status' => 'unlocked',
|
139
|
+
'lease_state' => 'available',
|
140
|
+
'content_length' => 4_194_304,
|
141
|
+
'content_type' => 'application/octet-stream',
|
142
|
+
'content_encoding' => nil,
|
143
|
+
'content_language' => nil,
|
144
|
+
'content_disposition' => nil,
|
145
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
146
|
+
'cache_control' => nil,
|
147
|
+
'sequence_number' => 0,
|
148
|
+
'blob_type' => 'PageBlob',
|
149
|
+
'copy_id' => '0abcdc3b-4c3d-e277-97e0-0abca881f60c',
|
150
|
+
'copy_status' => 'success',
|
151
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/testblob/testblob2?snapshot=2016-02-04T08%3A35%3A55.3157696Z',
|
152
|
+
'copy_progress' => '4194304/4194304',
|
153
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:40:52 GMT',
|
154
|
+
'copy_status_description' => nil,
|
155
|
+
'accept_ranges' => 0
|
156
|
+
},
|
157
|
+
'metadata' => {}
|
158
|
+
}
|
159
|
+
]
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
@@ -40,6 +40,12 @@ compute.availability_sets.create(
|
|
40
40
|
location: 'eastus',
|
41
41
|
resource_group: 'TestRG-AS'
|
42
42
|
)
|
43
|
+
########################################################################################################################
|
44
|
+
###################### List Availability Sets ######################
|
45
|
+
########################################################################################################################
|
46
|
+
compute.availability_sets(resource_group: 'TestRG-AS').each do |availability_set|
|
47
|
+
Fog::Logger.debug "Name: #{availability_set.name}, Location: #{availability_set.location}"
|
48
|
+
end
|
43
49
|
|
44
50
|
########################################################################################################################
|
45
51
|
###################### Get and Delete Availability Set ######################
|