miasma 0.2.16 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/miasma/models/storage.rb +2 -2
- data/lib/miasma/types/api.rb +32 -25
- data/lib/miasma/version.rb +1 -1
- data/miasma.gemspec +1 -1
- data/test/spec.rb +20 -0
- data/test/specs/cassettes/aws_buckets_all.yml +45 -0
- data/test/specs/cassettes/aws_load_balancer_balancer_after_destroy.yml +85 -0
- data/test/specs/cassettes/aws_load_balancer_balancer_before_create.yml +271 -0
- data/test/specs/cassettes/aws_load_balancer_balancer_direct_fetch.yml +89 -0
- data/test/specs/cassettes/aws_load_balancer_balancers_all.yml +45 -0
- data/test/specs/cassettes/aws_server_after_destroy.yml +155 -0
- data/test/specs/cassettes/aws_server_before_create.yml +470 -0
- data/test/specs/cassettes/aws_servers_all.yml +44 -0
- data/test/specs/cassettes/aws_servers_create.yml +824 -0
- data/test/specs/cassettes/aws_stack_create.yml +603 -0
- data/test/specs/cassettes/aws_stacks_after_destroy.yml +148 -0
- data/test/specs/cassettes/aws_stacks_all.yml +99 -0
- data/test/specs/cassettes/aws_stacks_before_create.yml +300 -0
- data/test/specs/cassettes/aws_stacks_direct_fetch.yml +108 -0
- data/test/specs/cassettes/aws_storage_bucket.yml +429 -0
- data/test/specs/cassettes/open_stack_server_after_destroy.yml +83 -0
- data/test/specs/cassettes/open_stack_server_before_create.yml +138 -0
- data/test/specs/cassettes/open_stack_servers_all.yml +34 -0
- data/test/specs/cassettes/open_stack_servers_create.yml +296 -0
- data/test/specs/cassettes/open_stack_stack_create.yml +338 -0
- data/test/specs/cassettes/open_stack_stacks_after_destroy.yml +73 -0
- data/test/specs/cassettes/open_stack_stacks_all.yml +34 -0
- data/test/specs/cassettes/open_stack_stacks_before_create.yml +227 -0
- data/test/specs/cassettes/open_stack_stacks_direct_fetch.yml +39 -0
- data/test/specs/cassettes/rackspace_identity_seed.yml +38 -0
- data/test/specs/cassettes/rackspace_server_after_destroy.yml +88 -0
- data/test/specs/cassettes/rackspace_server_before_create.yml +143 -0
- data/test/specs/cassettes/rackspace_servers_create.yml +313 -0
- data/test/specs/cassettes/rackspace_stack_create.yml +289 -0
- data/test/specs/cassettes/rackspace_stacks_after_destroy.yml +79 -0
- data/test/specs/cassettes/rackspace_stacks_all.yml +81 -0
- data/test/specs/cassettes/rackspace_stacks_before_create.yml +211 -0
- data/test/specs/cassettes/rackspace_stacks_direct_fetch.yml +38 -0
- data/test/specs/miasma_spec.rb +33 -0
- data/test/specs/models/compute_abstract.rb +118 -0
- data/test/specs/models/load_balancer_abstract.rb +88 -0
- data/test/specs/models/orchestration_abstract.rb +123 -0
- data/test/specs/models/storage_abstract.rb +120 -0
- data/test/specs/utils/animal_strings_spec.rb +15 -0
- data/test/specs/utils/memoization_spec.rb +83 -0
- data/test/specs/utils/smash_spec.rb +107 -0
- metadata +44 -2
@@ -0,0 +1,211 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://identity.api.rackspacecloud.com/v2.0/tokens
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"auth":{"RAX-KSKEY:apiKeyCredentials":{"apiKey":"8d41a2fa696746218586f321b7b804fe","username":"miasma-test"}}}'
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Host:
|
13
|
+
- identity.api.rackspacecloud.com
|
14
|
+
User-Agent:
|
15
|
+
- RubyHTTPGem/0.6.3
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- nginx
|
23
|
+
Date:
|
24
|
+
- Mon, 24 Nov 2014 13:48:28 GMT
|
25
|
+
Content-Type:
|
26
|
+
- application/json
|
27
|
+
Transfer-Encoding:
|
28
|
+
- chunked
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
X-Newrelic-App-Data:
|
32
|
+
- PxQGUF9aDwETVlhSBQgFVUYdFGQHBDcQUQxLA1tMXV1dORYzVBJHNQFUZAQUFVFQVThOFlhaUggXER5jLTU3SxJOCEwIFAQcA1INUgNZH09VGhUAU1YAAwUHUlVVU1QCUgUUbg==
|
33
|
+
Vary:
|
34
|
+
- Accept, Accept-Encoding, X-Auth-Token
|
35
|
+
Front-End-Https:
|
36
|
+
- 'on'
|
37
|
+
body:
|
38
|
+
encoding: UTF-8
|
39
|
+
string: '{"access":{"token":{"id":"015c96cbf67f48298525376a555ce24d","expires":"2014-11-24T18:39:00.738Z","tenant":{"id":"891853","name":"891853"},"RAX-AUTH:authenticatedBy":["APIKEY"]},"serviceCatalog":[{"name":"cloudFilesCDN","endpoints":[{"region":"IAD","tenantId":"MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","publicURL":"https:\/\/cdn5.clouddrive.com\/v1\/MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36"},{"region":"SYD","tenantId":"MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","publicURL":"https:\/\/cdn4.clouddrive.com\/v1\/MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36"},{"region":"DFW","tenantId":"MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","publicURL":"https:\/\/cdn1.clouddrive.com\/v1\/MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36"},{"region":"HKG","tenantId":"MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","publicURL":"https:\/\/cdn6.clouddrive.com\/v1\/MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36"},{"region":"ORD","tenantId":"MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","publicURL":"https:\/\/cdn2.clouddrive.com\/v1\/MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36"}],"type":"rax:object-cdn"},{"name":"cloudFiles","endpoints":[{"region":"IAD","tenantId":"MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","publicURL":"https:\/\/storage101.iad3.clouddrive.com\/v1\/MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","internalURL":"https:\/\/snet-storage101.iad3.clouddrive.com\/v1\/MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36"},{"region":"SYD","tenantId":"MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","publicURL":"https:\/\/storage101.syd2.clouddrive.com\/v1\/MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","internalURL":"https:\/\/snet-storage101.syd2.clouddrive.com\/v1\/MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36"},{"region":"DFW","tenantId":"MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","publicURL":"https:\/\/storage101.dfw1.clouddrive.com\/v1\/MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","internalURL":"https:\/\/snet-storage101.dfw1.clouddrive.com\/v1\/MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36"},{"region":"ORD","tenantId":"MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","publicURL":"https:\/\/storage101.ord1.clouddrive.com\/v1\/MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","internalURL":"https:\/\/snet-storage101.ord1.clouddrive.com\/v1\/MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36"},{"region":"HKG","tenantId":"MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","publicURL":"https:\/\/storage101.hkg1.clouddrive.com\/v1\/MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","internalURL":"https:\/\/snet-storage101.hkg1.clouddrive.com\/v1\/MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36"}],"type":"object-store"},{"name":"cloudBlockStorage","endpoints":[{"region":"DFW","tenantId":"891853","publicURL":"https:\/\/dfw.blockstorage.api.rackspacecloud.com\/v1\/891853"},{"region":"ORD","tenantId":"891853","publicURL":"https:\/\/ord.blockstorage.api.rackspacecloud.com\/v1\/891853"},{"region":"SYD","tenantId":"891853","publicURL":"https:\/\/syd.blockstorage.api.rackspacecloud.com\/v1\/891853"},{"region":"IAD","tenantId":"891853","publicURL":"https:\/\/iad.blockstorage.api.rackspacecloud.com\/v1\/891853"},{"region":"HKG","tenantId":"891853","publicURL":"https:\/\/hkg.blockstorage.api.rackspacecloud.com\/v1\/891853"}],"type":"volume"},{"name":"cloudImages","endpoints":[{"region":"IAD","tenantId":"891853","publicURL":"https:\/\/iad.images.api.rackspacecloud.com\/v2"},{"region":"ORD","tenantId":"891853","publicURL":"https:\/\/ord.images.api.rackspacecloud.com\/v2"},{"region":"HKG","tenantId":"891853","publicURL":"https:\/\/hkg.images.api.rackspacecloud.com\/v2"},{"region":"DFW","tenantId":"891853","publicURL":"https:\/\/dfw.images.api.rackspacecloud.com\/v2"},{"region":"SYD","tenantId":"891853","publicURL":"https:\/\/syd.images.api.rackspacecloud.com\/v2"}],"type":"image"},{"name":"cloudQueues","endpoints":[{"region":"HKG","tenantId":"891853","publicURL":"https:\/\/hkg.queues.api.rackspacecloud.com\/v1\/891853","internalURL":"https:\/\/snet-hkg.queues.api.rackspacecloud.com\/v1\/891853"},{"region":"ORD","tenantId":"891853","publicURL":"https:\/\/ord.queues.api.rackspacecloud.com\/v1\/891853","internalURL":"https:\/\/snet-ord.queues.api.rackspacecloud.com\/v1\/891853"},{"region":"SYD","tenantId":"891853","publicURL":"https:\/\/syd.queues.api.rackspacecloud.com\/v1\/891853","internalURL":"https:\/\/snet-syd.queues.api.rackspacecloud.com\/v1\/891853"},{"region":"DFW","tenantId":"891853","publicURL":"https:\/\/dfw.queues.api.rackspacecloud.com\/v1\/891853","internalURL":"https:\/\/snet-dfw.queues.api.rackspacecloud.com\/v1\/891853"},{"region":"IAD","tenantId":"891853","publicURL":"https:\/\/iad.queues.api.rackspacecloud.com\/v1\/891853","internalURL":"https:\/\/snet-iad.queues.api.rackspacecloud.com\/v1\/891853"}],"type":"rax:queues"},{"name":"cloudBigData","endpoints":[{"region":"IAD","tenantId":"891853","publicURL":"https:\/\/iad.bigdata.api.rackspacecloud.com\/v1.0\/891853"},{"region":"DFW","tenantId":"891853","publicURL":"https:\/\/dfw.bigdata.api.rackspacecloud.com\/v1.0\/891853"},{"region":"ORD","tenantId":"891853","publicURL":"https:\/\/ord.bigdata.api.rackspacecloud.com\/v1.0\/891853"}],"type":"rax:bigdata"},{"name":"cloudOrchestration","endpoints":[{"region":"HKG","tenantId":"891853","publicURL":"https:\/\/hkg.orchestration.api.rackspacecloud.com\/v1\/891853"},{"region":"DFW","tenantId":"891853","publicURL":"https:\/\/dfw.orchestration.api.rackspacecloud.com\/v1\/891853"},{"region":"ORD","tenantId":"891853","publicURL":"https:\/\/ord.orchestration.api.rackspacecloud.com\/v1\/891853"},{"region":"IAD","tenantId":"891853","publicURL":"https:\/\/iad.orchestration.api.rackspacecloud.com\/v1\/891853"},{"region":"SYD","tenantId":"891853","publicURL":"https:\/\/syd.orchestration.api.rackspacecloud.com\/v1\/891853"}],"type":"orchestration"},{"name":"cloudServersOpenStack","endpoints":[{"region":"IAD","tenantId":"891853","publicURL":"https:\/\/iad.servers.api.rackspacecloud.com\/v2\/891853","versionInfo":"https:\/\/iad.servers.api.rackspacecloud.com\/v2","versionList":"https:\/\/iad.servers.api.rackspacecloud.com\/","versionId":"2"},{"region":"DFW","tenantId":"891853","publicURL":"https:\/\/dfw.servers.api.rackspacecloud.com\/v2\/891853","versionInfo":"https:\/\/dfw.servers.api.rackspacecloud.com\/v2","versionList":"https:\/\/dfw.servers.api.rackspacecloud.com\/","versionId":"2"},{"region":"SYD","tenantId":"891853","publicURL":"https:\/\/syd.servers.api.rackspacecloud.com\/v2\/891853","versionInfo":"https:\/\/syd.servers.api.rackspacecloud.com\/v2","versionList":"https:\/\/syd.servers.api.rackspacecloud.com\/","versionId":"2"},{"region":"HKG","tenantId":"891853","publicURL":"https:\/\/hkg.servers.api.rackspacecloud.com\/v2\/891853","versionInfo":"https:\/\/hkg.servers.api.rackspacecloud.com\/v2","versionList":"https:\/\/hkg.servers.api.rackspacecloud.com\/","versionId":"2"},{"region":"ORD","tenantId":"891853","publicURL":"https:\/\/ord.servers.api.rackspacecloud.com\/v2\/891853","versionInfo":"https:\/\/ord.servers.api.rackspacecloud.com\/v2","versionList":"https:\/\/ord.servers.api.rackspacecloud.com\/","versionId":"2"}],"type":"compute"},{"name":"autoscale","endpoints":[{"region":"ORD","tenantId":"891853","publicURL":"https:\/\/ord.autoscale.api.rackspacecloud.com\/v1.0\/891853"},{"region":"DFW","tenantId":"891853","publicURL":"https:\/\/dfw.autoscale.api.rackspacecloud.com\/v1.0\/891853"},{"region":"HKG","tenantId":"891853","publicURL":"https:\/\/hkg.autoscale.api.rackspacecloud.com\/v1.0\/891853"},{"region":"IAD","tenantId":"891853","publicURL":"https:\/\/iad.autoscale.api.rackspacecloud.com\/v1.0\/891853"},{"region":"SYD","tenantId":"891853","publicURL":"https:\/\/syd.autoscale.api.rackspacecloud.com\/v1.0\/891853"}],"type":"rax:autoscale"},{"name":"cloudDatabases","endpoints":[{"region":"DFW","tenantId":"891853","publicURL":"https:\/\/dfw.databases.api.rackspacecloud.com\/v1.0\/891853"},{"region":"ORD","tenantId":"891853","publicURL":"https:\/\/ord.databases.api.rackspacecloud.com\/v1.0\/891853"},{"region":"IAD","tenantId":"891853","publicURL":"https:\/\/iad.databases.api.rackspacecloud.com\/v1.0\/891853"},{"region":"HKG","tenantId":"891853","publicURL":"https:\/\/hkg.databases.api.rackspacecloud.com\/v1.0\/891853"},{"region":"SYD","tenantId":"891853","publicURL":"https:\/\/syd.databases.api.rackspacecloud.com\/v1.0\/891853"}],"type":"rax:database"},{"name":"cloudBackup","endpoints":[{"region":"IAD","tenantId":"891853","publicURL":"https:\/\/iad.backup.api.rackspacecloud.com\/v1.0\/891853"},{"region":"HKG","tenantId":"891853","publicURL":"https:\/\/hkg.backup.api.rackspacecloud.com\/v1.0\/891853"},{"region":"SYD","tenantId":"891853","publicURL":"https:\/\/syd.backup.api.rackspacecloud.com\/v1.0\/891853"},{"region":"DFW","tenantId":"891853","publicURL":"https:\/\/dfw.backup.api.rackspacecloud.com\/v1.0\/891853"},{"region":"ORD","tenantId":"891853","publicURL":"https:\/\/ord.backup.api.rackspacecloud.com\/v1.0\/891853"}],"type":"rax:backup"},{"name":"cloudMetrics","endpoints":[{"region":"IAD","tenantId":"891853","publicURL":"https:\/\/global.metrics.api.rackspacecloud.com\/v2.0\/891853"}],"type":"rax:cloudmetrics"},{"name":"cloudLoadBalancers","endpoints":[{"region":"IAD","tenantId":"891853","publicURL":"https:\/\/iad.loadbalancers.api.rackspacecloud.com\/v1.0\/891853"},{"region":"ORD","tenantId":"891853","publicURL":"https:\/\/ord.loadbalancers.api.rackspacecloud.com\/v1.0\/891853"},{"region":"HKG","tenantId":"891853","publicURL":"https:\/\/hkg.loadbalancers.api.rackspacecloud.com\/v1.0\/891853"},{"region":"DFW","tenantId":"891853","publicURL":"https:\/\/dfw.loadbalancers.api.rackspacecloud.com\/v1.0\/891853"},{"region":"SYD","tenantId":"891853","publicURL":"https:\/\/syd.loadbalancers.api.rackspacecloud.com\/v1.0\/891853"}],"type":"rax:load-balancer"},{"name":"cloudNetworks","endpoints":[{"region":"ORD","tenantId":"891853","publicURL":"https:\/\/ord.networks.api.rackspacecloud.com\/v2.0"}],"type":"network"},{"name":"cloudFeeds","endpoints":[{"region":"HKG","tenantId":"891853","publicURL":"https:\/\/hkg.feeds.api.rackspacecloud.com\/891853","internalURL":"https:\/\/atom.prod.hkg1.us.ci.rackspace.net\/891853"},{"region":"SYD","tenantId":"891853","publicURL":"https:\/\/syd.feeds.api.rackspacecloud.com\/891853","internalURL":"https:\/\/atom.prod.syd2.us.ci.rackspace.net\/891853"},{"region":"IAD","tenantId":"891853","publicURL":"https:\/\/iad.feeds.api.rackspacecloud.com\/891853","internalURL":"https:\/\/atom.prod.iad3.us.ci.rackspace.net\/891853"},{"region":"DFW","tenantId":"891853","publicURL":"https:\/\/dfw.feeds.api.rackspacecloud.com\/891853","internalURL":"https:\/\/atom.prod.dfw1.us.ci.rackspace.net\/891853"},{"region":"ORD","tenantId":"891853","publicURL":"https:\/\/ord.feeds.api.rackspacecloud.com\/891853","internalURL":"https:\/\/atom.prod.ord1.us.ci.rackspace.net\/891853"}],"type":"rax:feeds"},{"name":"cloudMonitoring","endpoints":[{"tenantId":"891853","publicURL":"https:\/\/monitoring.api.rackspacecloud.com\/v1.0\/891853"}],"type":"rax:monitor"},{"name":"cloudDNS","endpoints":[{"tenantId":"891853","publicURL":"https:\/\/dns.api.rackspacecloud.com\/v1.0\/891853"}],"type":"rax:dns"}],"user":{"id":"56c76a224ef344e2854701cc7c675cc3","roles":[{"id":"10000258","description":"Full
|
40
|
+
Access Admin Role for Account User","name":"admin"},{"tenantId":"891853","id":"6","description":"A
|
41
|
+
Role that allows a user access to keystone Service methods","name":"compute:default"},{"tenantId":"MossoCloudFS_812ab800-37a5-437b-9e11-679c4b538f36","id":"5","description":"A
|
42
|
+
Role that allows a user access to keystone Service methods","name":"object-store:default"},{"id":"2","description":"Default
|
43
|
+
Role.","name":"identity:default"}],"name":"miasma-test","RAX-AUTH:defaultRegion":"IAD"}}}'
|
44
|
+
http_version:
|
45
|
+
recorded_at: Mon, 24 Nov 2014 13:48:27 GMT
|
46
|
+
- request:
|
47
|
+
method: post
|
48
|
+
uri: https://hkg.orchestration.api.rackspacecloud.com/v1/891853/stacks
|
49
|
+
body:
|
50
|
+
encoding: UTF-8
|
51
|
+
string: '{"disable_rollback":"false","parameters":{},"stack_name":"miasma-test-stack","template":"{\"heat_template_version\":\"2013-05-23\",\"resources\":{\"MiasmaSubNet\":{\"properties\":{\"cidr\":\"192.168.233.0/24\",\"label\":\"miasma
|
52
|
+
auto test network\"},\"type\":\"Rackspace::Cloud::Network\"}}}"}'
|
53
|
+
headers:
|
54
|
+
User-Agent:
|
55
|
+
- miasma/v0.2.1
|
56
|
+
X-Auth-Token:
|
57
|
+
- 015c96cbf67f48298525376a555ce24d
|
58
|
+
Content-Type:
|
59
|
+
- application/json
|
60
|
+
Host:
|
61
|
+
- hkg.orchestration.api.rackspacecloud.com
|
62
|
+
response:
|
63
|
+
status:
|
64
|
+
code: 201
|
65
|
+
message: Created
|
66
|
+
headers:
|
67
|
+
Server:
|
68
|
+
- nginx/1.2.1
|
69
|
+
Date:
|
70
|
+
- Mon, 24 Nov 2014 13:47:29 GMT
|
71
|
+
Content-Type:
|
72
|
+
- application/json
|
73
|
+
Content-Length:
|
74
|
+
- '217'
|
75
|
+
Connection:
|
76
|
+
- keep-alive
|
77
|
+
Location:
|
78
|
+
- https://hkg.orchestration.api.rackspacecloud.com/v1/891853/stacks/miasma-test-stack/c3c2ad32-e697-4b27-9a4f-2d239d634bb4
|
79
|
+
Via:
|
80
|
+
- 1.0 Repose (Repose/6.0.2)
|
81
|
+
body:
|
82
|
+
encoding: UTF-8
|
83
|
+
string: '{"stack": {"id": "c3c2ad32-e697-4b27-9a4f-2d239d634bb4", "links": [{"href":
|
84
|
+
"https://hkg.orchestration.api.rackspacecloud.com/v1/891853/stacks/miasma-test-stack/c3c2ad32-e697-4b27-9a4f-2d239d634bb4",
|
85
|
+
"rel": "self"}]}}'
|
86
|
+
http_version:
|
87
|
+
recorded_at: Mon, 24 Nov 2014 13:48:30 GMT
|
88
|
+
- request:
|
89
|
+
method: get
|
90
|
+
uri: https://hkg.orchestration.api.rackspacecloud.com/v1/891853/stacks/miasma-test-stack/c3c2ad32-e697-4b27-9a4f-2d239d634bb4
|
91
|
+
body:
|
92
|
+
encoding: US-ASCII
|
93
|
+
string: ''
|
94
|
+
headers:
|
95
|
+
User-Agent:
|
96
|
+
- miasma/v0.2.1
|
97
|
+
X-Auth-Token:
|
98
|
+
- 015c96cbf67f48298525376a555ce24d
|
99
|
+
Host:
|
100
|
+
- hkg.orchestration.api.rackspacecloud.com
|
101
|
+
response:
|
102
|
+
status:
|
103
|
+
code: 200
|
104
|
+
message: OK
|
105
|
+
headers:
|
106
|
+
Server:
|
107
|
+
- nginx/1.2.1
|
108
|
+
Date:
|
109
|
+
- Mon, 24 Nov 2014 13:47:16 GMT
|
110
|
+
Content-Type:
|
111
|
+
- application/json; charset=UTF-8
|
112
|
+
Content-Length:
|
113
|
+
- '719'
|
114
|
+
Connection:
|
115
|
+
- keep-alive
|
116
|
+
Via:
|
117
|
+
- 1.0 Repose (Repose/6.0.2)
|
118
|
+
body:
|
119
|
+
encoding: UTF-8
|
120
|
+
string: '{"stack": {"disable_rollback": false, "description": "No description",
|
121
|
+
"parent": null, "stack_status_reason": "Stack CREATE started", "stack_name":
|
122
|
+
"miasma-test-stack", "stack_owner": null, "creation_time": "2014-11-24T13:47:29Z",
|
123
|
+
"links": [{"href": "https://hkg.orchestration.api.rackspacecloud.com/v1/891853/stacks/miasma-test-stack/c3c2ad32-e697-4b27-9a4f-2d239d634bb4",
|
124
|
+
"rel": "self"}], "capabilities": [], "notification_topics": [], "updated_time":
|
125
|
+
null, "timeout_mins": null, "stack_status": "CREATE_IN_PROGRESS", "parameters":
|
126
|
+
{"OS::stack_id": "c3c2ad32-e697-4b27-9a4f-2d239d634bb4", "OS::stack_name":
|
127
|
+
"miasma-test-stack"}, "id": "c3c2ad32-e697-4b27-9a4f-2d239d634bb4", "template_description":
|
128
|
+
"No description"}}'
|
129
|
+
http_version:
|
130
|
+
recorded_at: Mon, 24 Nov 2014 13:48:33 GMT
|
131
|
+
- request:
|
132
|
+
method: get
|
133
|
+
uri: https://hkg.orchestration.api.rackspacecloud.com/v1/891853/stacks/miasma-test-stack/c3c2ad32-e697-4b27-9a4f-2d239d634bb4
|
134
|
+
body:
|
135
|
+
encoding: US-ASCII
|
136
|
+
string: ''
|
137
|
+
headers:
|
138
|
+
User-Agent:
|
139
|
+
- miasma/v0.2.1
|
140
|
+
X-Auth-Token:
|
141
|
+
- 015c96cbf67f48298525376a555ce24d
|
142
|
+
Host:
|
143
|
+
- hkg.orchestration.api.rackspacecloud.com
|
144
|
+
response:
|
145
|
+
status:
|
146
|
+
code: 200
|
147
|
+
message: OK
|
148
|
+
headers:
|
149
|
+
Server:
|
150
|
+
- nginx/1.2.1
|
151
|
+
Date:
|
152
|
+
- Mon, 24 Nov 2014 13:48:33 GMT
|
153
|
+
Content-Type:
|
154
|
+
- application/json; charset=UTF-8
|
155
|
+
Content-Length:
|
156
|
+
- '746'
|
157
|
+
Connection:
|
158
|
+
- keep-alive
|
159
|
+
Via:
|
160
|
+
- 1.0 Repose (Repose/6.0.2)
|
161
|
+
body:
|
162
|
+
encoding: UTF-8
|
163
|
+
string: '{"stack": {"parent": null, "disable_rollback": false, "description":
|
164
|
+
"No description", "links": [{"href": "https://hkg.orchestration.api.rackspacecloud.com/v1/891853/stacks/miasma-test-stack/c3c2ad32-e697-4b27-9a4f-2d239d634bb4",
|
165
|
+
"rel": "self"}], "stack_status_reason": "Stack CREATE completed successfully",
|
166
|
+
"stack_name": "miasma-test-stack", "outputs": [], "stack_owner": null, "creation_time":
|
167
|
+
"2014-11-24T13:47:29Z", "capabilities": [], "notification_topics": [], "updated_time":
|
168
|
+
null, "timeout_mins": null, "stack_status": "CREATE_COMPLETE", "parameters":
|
169
|
+
{"OS::stack_id": "c3c2ad32-e697-4b27-9a4f-2d239d634bb4", "OS::stack_name":
|
170
|
+
"miasma-test-stack"}, "id": "c3c2ad32-e697-4b27-9a4f-2d239d634bb4", "template_description":
|
171
|
+
"No description"}}'
|
172
|
+
http_version:
|
173
|
+
recorded_at: Mon, 24 Nov 2014 13:49:34 GMT
|
174
|
+
- request:
|
175
|
+
method: get
|
176
|
+
uri: https://hkg.orchestration.api.rackspacecloud.com/v1/891853/stacks/miasma-test-stack/c3c2ad32-e697-4b27-9a4f-2d239d634bb4/template
|
177
|
+
body:
|
178
|
+
encoding: US-ASCII
|
179
|
+
string: ''
|
180
|
+
headers:
|
181
|
+
User-Agent:
|
182
|
+
- miasma/v0.2.1
|
183
|
+
X-Auth-Token:
|
184
|
+
- 015c96cbf67f48298525376a555ce24d
|
185
|
+
Host:
|
186
|
+
- hkg.orchestration.api.rackspacecloud.com
|
187
|
+
response:
|
188
|
+
status:
|
189
|
+
code: 200
|
190
|
+
message: OK
|
191
|
+
headers:
|
192
|
+
Server:
|
193
|
+
- nginx/1.2.1
|
194
|
+
Date:
|
195
|
+
- Mon, 24 Nov 2014 13:48:18 GMT
|
196
|
+
Content-Type:
|
197
|
+
- application/json; charset=UTF-8
|
198
|
+
Content-Length:
|
199
|
+
- '190'
|
200
|
+
Connection:
|
201
|
+
- keep-alive
|
202
|
+
Via:
|
203
|
+
- 1.0 Repose (Repose/6.0.2)
|
204
|
+
body:
|
205
|
+
encoding: UTF-8
|
206
|
+
string: '{"heat_template_version": "2013-05-23", "resources": {"MiasmaSubNet":
|
207
|
+
{"type": "Rackspace::Cloud::Network", "properties": {"cidr": "192.168.233.0/24",
|
208
|
+
"label": "miasma auto test network"}}}}'
|
209
|
+
http_version:
|
210
|
+
recorded_at: Mon, 24 Nov 2014 13:49:35 GMT
|
211
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://hkg.orchestration.api.rackspacecloud.com/v1/891853/stacks
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- miasma/v0.2.1
|
12
|
+
X-Auth-Token:
|
13
|
+
- 015c96cbf67f48298525376a555ce24d
|
14
|
+
Host:
|
15
|
+
- hkg.orchestration.api.rackspacecloud.com
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- nginx/1.2.1
|
23
|
+
Date:
|
24
|
+
- Mon, 24 Nov 2014 13:49:27 GMT
|
25
|
+
Content-Type:
|
26
|
+
- application/json; charset=UTF-8
|
27
|
+
Content-Length:
|
28
|
+
- '14'
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
Via:
|
32
|
+
- 1.0 Repose (Repose/6.0.2)
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '{"stacks": []}'
|
36
|
+
http_version:
|
37
|
+
recorded_at: Mon, 24 Nov 2014 13:50:44 GMT
|
38
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,33 @@
|
|
1
|
+
describe Miasma do
|
2
|
+
it 'should provide an #api entry method' do
|
3
|
+
Miasma.respond_to?(:api).must_equal true
|
4
|
+
end
|
5
|
+
|
6
|
+
describe 'Miasma.api' do
|
7
|
+
|
8
|
+
it 'should require `:type` argument' do
|
9
|
+
lambda do
|
10
|
+
Miasma.api(:provider => '', :credentials => {})
|
11
|
+
end.must_raise ArgumentError
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should require `:provider` argument' do
|
15
|
+
lambda do
|
16
|
+
Miasma.api(:type => '', :credentials => {})
|
17
|
+
end.must_raise ArgumentError
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should require `:credentials` argument' do
|
21
|
+
lambda do
|
22
|
+
Miasma.api(:provider => '', :type => '')
|
23
|
+
end.must_raise ArgumentError
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should fail to load unknown provider' do
|
27
|
+
lambda do
|
28
|
+
Miasma.api(:provider => :unknown, :type => :compute, :credentials => {})
|
29
|
+
end.must_raise Miasma::Error
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
MIASMA_COMPUTE_ABSTRACT = ->{
|
2
|
+
|
3
|
+
# Required `let`s:
|
4
|
+
# * compute: compute API
|
5
|
+
# * build_args: server build arguments [Smash]
|
6
|
+
# * cassette_prefix: cassette file prefix [String]
|
7
|
+
|
8
|
+
describe Miasma::Models::Compute do
|
9
|
+
|
10
|
+
it 'should provide #servers collection' do
|
11
|
+
compute.servers.must_be_kind_of Miasma::Models::Compute::Servers
|
12
|
+
end
|
13
|
+
|
14
|
+
describe Miasma::Models::Compute::Servers do
|
15
|
+
|
16
|
+
it 'should provide instance class used within collection' do
|
17
|
+
compute.servers.model.must_equal Miasma::Models::Compute::Server
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should build new instance for collection' do
|
21
|
+
instance = compute.servers.build(:name => 'test')
|
22
|
+
instance.must_be_kind_of Miasma::Models::Compute::Server
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should provide #all servers' do
|
26
|
+
VCR.use_cassette("#{cassette_prefix}_servers_all") do
|
27
|
+
compute.servers.all.must_be_kind_of Array
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
describe Miasma::Models::Compute::Server do
|
34
|
+
|
35
|
+
before do
|
36
|
+
@instance = compute.servers.build(build_args)
|
37
|
+
VCR.use_cassette("#{cassette_prefix}_server_before_create") do |obj|
|
38
|
+
@instance.save
|
39
|
+
until(@instance.state == :running)
|
40
|
+
sleep(obj.recording? ? 60 : 0.01)
|
41
|
+
@instance.reload
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
after do
|
47
|
+
VCR.use_cassette("#{cassette_prefix}_server_after_destroy") do
|
48
|
+
@instance.destroy
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
let(:instance){ @instance }
|
53
|
+
|
54
|
+
describe 'instance methods' do
|
55
|
+
|
56
|
+
it 'should have a name' do
|
57
|
+
instance.name.must_equal build_args[:name]
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'should have an image_id' do
|
61
|
+
instance.image_id.must_equal build_args[:image_id]
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'should have a flavor_id' do
|
65
|
+
instance.flavor_id.must_equal build_args[:flavor_id]
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'should have an address' do
|
69
|
+
instance.addresses.detect do |addr|
|
70
|
+
addr.version == 4
|
71
|
+
end.address.must_match /^(\d+)+\.(\d+)\.(\d+)\.(\d+)$/
|
72
|
+
end
|
73
|
+
|
74
|
+
it 'should have a status' do
|
75
|
+
instance.status.wont_be_nil
|
76
|
+
end
|
77
|
+
|
78
|
+
it 'should be in :running state' do
|
79
|
+
instance.state.must_equal :running
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
|
86
|
+
describe 'instance lifecycle' do
|
87
|
+
it 'should create new server, reload details and destroy server' do
|
88
|
+
VCR.use_cassette("#{cassette_prefix}_servers_create") do |obj|
|
89
|
+
instance = compute.servers.build(build_args)
|
90
|
+
instance.save
|
91
|
+
instance.id.wont_be_nil
|
92
|
+
instance.state.must_equal :pending
|
93
|
+
compute.servers.reload.get(instance.id).wont_be_nil
|
94
|
+
until(instance.state == :running)
|
95
|
+
sleep(obj.recording? ? 60 : 0.01)
|
96
|
+
instance.reload
|
97
|
+
end
|
98
|
+
instance.state.must_equal :running
|
99
|
+
instance.destroy
|
100
|
+
while(instance.state == :running)
|
101
|
+
sleep(obj.recording? ? 10 : 0.01)
|
102
|
+
instance.reload
|
103
|
+
end
|
104
|
+
[:pending, :terminated].must_include instance.state
|
105
|
+
if(instance.state == :pending)
|
106
|
+
until(instance.state == :terminated)
|
107
|
+
sleep(obj.recording? ? 60 : 0.01)
|
108
|
+
instance.reload
|
109
|
+
end
|
110
|
+
instance.state.must_equal :terminated
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
118
|
+
}
|
@@ -0,0 +1,88 @@
|
|
1
|
+
MIASMA_LOAD_BALANCER_ABSTRACT = ->{
|
2
|
+
|
3
|
+
# Required `let`s:
|
4
|
+
# * load_balancer: load balancer API
|
5
|
+
# * build_args: load balancer build arguments [Smash]
|
6
|
+
# * cassette_prefix: cassette file prefix [String]
|
7
|
+
|
8
|
+
describe Miasma::Models::LoadBalancer do
|
9
|
+
|
10
|
+
it 'should provide #balancers collection' do
|
11
|
+
load_balancer.balancers.must_be_kind_of Miasma::Models::LoadBalancer::Balancers
|
12
|
+
end
|
13
|
+
|
14
|
+
describe Miasma::Models::LoadBalancer::Balancers do
|
15
|
+
|
16
|
+
it 'should provide instance class used within collection' do
|
17
|
+
load_balancer.balancers.model.must_equal Miasma::Models::LoadBalancer::Balancer
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should build new instance for collection' do
|
21
|
+
instance = load_balancer.balancers.build
|
22
|
+
instance.must_be_kind_of Miasma::Models::LoadBalancer::Balancer
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should provide #all balancers' do
|
26
|
+
VCR.use_cassette("#{cassette_prefix}_balancers_all") do
|
27
|
+
load_balancer.balancers.all.must_be_kind_of Array
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
describe Miasma::Models::LoadBalancer::Balancer do
|
34
|
+
|
35
|
+
before do
|
36
|
+
@balancer = load_balancer.balancers.build(build_args)
|
37
|
+
VCR.use_cassette("#{cassette_prefix}_balancer_before_create") do |obj|
|
38
|
+
@balancer.save
|
39
|
+
until(@balancer.state == :active)
|
40
|
+
sleep(obj.recording? ? 60 : 0.01)
|
41
|
+
@balancer.reload
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
after do
|
47
|
+
VCR.use_cassette("#{cassette_prefix}_balancer_after_destroy") do
|
48
|
+
@balancer.destroy
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
let(:balancer){ @balancer }
|
53
|
+
|
54
|
+
describe 'collection' do
|
55
|
+
|
56
|
+
it 'should include balancer' do
|
57
|
+
VCR.use_cassette("#{cassette_prefix}_balancer_direct_fetch") do
|
58
|
+
load_balancer.balancers.reload.get(balancer.id).wont_be_nil
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
describe 'balancer methods' do
|
65
|
+
|
66
|
+
it 'should have a name' do
|
67
|
+
balancer.name.must_equal build_args[:name]
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'should be in :active state' do
|
71
|
+
balancer.state.must_equal :active
|
72
|
+
end
|
73
|
+
|
74
|
+
it 'should have a status' do
|
75
|
+
balancer.status.wont_be_nil
|
76
|
+
balancer.status.must_be_kind_of String
|
77
|
+
end
|
78
|
+
|
79
|
+
it 'should have a public address' do
|
80
|
+
balancer.public_addresses.wont_be :empty?
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
}
|