fog-azure-rm 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/CHANGELOG.md +9 -0
  4. data/lib/fog/azurerm/docs/compute.md +1 -1
  5. data/lib/fog/azurerm/docs/sql.md +39 -0
  6. data/lib/fog/azurerm/docs/storage.md +89 -2
  7. data/lib/fog/azurerm/models/application_gateway/gateways.rb +4 -7
  8. data/lib/fog/azurerm/models/compute/availability_sets.rb +4 -6
  9. data/lib/fog/azurerm/models/compute/servers.rb +5 -8
  10. data/lib/fog/azurerm/models/compute/virtual_machine_extensions.rb +0 -3
  11. data/lib/fog/azurerm/models/dns/record_sets.rb +5 -9
  12. data/lib/fog/azurerm/models/dns/zones.rb +4 -7
  13. data/lib/fog/azurerm/models/network/express_route_circuit_authorizations.rb +0 -3
  14. data/lib/fog/azurerm/models/network/express_route_circuit_peerings.rb +5 -9
  15. data/lib/fog/azurerm/models/network/express_route_circuits.rb +4 -7
  16. data/lib/fog/azurerm/models/network/express_route_service_providers.rb +2 -5
  17. data/lib/fog/azurerm/models/network/load_balancers.rb +4 -7
  18. data/lib/fog/azurerm/models/network/local_network_gateways.rb +0 -3
  19. data/lib/fog/azurerm/models/network/network_interfaces.rb +4 -7
  20. data/lib/fog/azurerm/models/network/network_security_groups.rb +4 -7
  21. data/lib/fog/azurerm/models/network/network_security_rules.rb +2 -6
  22. data/lib/fog/azurerm/models/network/public_ips.rb +4 -7
  23. data/lib/fog/azurerm/models/network/subnets.rb +5 -9
  24. data/lib/fog/azurerm/models/network/virtual_network_gateway_connections.rb +0 -3
  25. data/lib/fog/azurerm/models/network/virtual_network_gateways.rb +4 -7
  26. data/lib/fog/azurerm/models/network/virtual_networks.rb +4 -7
  27. data/lib/fog/azurerm/models/resources/azure_resources.rb +2 -5
  28. data/lib/fog/azurerm/models/resources/deployments.rb +4 -7
  29. data/lib/fog/azurerm/models/resources/resource_groups.rb +4 -7
  30. data/lib/fog/azurerm/models/sql/firewall_rule.rb +52 -0
  31. data/lib/fog/azurerm/models/sql/firewall_rules.rb +28 -0
  32. data/lib/fog/azurerm/models/storage/data_disk.rb +1 -0
  33. data/lib/fog/azurerm/models/storage/directories.rb +1 -4
  34. data/lib/fog/azurerm/models/storage/files.rb +1 -4
  35. data/lib/fog/azurerm/models/storage/recovery_vault.rb +50 -0
  36. data/lib/fog/azurerm/models/storage/recovery_vaults.rb +27 -0
  37. data/lib/fog/azurerm/models/storage/storage_account.rb +23 -4
  38. data/lib/fog/azurerm/models/storage/storage_accounts.rb +5 -7
  39. data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +4 -4
  40. data/lib/fog/azurerm/requests/sql/create_or_update_firewall_rule.rb +56 -0
  41. data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +4 -5
  42. data/lib/fog/azurerm/requests/sql/delete_database.rb +4 -4
  43. data/lib/fog/azurerm/requests/sql/delete_firewall_rule.rb +36 -0
  44. data/lib/fog/azurerm/requests/sql/delete_sql_server.rb +2 -2
  45. data/lib/fog/azurerm/requests/sql/get_database.rb +2 -2
  46. data/lib/fog/azurerm/requests/sql/get_firewall_rule.rb +43 -0
  47. data/lib/fog/azurerm/requests/sql/get_sql_server.rb +2 -2
  48. data/lib/fog/azurerm/requests/sql/list_databases.rb +2 -2
  49. data/lib/fog/azurerm/requests/sql/list_firewall_rules.rb +55 -0
  50. data/lib/fog/azurerm/requests/sql/list_sql_servers.rb +2 -2
  51. data/lib/fog/azurerm/requests/storage/create_disk.rb +36 -0
  52. data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +54 -0
  53. data/lib/fog/azurerm/requests/storage/create_storage_account.rb +13 -2
  54. data/lib/fog/azurerm/requests/storage/delete_disk.rb +5 -9
  55. data/lib/fog/azurerm/requests/storage/delete_recovery_vault.rb +35 -0
  56. data/lib/fog/azurerm/requests/storage/disable_backup_protection.rb +60 -0
  57. data/lib/fog/azurerm/requests/storage/enable_backup_protection.rb +61 -0
  58. data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +56 -0
  59. data/lib/fog/azurerm/requests/storage/get_backup_container.rb +53 -0
  60. data/lib/fog/azurerm/requests/storage/get_backup_item.rb +58 -0
  61. data/lib/fog/azurerm/requests/storage/get_backup_job_for_vm.rb +53 -0
  62. data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +64 -0
  63. data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +49 -0
  64. data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +48 -0
  65. data/lib/fog/azurerm/requests/storage/set_recovery_vault_context.rb +36 -0
  66. data/lib/fog/azurerm/requests/storage/start_backup.rb +54 -0
  67. data/lib/fog/azurerm/requests/storage/update_storage_account.rb +59 -0
  68. data/lib/fog/azurerm/sql.rb +9 -0
  69. data/lib/fog/azurerm/storage.rb +24 -0
  70. data/lib/fog/azurerm/version.rb +1 -1
  71. data/rake-script.sh +8 -0
  72. data/rakefile +11 -3
  73. data/test/api_stub.rb +4 -0
  74. data/test/api_stub/models/sql/sql_firewall_rule.rb +22 -0
  75. data/test/api_stub/models/storage/recovery_vault.rb +23 -0
  76. data/test/api_stub/requests/sql/firewall_rule.rb +46 -0
  77. data/test/api_stub/requests/storage/recovery_vault.rb +189 -0
  78. data/test/api_stub/requests/storage/storageaccount.rb +2 -1
  79. data/test/integration/container.rb +4 -3
  80. data/test/integration/data_disk.rb +77 -0
  81. data/test/integration/express_route_circuit.rb +9 -9
  82. data/test/integration/server.rb +9 -2
  83. data/test/integration/sql_server.rb +35 -0
  84. data/test/integration/storage_account.rb +9 -1
  85. data/test/models/sql/test_firewall_rule.rb +54 -0
  86. data/test/models/sql/test_firewall_rules.rb +41 -0
  87. data/test/models/storage/test_recovery_vault.rb +61 -0
  88. data/test/models/storage/test_recovery_vaults.rb +47 -0
  89. data/test/models/storage/test_storage_account.rb +8 -1
  90. data/test/requests/sql/test_create_or_update_firewall_rule.rb +27 -0
  91. data/test/requests/sql/test_delete_firewall_rule.rb +34 -0
  92. data/test/requests/sql/test_get_firewall_rule.rb +35 -0
  93. data/test/requests/sql/test_list_firewall_rules.rb +35 -0
  94. data/test/requests/storage/test_create_disk.rb +17 -0
  95. data/test/requests/storage/test_create_recovery_vault.rb +35 -0
  96. data/test/requests/storage/test_delete_disk.rb +23 -0
  97. data/test/requests/storage/test_delete_recovery_vault.rb +34 -0
  98. data/test/requests/storage/test_disable_backup_protection.rb +52 -0
  99. data/test/requests/storage/test_enable_backup_protection.rb +66 -0
  100. data/test/requests/storage/test_get_all_backup_jobs.rb +35 -0
  101. data/test/requests/storage/test_get_backup_container.rb +35 -0
  102. data/test/requests/storage/test_get_backup_item.rb +35 -0
  103. data/test/requests/storage/test_get_backup_job_for_vm.rb +26 -0
  104. data/test/requests/storage/test_get_backup_protection_policy.rb +35 -0
  105. data/test/requests/storage/test_get_recovery_vault.rb +35 -0
  106. data/test/requests/storage/test_list_recovery_vault.rb +35 -0
  107. data/test/requests/storage/test_set_recovery_vault_context.rb +34 -0
  108. data/test/requests/storage/test_start_backup.rb +55 -0
  109. data/test/requests/storage/test_update_storage_account.rb +34 -0
  110. data/test/smoke_tests/compute/test_resource_group_smoke.rb +34 -24
  111. data/test/test_helper.rb +26 -0
  112. metadata +55 -2
