gitlab-fog-azure-rm 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.arclint +8 -0
- data/.codeclimate.yml +17 -0
- data/.gitignore +6 -0
- data/.gitlab-ci.yml +17 -0
- data/.hound.yml +2 -0
- data/.rubocop.yml +5 -0
- data/.rubocop_todo.yml +274 -0
- data/.travis.yml +49 -0
- data/CHANGELOG.md +414 -0
- data/CONTRIBUTING.md +40 -0
- data/CONTRIBUTORS.md +12 -0
- data/Gemfile +3 -0
- data/LICENSE.md +20 -0
- data/README.md +100 -0
- data/gitlab-fog-azure-rm.gemspec +31 -0
- data/lib/fog/azurerm.rb +30 -0
- data/lib/fog/azurerm/async_response.rb +44 -0
- data/lib/fog/azurerm/config.rb +1 -0
- data/lib/fog/azurerm/constants.rb +72 -0
- data/lib/fog/azurerm/credentials.rb +40 -0
- data/lib/fog/azurerm/custom_fog_errors.rb +52 -0
- data/lib/fog/azurerm/docs/storage.md +398 -0
- data/lib/fog/azurerm/docs/structure.md +53 -0
- data/lib/fog/azurerm/models/resources/azure_resource.rb +25 -0
- data/lib/fog/azurerm/models/resources/azure_resources.rb +40 -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 +30 -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/resources/resource_group.rb +34 -0
- data/lib/fog/azurerm/models/resources/resource_groups.rb +29 -0
- data/lib/fog/azurerm/models/storage/directories.rb +75 -0
- data/lib/fog/azurerm/models/storage/directory.rb +151 -0
- data/lib/fog/azurerm/models/storage/file.rb +265 -0
- data/lib/fog/azurerm/models/storage/files.rb +183 -0
- data/lib/fog/azurerm/models/storage/kind.rb +12 -0
- data/lib/fog/azurerm/models/storage/sku_name.rb +15 -0
- data/lib/fog/azurerm/models/storage/sku_tier.rb +12 -0
- data/lib/fog/azurerm/models/storage/storage_account.rb +92 -0
- data/lib/fog/azurerm/models/storage/storage_accounts.rb +47 -0
- data/lib/fog/azurerm/requests/storage/acquire_blob_lease.rb +32 -0
- data/lib/fog/azurerm/requests/storage/acquire_container_lease.rb +32 -0
- data/lib/fog/azurerm/requests/storage/check_container_exists.rb +30 -0
- data/lib/fog/azurerm/requests/storage/commit_blob_blocks.rb +30 -0
- data/lib/fog/azurerm/requests/storage/compare_container_blobs.rb +148 -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/copy_object.rb +20 -0
- data/lib/fog/azurerm/requests/storage/create_block_blob.rb +108 -0
- data/lib/fog/azurerm/requests/storage/create_container.rb +40 -0
- data/lib/fog/azurerm/requests/storage/create_disk.rb +62 -0
- data/lib/fog/azurerm/requests/storage/create_page_blob.rb +31 -0
- data/lib/fog/azurerm/requests/storage/delete_blob.rb +32 -0
- data/lib/fog/azurerm/requests/storage/delete_blob_https_url.rb +39 -0
- data/lib/fog/azurerm/requests/storage/delete_container.rb +31 -0
- data/lib/fog/azurerm/requests/storage/delete_disk.rb +36 -0
- data/lib/fog/azurerm/requests/storage/delete_object_url.rb +30 -0
- data/lib/fog/azurerm/requests/storage/get_blob.rb +163 -0
- data/lib/fog/azurerm/requests/storage/get_blob_http_url.rb +39 -0
- data/lib/fog/azurerm/requests/storage/get_blob_https_url.rb +39 -0
- data/lib/fog/azurerm/requests/storage/get_blob_properties.rb +55 -0
- data/lib/fog/azurerm/requests/storage/get_blob_url.rb +28 -0
- data/lib/fog/azurerm/requests/storage/get_container_acl.rb +30 -0
- data/lib/fog/azurerm/requests/storage/get_container_properties.rb +41 -0
- data/lib/fog/azurerm/requests/storage/get_container_url.rb +34 -0
- data/lib/fog/azurerm/requests/storage/get_object_url.rb +21 -0
- data/lib/fog/azurerm/requests/storage/list_blobs.rb +168 -0
- data/lib/fog/azurerm/requests/storage/list_containers.rb +73 -0
- data/lib/fog/azurerm/requests/storage/multipart_save_block_blob.rb +110 -0
- data/lib/fog/azurerm/requests/storage/put_blob_block.rb +30 -0
- data/lib/fog/azurerm/requests/storage/put_blob_https_url.rb +39 -0
- data/lib/fog/azurerm/requests/storage/put_blob_metadata.rb +31 -0
- data/lib/fog/azurerm/requests/storage/put_blob_pages.rb +30 -0
- data/lib/fog/azurerm/requests/storage/put_blob_properties.rb +31 -0
- data/lib/fog/azurerm/requests/storage/put_container_acl.rb +31 -0
- data/lib/fog/azurerm/requests/storage/put_container_metadata.rb +31 -0
- data/lib/fog/azurerm/requests/storage/put_object_url.rb +30 -0
- data/lib/fog/azurerm/requests/storage/release_blob_lease.rb +30 -0
- data/lib/fog/azurerm/requests/storage/release_container_lease.rb +30 -0
- data/lib/fog/azurerm/requests/storage/save_page_blob.rb +111 -0
- data/lib/fog/azurerm/requests/storage/wait_blob_copy_operation_to_finish.rb +56 -0
- data/lib/fog/azurerm/storage.rb +126 -0
- data/lib/fog/azurerm/utilities/general.rb +186 -0
- data/lib/fog/azurerm/utilities/logger_messages.yml +19 -0
- data/lib/fog/azurerm/version.rb +5 -0
- data/rake-script.sh +10 -0
- data/rakefile +29 -0
- data/test/api_stub.rb +147 -0
- data/test/api_stub/models/storage/directory.rb +178 -0
- data/test/api_stub/models/storage/file.rb +181 -0
- data/test/api_stub/requests/storage/directory.rb +89 -0
- data/test/api_stub/requests/storage/file.rb +252 -0
- data/test/integration/README.md +14 -0
- data/test/integration/blob.rb +297 -0
- data/test/integration/container.rb +160 -0
- data/test/integration/credentials/azure.yml +5 -0
- data/test/integration/storage_account.rb +135 -0
- data/test/models/storage/test_directories.rb +74 -0
- data/test/models/storage/test_directory.rb +178 -0
- data/test/models/storage/test_file.rb +294 -0
- data/test/models/storage/test_files.rb +234 -0
- data/test/requests/storage/test_acquire_blob_lease.rb +36 -0
- data/test/requests/storage/test_acquire_container_lease.rb +36 -0
- data/test/requests/storage/test_check_container_exists.rb +18 -0
- data/test/requests/storage/test_commit_blob_blocks.rb +34 -0
- data/test/requests/storage/test_compare_container_blobs.rb +36 -0
- data/test/requests/storage/test_copy_blob.rb +39 -0
- data/test/requests/storage/test_copy_blob_from_uri.rb +36 -0
- data/test/requests/storage/test_create_block_blob.rb +80 -0
- data/test/requests/storage/test_create_container.rb +36 -0
- data/test/requests/storage/test_create_disk.rb +70 -0
- data/test/requests/storage/test_create_page_blob.rb +34 -0
- data/test/requests/storage/test_delete_blob.rb +42 -0
- data/test/requests/storage/test_delete_blob_https_url.rb +32 -0
- data/test/requests/storage/test_delete_container.rb +42 -0
- data/test/requests/storage/test_delete_disk.rb +30 -0
- data/test/requests/storage/test_get_blob.rb +141 -0
- data/test/requests/storage/test_get_blob_http_url.rb +30 -0
- data/test/requests/storage/test_get_blob_https_url.rb +32 -0
- data/test/requests/storage/test_get_blob_properties.rb +47 -0
- data/test/requests/storage/test_get_blob_url.rb +75 -0
- data/test/requests/storage/test_get_container_acl.rb +37 -0
- data/test/requests/storage/test_get_container_properties.rb +45 -0
- data/test/requests/storage/test_get_container_url.rb +33 -0
- data/test/requests/storage/test_list_blobs.rb +77 -0
- data/test/requests/storage/test_list_containers.rb +54 -0
- data/test/requests/storage/test_multipart_save_block_blob.rb +105 -0
- data/test/requests/storage/test_put_blob_block.rb +34 -0
- data/test/requests/storage/test_put_blob_https_url.rb +32 -0
- data/test/requests/storage/test_put_blob_metadata.rb +36 -0
- data/test/requests/storage/test_put_blob_pages.rb +34 -0
- data/test/requests/storage/test_put_blob_properties.rb +39 -0
- data/test/requests/storage/test_put_container_acl.rb +34 -0
- data/test/requests/storage/test_put_container_metadata.rb +36 -0
- data/test/requests/storage/test_release_blob_lease.rb +34 -0
- data/test/requests/storage/test_release_container_lease.rb +34 -0
- data/test/requests/storage/test_save_page_blob.rb +115 -0
- data/test/requests/storage/test_wait_blob_copy_operation_to_finish.rb +148 -0
- data/test/smoke_tests/compute/test_resource_group_smoke.rb +37 -0
- data/test/test_credentials.rb +63 -0
- data/test/test_helper.rb +846 -0
- metadata +352 -0
@@ -0,0 +1,181 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Models
|
3
|
+
module Storage
|
4
|
+
# Mock class for Data Disk Model
|
5
|
+
class File
|
6
|
+
def self.blob
|
7
|
+
{
|
8
|
+
'name' => 'test_blob',
|
9
|
+
'metadata' => {},
|
10
|
+
'properties' => {
|
11
|
+
'last_modified' => 'Mon, 04 Jul 2016 09:30:31 GMT',
|
12
|
+
'etag' => '0x8D3A3EDD7C2B777',
|
13
|
+
'lease_status' => 'unlocked',
|
14
|
+
'lease_state' => 'available',
|
15
|
+
'lease_duration' => nil,
|
16
|
+
'content_length' => 4_194_304,
|
17
|
+
'content_type' => 'application/octet-stream',
|
18
|
+
'content_encoding' => nil,
|
19
|
+
'content_language' => nil,
|
20
|
+
'content_disposition' => nil,
|
21
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
22
|
+
'cache_control' => nil,
|
23
|
+
'sequence_number' => 0,
|
24
|
+
'blob_type' => 'PageBlob',
|
25
|
+
'copy_id' => '095adc3b-e277-4c3d-97e0-0abca881f60c',
|
26
|
+
'copy_status' => 'success',
|
27
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/testblob/4m?snapshot=2016-02-04T08%3A35%3A50.3157696Z',
|
28
|
+
'copy_progress' => '4194304/4194304',
|
29
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:35:52 GMT',
|
30
|
+
'copy_status_description' => nil,
|
31
|
+
'accept_ranges' => 0
|
32
|
+
}
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.blob_https_url
|
37
|
+
'https://sa.blob.core.windows.net/test_container/test_blob'
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.blob_metadata
|
41
|
+
{
|
42
|
+
'created-by' => 'User',
|
43
|
+
'source-machine' => 'Test-machine',
|
44
|
+
'category' => 'guidance',
|
45
|
+
'doctype' => 'textDocuments'
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.blob_list
|
50
|
+
{
|
51
|
+
next_marker: 'marker',
|
52
|
+
blobs:
|
53
|
+
[
|
54
|
+
{
|
55
|
+
'name' => 'test_blob1',
|
56
|
+
'metadata' => {},
|
57
|
+
'properties' => {
|
58
|
+
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
59
|
+
'etag' => '"0x8D3A3B5F017F52D"',
|
60
|
+
'lease_status' => 'unlocked',
|
61
|
+
'lease_state' => 'available',
|
62
|
+
'content_length' => 4_194_304,
|
63
|
+
'content_type' => 'application/octet-stream',
|
64
|
+
'content_encoding' => nil,
|
65
|
+
'content_language' => nil,
|
66
|
+
'content_disposition' => nil,
|
67
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
68
|
+
'cache_control' => nil,
|
69
|
+
'sequence_number' => 0,
|
70
|
+
'blob_type' => 'PageBlob',
|
71
|
+
'copy_id' => '095adc3b-e277-4c3d-97e0-0abca881f60c',
|
72
|
+
'copy_status' => 'success',
|
73
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/test_container/test_blob?snapshot=2016-02-04T08%3A35%3A50.3256874Z',
|
74
|
+
'copy_progress' => '4194304/4194304',
|
75
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:35:52 GMT',
|
76
|
+
'copy_status_description' => nil,
|
77
|
+
'accept_ranges' => 0
|
78
|
+
}
|
79
|
+
},
|
80
|
+
{
|
81
|
+
'name' => 'test_blob2',
|
82
|
+
'metadata' => {},
|
83
|
+
'properties' => {
|
84
|
+
'last_modified' => 'Tue, 04 Aug 2015 06:02:08 GMT',
|
85
|
+
'etag' => '"0x8D29C92173526C8"',
|
86
|
+
'lease_status' => 'unlocked',
|
87
|
+
'lease_state' => 'available',
|
88
|
+
'content_length' => 4_194_304,
|
89
|
+
'content_type' => 'application/octet-stream',
|
90
|
+
'content_encoding' => nil,
|
91
|
+
'content_language' => nil,
|
92
|
+
'content_disposition' => nil,
|
93
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
94
|
+
'cache_control' => nil,
|
95
|
+
'sequence_number' => 0,
|
96
|
+
'blob_type' => 'PageBlob',
|
97
|
+
'copy_id' => '0abcdc3b-4c3d-e277-97e0-0abca881f60c',
|
98
|
+
'copy_status' => 'success',
|
99
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/test_container/test_blob?snapshot=2016-02-04T08%3A35%3A55.3157696Z',
|
100
|
+
'copy_progress' => '4194304/4194304',
|
101
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:40:52 GMT',
|
102
|
+
'copy_status_description' => nil,
|
103
|
+
'accept_ranges' => 0
|
104
|
+
}
|
105
|
+
},
|
106
|
+
{
|
107
|
+
'name' => 'test_blob3',
|
108
|
+
'metadata' => {},
|
109
|
+
'properties' => {
|
110
|
+
'last_modified' => 'Tue, 04 Aug 2015 06:02:08 GMT',
|
111
|
+
'etag' => '"0x8D29C92173526C8"',
|
112
|
+
'lease_status' => 'unlocked',
|
113
|
+
'lease_state' => 'available',
|
114
|
+
'content_length' => 4_194_304,
|
115
|
+
'content_type' => 'application/octet-stream',
|
116
|
+
'content_encoding' => nil,
|
117
|
+
'content_language' => nil,
|
118
|
+
'content_disposition' => nil,
|
119
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
120
|
+
'cache_control' => nil,
|
121
|
+
'sequence_number' => 0,
|
122
|
+
'blob_type' => 'PageBlob',
|
123
|
+
'copy_id' => '0abcdc3b-4c3d-e277-97e0-0abca881f60c',
|
124
|
+
'copy_status' => 'success',
|
125
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/test_container/test_blob?snapshot=2016-02-04T08%3A35%3A55.3157696Z',
|
126
|
+
'copy_progress' => '4194304/4194304',
|
127
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:40:52 GMT',
|
128
|
+
'copy_status_description' => nil,
|
129
|
+
'accept_ranges' => 0
|
130
|
+
}
|
131
|
+
},
|
132
|
+
{
|
133
|
+
'name' => 'test_blob4',
|
134
|
+
'metadata' => {},
|
135
|
+
'properties' => {
|
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/test_container/test_blob?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
|
+
}
|
158
|
+
]
|
159
|
+
}
|
160
|
+
end
|
161
|
+
|
162
|
+
def self.container
|
163
|
+
{
|
164
|
+
'name' => 'test_container',
|
165
|
+
'public_access_level' => 'container',
|
166
|
+
'metadata' => {
|
167
|
+
'key1' => 'value1',
|
168
|
+
'key2' => 'value2'
|
169
|
+
},
|
170
|
+
'properties' => {
|
171
|
+
'last_modified' => 'Tue, 04 Aug 2015 06:01:08 GMT',
|
172
|
+
'etag' => '"0x8D29C92176C8352"',
|
173
|
+
'lease_status' => 'unlocked',
|
174
|
+
'lease_state' => 'available'
|
175
|
+
}
|
176
|
+
}
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Requests
|
3
|
+
module Storage
|
4
|
+
# Mock class for Deployment Requests
|
5
|
+
# Below data should be as same as those in Mock classes in lib/fog/azurerm/requests/storage/*.rb
|
6
|
+
class Directory
|
7
|
+
def self.container
|
8
|
+
{
|
9
|
+
'name' => 'test_container',
|
10
|
+
'public_access_level' => nil,
|
11
|
+
'metadata' => {},
|
12
|
+
'properties' => {
|
13
|
+
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
14
|
+
'etag' => '0x8D3A3B5F017F52D',
|
15
|
+
'lease_status' => 'unlocked',
|
16
|
+
'lease_state' => 'available'
|
17
|
+
}
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.container_lease_id
|
22
|
+
{ 'leaseId' => 'abc123' }
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.container_object
|
26
|
+
container = Azure::Storage::Blob::Container::Container.new
|
27
|
+
container.public_access_level = 'container'
|
28
|
+
container
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.raw_container_acl
|
32
|
+
[container_object, {}]
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.container_acl
|
36
|
+
[container_object.public_access_level, {}]
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.container_https_url
|
40
|
+
'https://sa.blob.core.windows.net/test_container?comp=list&restype=container'
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.container_metadata
|
44
|
+
{
|
45
|
+
'created-by' => 'User',
|
46
|
+
'source-machine' => 'Test-machine',
|
47
|
+
'category' => 'guidance',
|
48
|
+
'doctype' => 'textDocuments'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.container_list
|
53
|
+
[
|
54
|
+
{
|
55
|
+
'name' => 'test_container1',
|
56
|
+
'metadata' => {},
|
57
|
+
'properties' => {
|
58
|
+
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
59
|
+
'etag' => '0x8D3A3B5F017F52D',
|
60
|
+
'lease_status' => 'unlocked',
|
61
|
+
'lease_state' => 'available'
|
62
|
+
}
|
63
|
+
},
|
64
|
+
{
|
65
|
+
'name' => 'test_container2',
|
66
|
+
'metadata' => {},
|
67
|
+
'properties' => {
|
68
|
+
'last_modified' => 'Tue, 04 Aug 2015 06:01:08 GMT',
|
69
|
+
'etag' => '0x8D29C92176C8352',
|
70
|
+
'lease_status' => 'unlocked',
|
71
|
+
'lease_state' => 'available'
|
72
|
+
}
|
73
|
+
},
|
74
|
+
{
|
75
|
+
'name' => 'test_container3',
|
76
|
+
'metadata' => {},
|
77
|
+
'properties' => {
|
78
|
+
'last_modified' => 'Tue, 01 Sep 2015 05:15:36 GMT',
|
79
|
+
'etag' => '0x8D2B28C5EB36458',
|
80
|
+
'lease_status' => 'unlocked',
|
81
|
+
'lease_state' => 'available'
|
82
|
+
}
|
83
|
+
}
|
84
|
+
]
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,252 @@
|
|
1
|
+
module ApiStub
|
2
|
+
module Requests
|
3
|
+
module Storage
|
4
|
+
# Mock class for Deployment Requests
|
5
|
+
# Below data should be as same as those in Mock classes in lib/fog/azurerm/requests/storage/*.rb
|
6
|
+
class File
|
7
|
+
def self.blob
|
8
|
+
blob_data = blob_as_hash
|
9
|
+
blob = Azure::Storage::Blob::Blob.new
|
10
|
+
blob.name = blob_data['name']
|
11
|
+
blob.metadata = blob_data['metadata']
|
12
|
+
blob.properties = blob_data['properties'].map { |k, v| { k.to_sym => v } }.reduce({}, &:merge!)
|
13
|
+
blob
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.blob_as_hash
|
17
|
+
{
|
18
|
+
'name' => 'test_blob',
|
19
|
+
'metadata' => {},
|
20
|
+
'properties' => {
|
21
|
+
'last_modified' => 'Mon, 04 Jul 2016 09:30:31 GMT',
|
22
|
+
'etag' => '0x8D3A3EDD7C2B777',
|
23
|
+
'lease_status' => 'unlocked',
|
24
|
+
'lease_state' => 'available',
|
25
|
+
'lease_duration' => nil,
|
26
|
+
'content_length' => 4_194_304,
|
27
|
+
'content_type' => 'application/octet-stream',
|
28
|
+
'content_encoding' => nil,
|
29
|
+
'content_language' => nil,
|
30
|
+
'content_disposition' => nil,
|
31
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
32
|
+
'cache_control' => nil,
|
33
|
+
'sequence_number' => 0,
|
34
|
+
'blob_type' => 'PageBlob',
|
35
|
+
'copy_id' => '095adc3b-e277-4c3d-97e0-0abca881f60c',
|
36
|
+
'copy_status' => 'success',
|
37
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/testblob/4m?snapshot=2016-02-04T08%3A35%3A50.3157696Z',
|
38
|
+
'copy_progress' => '4194304/4194304',
|
39
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:35:52 GMT',
|
40
|
+
'copy_status_description' => nil,
|
41
|
+
'accept_ranges' => 0
|
42
|
+
}
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.blob_https_url(environment = ENVIRONMENT_AZURE_CLOUD)
|
47
|
+
case environment
|
48
|
+
when ENVIRONMENT_AZURE_CHINA_CLOUD
|
49
|
+
'https://sa.blob.core.chinacloudapi.cn/test_container/test_blob'
|
50
|
+
when ENVIRONMENT_AZURE_US_GOVERNMENT
|
51
|
+
'https://sa.blob.core.usgovcloudapi.net/test_container/test_blob'
|
52
|
+
when ENVIRONMENT_AZURE_GERMAN_CLOUD
|
53
|
+
'https://sa.blob.core.cloudapi.de/test_container/test_blob'
|
54
|
+
else
|
55
|
+
'https://sa.blob.core.windows.net/test_container/test_blob'
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.blob_url_token
|
60
|
+
'token'
|
61
|
+
end
|
62
|
+
|
63
|
+
def self.blob_lease_id
|
64
|
+
{
|
65
|
+
'leaseId' => 'abc123'
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.blob_metadata
|
70
|
+
{
|
71
|
+
'created-by' => 'User',
|
72
|
+
'source-machine' => 'Test-machine',
|
73
|
+
'category' => 'guidance',
|
74
|
+
'doctype' => 'textDocuments'
|
75
|
+
}
|
76
|
+
end
|
77
|
+
|
78
|
+
def self.blob_copy_result
|
79
|
+
# copy_id, copy_status
|
80
|
+
%w(abc123 pending)
|
81
|
+
end
|
82
|
+
|
83
|
+
def self.block_blob
|
84
|
+
{
|
85
|
+
'name' => 'test_blob',
|
86
|
+
'metadata' => {},
|
87
|
+
'properties' => {
|
88
|
+
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
89
|
+
'etag' => '0x8D3A3B5F017F52D',
|
90
|
+
'lease_status' => 'unlocked',
|
91
|
+
'lease_state' => 'available',
|
92
|
+
'content_length' => 4_194_304,
|
93
|
+
'content_type' => 'application/octet-stream',
|
94
|
+
'content_encoding' => nil,
|
95
|
+
'content_language' => nil,
|
96
|
+
'content_disposition' => nil,
|
97
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
98
|
+
'cache_control' => nil,
|
99
|
+
'sequence_number' => 0,
|
100
|
+
'blob_type' => 'BlockBlob',
|
101
|
+
'copy_id' => '095adc3b-e277-4c3d-97e0-0abca881f60c',
|
102
|
+
'copy_status' => 'success',
|
103
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/test_container/test_blob?snapshot=2016-02-04T08%3A35%3A50.3256874Z',
|
104
|
+
'copy_progress' => '4194304/4194304',
|
105
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:35:52 GMT',
|
106
|
+
'copy_status_description' => nil,
|
107
|
+
'accept_ranges' => 0
|
108
|
+
}
|
109
|
+
}
|
110
|
+
end
|
111
|
+
|
112
|
+
def self.emtpy_block_blob
|
113
|
+
{
|
114
|
+
'name' => 'test_blob',
|
115
|
+
'metadata' => {},
|
116
|
+
'properties' => {
|
117
|
+
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
118
|
+
'etag' => '0x8D3A3B5F017F52D',
|
119
|
+
'lease_status' => nil,
|
120
|
+
'lease_state' => nil,
|
121
|
+
'content_length' => 0,
|
122
|
+
'content_type' => 'application/octet-stream',
|
123
|
+
'content_encoding' => nil,
|
124
|
+
'content_language' => nil,
|
125
|
+
'content_disposition' => nil,
|
126
|
+
'content_md5' => nil,
|
127
|
+
'cache_control' => nil,
|
128
|
+
'sequence_number' => 0,
|
129
|
+
'blob_type' => 'BlockBlob',
|
130
|
+
'copy_id' => nil,
|
131
|
+
'copy_status' => nil,
|
132
|
+
'copy_source' => nil,
|
133
|
+
'copy_progress' => nil,
|
134
|
+
'copy_completion_time' => nil,
|
135
|
+
'copy_status_description' => nil,
|
136
|
+
'accept_ranges' => 0
|
137
|
+
}
|
138
|
+
}
|
139
|
+
end
|
140
|
+
|
141
|
+
def self.blob_list
|
142
|
+
[
|
143
|
+
{
|
144
|
+
'name' => 'test_blob1',
|
145
|
+
'metadata' => {},
|
146
|
+
'properties' => {
|
147
|
+
'last_modified' => 'Mon, 04 Jul 2016 02:50:20 GMT',
|
148
|
+
'etag' => '0x8D3A3B5F017F52D',
|
149
|
+
'lease_status' => 'unlocked',
|
150
|
+
'lease_state' => 'available',
|
151
|
+
'content_length' => 4_194_304,
|
152
|
+
'content_type' => 'application/octet-stream',
|
153
|
+
'content_encoding' => nil,
|
154
|
+
'content_language' => nil,
|
155
|
+
'content_disposition' => nil,
|
156
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
157
|
+
'cache_control' => nil,
|
158
|
+
'sequence_number' => 0,
|
159
|
+
'blob_type' => 'PageBlob',
|
160
|
+
'copy_id' => '095adc3b-e277-4c3d-97e0-0abca881f60c',
|
161
|
+
'copy_status' => 'success',
|
162
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/test_container/test_blob?snapshot=2016-02-04T08%3A35%3A50.3256874Z',
|
163
|
+
'copy_progress' => '4194304/4194304',
|
164
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:35:52 GMT',
|
165
|
+
'copy_status_description' => nil,
|
166
|
+
'accept_ranges' => 0
|
167
|
+
}
|
168
|
+
},
|
169
|
+
{
|
170
|
+
'name' => 'test_blob2',
|
171
|
+
'metadata' => {},
|
172
|
+
'properties' => {
|
173
|
+
'last_modified' => 'Tue, 04 Aug 2015 06:02:08 GMT',
|
174
|
+
'etag' => '0x8D29C92173526C8',
|
175
|
+
'lease_status' => 'unlocked',
|
176
|
+
'lease_state' => 'available',
|
177
|
+
'content_length' => 4_194_304,
|
178
|
+
'content_type' => 'application/octet-stream',
|
179
|
+
'content_encoding' => nil,
|
180
|
+
'content_language' => nil,
|
181
|
+
'content_disposition' => nil,
|
182
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
183
|
+
'cache_control' => nil,
|
184
|
+
'sequence_number' => 0,
|
185
|
+
'blob_type' => 'PageBlob',
|
186
|
+
'copy_id' => '0abcdc3b-4c3d-e277-97e0-0abca881f60c',
|
187
|
+
'copy_status' => 'success',
|
188
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/test_container/test_blob?snapshot=2016-02-04T08%3A35%3A55.3157696Z',
|
189
|
+
'copy_progress' => '4194304/4194304',
|
190
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:40:52 GMT',
|
191
|
+
'copy_status_description' => nil,
|
192
|
+
'accept_ranges' => 0
|
193
|
+
}
|
194
|
+
},
|
195
|
+
{
|
196
|
+
'name' => 'test_blob3',
|
197
|
+
'metadata' => {},
|
198
|
+
'properties' => {
|
199
|
+
'last_modified' => 'Tue, 04 Aug 2015 06:02:08 GMT',
|
200
|
+
'etag' => '0x8D29C92173526C8',
|
201
|
+
'lease_status' => 'unlocked',
|
202
|
+
'lease_state' => 'available',
|
203
|
+
'content_length' => 4_194_304,
|
204
|
+
'content_type' => 'application/octet-stream',
|
205
|
+
'content_encoding' => nil,
|
206
|
+
'content_language' => nil,
|
207
|
+
'content_disposition' => nil,
|
208
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
209
|
+
'cache_control' => nil,
|
210
|
+
'sequence_number' => 0,
|
211
|
+
'blob_type' => 'PageBlob',
|
212
|
+
'copy_id' => '0abcdc3b-4c3d-e277-97e0-0abca881f60c',
|
213
|
+
'copy_status' => 'success',
|
214
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/test_container/test_blob?snapshot=2016-02-04T08%3A35%3A55.3157696Z',
|
215
|
+
'copy_progress' => '4194304/4194304',
|
216
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:40:52 GMT',
|
217
|
+
'copy_status_description' => nil,
|
218
|
+
'accept_ranges' => 0
|
219
|
+
}
|
220
|
+
},
|
221
|
+
{
|
222
|
+
'name' => 'test_blob4',
|
223
|
+
'metadata' => {},
|
224
|
+
'properties' => {
|
225
|
+
'last_modified' => 'Tue, 04 Aug 2015 06:02:08 GMT',
|
226
|
+
'etag' => '0x8D29C92173526C8',
|
227
|
+
'lease_status' => 'unlocked',
|
228
|
+
'lease_state' => 'available',
|
229
|
+
'content_length' => 4_194_304,
|
230
|
+
'content_type' => 'application/octet-stream',
|
231
|
+
'content_encoding' => nil,
|
232
|
+
'content_language' => nil,
|
233
|
+
'content_disposition' => nil,
|
234
|
+
'content_md5' => 'tXAohIyxuu/t94Lp/ujeRw==',
|
235
|
+
'cache_control' => nil,
|
236
|
+
'sequence_number' => 0,
|
237
|
+
'blob_type' => 'PageBlob',
|
238
|
+
'copy_id' => '0abcdc3b-4c3d-e277-97e0-0abca881f60c',
|
239
|
+
'copy_status' => 'success',
|
240
|
+
'copy_source' => 'https://testaccount.blob.core.windows.net/test_container/test_blob?snapshot=2016-02-04T08%3A35%3A55.3157696Z',
|
241
|
+
'copy_progress' => '4194304/4194304',
|
242
|
+
'copy_completion_time' => 'Thu, 04 Feb 2016 08:40:52 GMT',
|
243
|
+
'copy_status_description' => nil,
|
244
|
+
'accept_ranges' => 0
|
245
|
+
}
|
246
|
+
}
|
247
|
+
]
|
248
|
+
end
|
249
|
+
end
|
250
|
+
end
|
251
|
+
end
|
252
|
+
end
|