@@ -18,12 +18,21 @@ module Fog
18
18
  request :get_database
19
19
  request :list_databases
20
20
 
21
+ request :create_or_update_firewall_rule
22
+ request :delete_firewall_rule
23
+ request :get_firewall_rule
24
+ request :list_firewall_rules
25
+
21
26
  model_path 'fog/azurerm/models/sql'
22
27
  model :sql_server
23
28
  collection :sql_servers
29
+
24
30
  model :sql_database
25
31
  collection :sql_databases
26
32
 
33
+ model :firewall_rule
34
+ collection :firewall_rules
35
+
27
36
  # This class provides the actual implementation for service calls.
28
37
  class Real
29
38
  def initialize(options)
@@ -17,6 +17,7 @@ module Fog
17
17
  request_path 'fog/azurerm/requests/storage'
18
18
  # Azure Storage Account requests
19
19
  request :create_storage_account
20
+ request :update_storage_account
20
21
  request :list_storage_accounts
21
22
  request :delete_storage_account
22
23
  request :get_storage_account
@@ -25,6 +26,7 @@ module Fog
25
26
  request :get_storage_access_keys
26
27
  # Azure Storage Disk requests
27
28
  request :delete_disk
29
+ request :create_disk
28
30
  # Azure Storage Container requests
29
31
  request :create_container
30
32
  request :release_container_lease
@@ -50,6 +52,21 @@ module Fog
50
52
  request :acquire_blob_lease
51
53
  request :release_blob_lease
52
54
  request :delete_blob
55
+ # Azure Recovery Vault requests
56
+ request :create_or_update_recovery_vault
57
+ request :get_recovery_vault
58
+ request :list_recovery_vaults
59
+ request :delete_recovery_vault
60
+ request :enable_backup_protection
61
+ request :set_recovery_vault_context
62
+ request :get_backup_protection_policy
63
+ request :start_backup
64
+ request :get_backup_item
65
+ request :get_backup_container
66
+ request :disable_backup_protection
67
+ request :get_all_backup_jobs
68
+ request :get_all_backup_jobs
69
+ request :get_backup_job_for_vm
53
70
 
54
71
  model_path 'fog/azurerm/models/storage'
55
72
  model :storage_account
@@ -59,6 +76,8 @@ module Fog
59
76
  collection :directories
60
77
  model :file
61
78
  collection :files
79
+ model :recovery_vault
80
+ collection :recovery_vaults
62
81
 
63
82
  # This class provides the mock implementation for unit tests.
64
83
  class Mock
@@ -85,6 +104,11 @@ module Fog
85
104
  raise e.message
86
105
  end
87
106
 
107
+ @tenant_id = options[:tenant_id]
108
+ @client_id = options[:client_id]
109
+ @client_secret = options[:client_secret]
110
+ @subscription_id = options[:subscription_id]
111
+
88
112
  credentials = Fog::Credentials::AzureRM.get_credentials(options[:tenant_id], options[:client_id], options[:client_secret])
89
113
  unless credentials.nil?
90
114
  @storage_mgmt_client = ::Azure::ARM::Storage::StorageManagementClient.new(credentials)
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module AzureRM
3
- VERSION = '0.0.9'.freeze
3
+ VERSION = '0.1.0'.freeze
4
4
  end
5
5
  end
data/rake-script.sh ADDED
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+ if [ $TRAVIS_PULL_REQUEST != "true"]
3
+ then
4
+ rake cc_coverage
5
+ rake integration_tests
6
+ else
7
+ rake cc_coverage
8
+ fi
data/rakefile CHANGED
@@ -3,19 +3,27 @@ task default: :cc_coverage
3
3
  task :test do
4
4
  ENV['COVERAGE'] = nil
5
5
  ENV['CODECLIMATE_REPO_TOKEN'] = nil
6
- Dir.glob('**/test_*.rb').each { |file| require File.expand_path file, __dir__ }
6
+ Dir.glob('test/models/**/test_*.rb').each { |file| require File.expand_path file, __dir__ }
7
+ Dir.glob('test/requests/**/test_*.rb').each { |file| require File.expand_path file, __dir__ }
7
8
  end
8
9
 
9
10
  desc 'Generates a coverage report for minitest-cases using simple-cov'
10
11
  task :coverage do
11
12
  ENV['CODECLIMATE_REPO_TOKEN'] = nil
12
13
  ENV['COVERAGE'] = 'true'
13
- Dir.glob('**/test_*.rb').each { |file| require File.expand_path file, __dir__ }
14
+ Dir.glob('test/models/**/test_*.rb').each { |file| require File.expand_path file, __dir__ }
15
+ Dir.glob('test/requests/**/test_*.rb').each { |file| require File.expand_path file, __dir__ }
14
16
  end
15
17
 
16
18
  desc 'Generates a coverage report for minitest-cases using code-climate'
17
19
  task :cc_coverage do
18
20
  ENV['COVERAGE'] = nil
19
21
  ENV['CODECLIMATE_REPO_TOKEN'] = 'b1401494baa004d90402414cb33a7fc6420fd3693e60c677a120ddefd7d84cfd'
20
- Dir.glob('**/test_*.rb').each { |file| require File.expand_path file, __dir__ }
22
+ Dir.glob('test/models/**/test_*.rb').each { |file| require File.expand_path file, __dir__ }
23
+ Dir.glob('test/requests/**/test_*.rb').each { |file| require File.expand_path file, __dir__ }
21
24
  end
25
+
26
+ desc 'Generates a coverage report for integration tests'
27
+ task :integration_tests do
28
+ Dir.glob('test/smoke_tests/**/test_*.rb').each { |file| require File.expand_path file, __dir__ }
29
+ end
data/test/api_stub.rb CHANGED
@@ -17,6 +17,7 @@ module ApiStub
17
17
  autoload :StorageAccount, File.expand_path('api_stub/models/storage/storageaccount', __dir__)
18
18
  autoload :File, ::File.expand_path('api_stub/models/storage/file', __dir__)
19
19
  autoload :Directory, ::File.expand_path('api_stub/models/storage/directory', __dir__)
20
+ autoload :RecoveryVault, ::File.expand_path('api_stub/models/storage/recovery_vault', __dir__)
20
21
  end
21
22
 
22
23
  module Network
@@ -53,6 +54,7 @@ module ApiStub
53
54
  module Sql
54
55
  autoload :SqlServer, File.expand_path('api_stub/models/sql/sql_server', __dir__)
55
56
  autoload :SqlDatabase, File.expand_path('api_stub/models/sql/sql_database', __dir__)
57
+ autoload :SqlFirewallRule, File.expand_path('api_stub/models/sql/sql_firewall_rule', __dir__)
56
58
  end
57
59
  end
58
60
 
@@ -73,6 +75,7 @@ module ApiStub
73
75
  autoload :StorageAccount, File.expand_path('api_stub/requests/storage/storageaccount', __dir__)
74
76
  autoload :File, ::File.expand_path('api_stub/requests/storage/file', __dir__)
75
77
  autoload :Directory, ::File.expand_path('api_stub/requests/storage/directory', __dir__)
78
+ autoload :RecoveryVault, ::File.expand_path('api_stub/requests/storage/recovery_vault', __dir__)
76
79
  end
77
80
 
78
81
  module Network
@@ -109,6 +112,7 @@ module ApiStub
109
112
  module Sql
110
113
  autoload :SqlServer, File.expand_path('api_stub/requests/sql/sql_server', __dir__)
111
114
  autoload :SqlDatabase, File.expand_path('api_stub/requests/sql/database', __dir__)
115
+ autoload :FirewallRule, File.expand_path('api_stub/requests/sql/firewall_rule', __dir__)
112
116
  end
113
117
  end
114
118
  end
@@ -0,0 +1,22 @@
1
+ module ApiStub
2
+ module Models
3
+ module Sql
4
+ # Mock class for Firewall Rule
5
+ class SqlFirewallRule
6
+ # This class contain mock
7
+ def self.create_firewall_rule
8
+ {
9
+ 'id' => '{uri-of-firewall-rule}',
10
+ 'name' => '{rule-name}',
11
+ 'type' => '{rule-type}',
12
+ 'location' => '{server-location}',
13
+ 'properties' => {
14
+ 'startIpAddress' => '{start-ip-address}',
15
+ 'endIpAddress' => '{end-ip-address}'
16
+ }
17
+ }
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,23 @@
1
+ module ApiStub
2
+ module Models
3
+ module Storage
4
+ # Mock class for Recovery Vault model
5
+ class RecoveryVault
6
+ def self.create_method_response
7
+ {
8
+ 'id' => '/subscriptions/#{67f2116d}#######-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.RecoveryServices/vaults/fog-test-vault',
9
+ 'location' => 'westus',
10
+ 'name' => 'fog-test-vault',
11
+ 'properties' => {
12
+ 'provisioningState' => 'Succeeded'
13
+ },
14
+ 'type' => 'Microsoft.RecoveryServices/vaults',
15
+ 'sku' => {
16
+ 'name' => 'standard'
17
+ }
18
+ }
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,46 @@
1
+ module ApiStub
2
+ module Requests
3
+ module Sql
4
+ # Mock class for Firewall Rule
5
+ class FirewallRule
6
+ def self.create_firewall_rule_response
7
+ '{
8
+ "id": "{uri-of-firewall-rule}",
9
+ "name": "{rule-name}",
10
+ "type": "{rule-type}",
11
+ "location": "{server-location}",
12
+ "properties": {
13
+ "startIpAddress": "{start-ip-address}",
14
+ "endIpAddress": "{end-ip-address}"
15
+ }
16
+ }'
17
+ end
18
+
19
+ def self.list_firewall_rule_response
20
+ '{
21
+ "value": [{
22
+ "id": "{uri-of-firewall-rule}",
23
+ "name": "{rule-name}",
24
+ "type": "{rule-type}",
25
+ "location": "{server-location}",
26
+ "properties": {
27
+ "startIpAddress": "{start-ip-address}",
28
+ "endIpAddress": "{end-ip-address}"
29
+ }
30
+ }]
31
+ }'
32
+ end
33
+
34
+ def self.firewall_rule_hash
35
+ {
36
+ resource_group: 'resource_group',
37
+ server_name: 'server_name',
38
+ name: 'firewall_name',
39
+ start_ip: '10.10.10.01',
40
+ end_ip: '10.10.10.10'
41
+ }
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,189 @@
1
+ module ApiStub
2
+ module Requests
3
+ module Storage
4
+ # Mock class for RecoveryVault request
5
+ class RecoveryVault
6
+ def self.create_recovery_vault_response
7
+ '{
8
+ "location": "westus",
9
+ "name": "fog-test-vault",
10
+ "properties": {
11
+ "provisioningState": "Succeeded"
12
+ },
13
+ "id": "/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.RecoveryServices/vaults/fog-test-vault",
14
+ "type": "Microsoft.RecoveryServices\/vaults",
15
+ "sku": {
16
+ "name": "standard"
17
+ }
18
+ }'
19
+ end
20
+
21
+ def self.get_recovery_vault_response
22
+ '{
23
+ "value": [{
24
+ "location": "westus",
25
+ "name": "fog-test-vault",
26
+ "properties": {
27
+ "provisioningState": "Succeeded"
28
+ },
29
+ "id": "/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.RecoveryServices/vaults/fog-test-vault",
30
+ "type": "Microsoft.RecoveryServices/vaults",
31
+ "sku": {
32
+ "name": "standard"
33
+ }
34
+ }]
35
+ }'
36
+ end
37
+
38
+ def self.get_all_backup_jobs_response
39
+ '{
40
+ "value": [{
41
+ "id": "/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.RecoveryServices/vaults/fog-test-vault/backupJobs/########-####-####-####-############",
42
+ "name": "########-####-####-####-############",
43
+ "type": "Microsoft.RecoveryServices/vaults/backupJobs",
44
+ "properties": {
45
+ "jobType": "AzureIaaSVMJob",
46
+ "duration": "XX:XX:XX.XXXXXXX",
47
+ "actionsInfo": [
48
+ 1
49
+ ],
50
+ "virtualMachineVersion": "Compute",
51
+ "entityFriendlyName": "fog-test-vm",
52
+ "backupManagementType": "AzureIaasVM",
53
+ "operation": "Backup",
54
+ "status": "InProgress",
55
+ "startTime": "2016-10-19T07:49:31.1466534Z",
56
+ "activityId": "########-####-####-####-############"
57
+ }
58
+ }]
59
+ }'
60
+ end
61
+
62
+ def self.get_backup_container_response
63
+ '{
64
+ "value": [{
65
+ "id": "/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.RecoveryServices/vaults/fog-test-vault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;fog-test-vm-rg;fog-test-vm",
66
+ "name": "IaasVMContainer;iaasvmcontainerv2;fog-test-vm-rg;fog-test-vm",
67
+ "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers",
68
+ "properties": {
69
+ "virtualMachineId": "/subscriptions/########-####-####-####-############/resourceGroups/TestRG/providers/Microsoft.Compute/virtualMachines/TestVM",
70
+ "virtualMachineVersion": "Compute",
71
+ "resourceGroup": "fog-test-vm-rg",
72
+ "friendlyName": "fog-test-vm",
73
+ "backupManagementType": "AzureIaasVM",
74
+ "registrationStatus": "Registered",
75
+ "healthStatus": "Healthy",
76
+ "containerType": "Microsoft.Compute/virtualMachines",
77
+ "protectableObjectType": "Microsoft.Compute/virtualMachines"
78
+ }
79
+ }]
80
+ }'
81
+ end
82
+
83
+ def self.get_backup_item_response
84
+ '{
85
+ "value": [{
86
+ "id": "/Subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.RecoveryServices/vaults/fog-test-vault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;testrg;testvm/protectedItems/VM;fog-test-container-name",
87
+ "name": "iaasvmcontainerv2;fog-test-vm-rg;fog-test-vm",
88
+ "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems",
89
+ "properties": {
90
+ "friendlyName": "fog-test-vm",
91
+ "virtualMachineId": "/subscriptions/########-####-####-####-############/resourceGroups/fog-test-vm-rg/providers/Microsoft.Compute/virtualMachines/fog-test-vm",
92
+ "protectionStatus": "Healthy",
93
+ "protectionState": "Protected",
94
+ "lastBackupStatus": "Completed",
95
+ "lastBackupTime": "2016-10-17T10:30:47.2289274Z",
96
+ "protectedItemType": "Microsoft.Compute/virtualMachines",
97
+ "backupManagementType": "AzureIaasVM",
98
+ "workloadType": "VM",
99
+ "containerName": "iaasvmcontainerv2;fog-test-vm-rg;fog-test-vm",
100
+ "sourceResourceId": "/subscriptions/########-####-####-####-############/resourceGroups/fog-test-vm-rg/providers/Microsoft.Compute/virtualMachines/fog-test-vm",
101
+ "policyId": "/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.RecoveryServices/vaults/fog-test-vault/backupPolicies/DefaultPolicy",
102
+ "policyName": "DefaultPolicy",
103
+ "lastRecoveryPoint": "2016-10-17T10:32:38.4666692Z"
104
+ }
105
+ }]
106
+ }'
107
+ end
108
+
109
+ def self.list_recovery_vault_response
110
+ '{
111
+ "value": [{
112
+ "location": "westus",
113
+ "name": "fog-test-vault",
114
+ "properties": {
115
+ "provisioningState": "Succeeded"
116
+ },
117
+ "id": "/subscriptions/########-####-####-####-############/resourceGroups/fog-test-vault/providers/Microsoft.RecoveryServices/vaults/fog-test-vault",
118
+ "type": "Microsoft.RecoveryServices/vaults",
119
+ "sku": {
120
+ "name": "standard"
121
+ }
122
+ }]
123
+ }'
124
+ end
125
+
126
+ def self.get_backup_protection_policy_response
127
+ '{
128
+ "value": [{
129
+ "id": "/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.RecoveryServices/vaults/fog-test-vault/backupPolicies/DefaultPolicy",
130
+ "name": "DefaultPolicy",
131
+ "type": "Microsoft.RecoveryServices/vaults/backupPolicies",
132
+ "properties": {
133
+ "backupManagementType": "AzureIaasVM",
134
+ "schedulePolicy": {
135
+ "schedulePolicyType": "SimpleSchedulePolicy",
136
+ "scheduleRunFrequency": "Daily",
137
+ "scheduleRunTimes": [
138
+ "2016-10-13T19:30:00Z"
139
+ ],
140
+ "scheduleWeeklyFrequency": 0
141
+ },
142
+ "retentionPolicy": {
143
+ "retentionPolicyType": "LongTermRetentionPolicy",
144
+ "dailySchedule": {
145
+ "retentionTimes": [
146
+ "2016-10-13T19:30:00Z"
147
+ ],
148
+ "retentionDuration": {
149
+ "count": 30,
150
+ "durationType": "Days"
151
+ }
152
+ }
153
+ },
154
+ "protectedItemsCount": 0
155
+ }
156
+ }]
157
+ }'
158
+ end
159
+
160
+ def self.get_backup_job_for_vm_response
161
+ '{
162
+ "id": "/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.RecoveryServices/vaults/fog-test-vault/backupJobs/########-####-####-####-############",
163
+ "name": "########-####-####-####-############",
164
+ "type": "Microsoft.RecoveryServices/vaults/backupJobs",
165
+ "properties": {
166
+ "jobType": "AzureIaaSVMJob",
167
+ "duration": "00:00:52.3309441",
168
+ "virtualMachineVersion": "Compute",
169
+ "extendedInfo": {
170
+ "tasksList": [],
171
+ "propertyBag": {
172
+ "VM Name": "fog-test-vm",
173
+ "Policy Name": "DefaultPolicy"
174
+ }
175
+ },
176
+ "entityFriendlyName": "fog-test-vm",
177
+ "backupManagementType": "AzureIaasVM",
178
+ "operation": "ConfigureBackup",
179
+ "status": "Completed",
180
+ "startTime": "2016-10-13T09:55:49.1168243Z",
181
+ "endTime": "2016-10-13T09:56:41.4477684Z",
182
+ "activityId": "383f05d9-a4bf-4b95-bb41-d39849b3a86e-2016-10-13 09:55:53Z-PS"
183
+ }
184
+ }'
185
+ end
186
+ end
187
+ end
188
+ end
189
+ end