datacentred 0.1.0pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +4 -0
  3. data/Gemfile.lock +35 -0
  4. data/README.md +2 -0
  5. data/Rakefile +10 -0
  6. data/circle.yml +5 -0
  7. data/datacentred.gemspec +23 -0
  8. data/lib/datacentred/error.rb +28 -0
  9. data/lib/datacentred/model/project.rb +44 -0
  10. data/lib/datacentred/model/role.rb +44 -0
  11. data/lib/datacentred/model/usage.rb +15 -0
  12. data/lib/datacentred/model/user.rb +32 -0
  13. data/lib/datacentred/model/version.rb +14 -0
  14. data/lib/datacentred/request/base.rb +46 -0
  15. data/lib/datacentred/request/projects.rb +38 -0
  16. data/lib/datacentred/request/roles.rb +38 -0
  17. data/lib/datacentred/request/usage.rb +10 -0
  18. data/lib/datacentred/request/users.rb +26 -0
  19. data/lib/datacentred/request/versions.rb +10 -0
  20. data/lib/datacentred/response.rb +12 -0
  21. data/lib/datacentred.rb +40 -0
  22. data/test/integration/projects_test.rb +117 -0
  23. data/test/integration/roles_test.rb +128 -0
  24. data/test/integration/usage_test.rb +24 -0
  25. data/test/integration/users_test.rb +128 -0
  26. data/test/integration/versions_test.rb +15 -0
  27. data/test/test_helper.rb +14 -0
  28. data/test/vcr_cassettes/add_user_to_project.yml +140 -0
  29. data/test/vcr_cassettes/add_user_to_role.yml +187 -0
  30. data/test/vcr_cassettes/create_project.yml +58 -0
  31. data/test/vcr_cassettes/create_role_with_invalid_permissions.yml +51 -0
  32. data/test/vcr_cassettes/create_role_with_permissions.yml +51 -0
  33. data/test/vcr_cassettes/create_role_without_permissions.yml +50 -0
  34. data/test/vcr_cassettes/create_user.yml +50 -0
  35. data/test/vcr_cassettes/delete_project.yml +103 -0
  36. data/test/vcr_cassettes/delete_role.yml +183 -0
  37. data/test/vcr_cassettes/delete_user.yml +136 -0
  38. data/test/vcr_cassettes/find_role.yml +97 -0
  39. data/test/vcr_cassettes/list_project_users.yml +58 -0
  40. data/test/vcr_cassettes/list_projects.yml +58 -0
  41. data/test/vcr_cassettes/list_role_users.yml +97 -0
  42. data/test/vcr_cassettes/list_roles.yml +50 -0
  43. data/test/vcr_cassettes/list_users.yml +58 -0
  44. data/test/vcr_cassettes/project_create_failed_validation.yml +56 -0
  45. data/test/vcr_cassettes/project_not_found.yml +54 -0
  46. data/test/vcr_cassettes/project_update_failed_validation.yml +55 -0
  47. data/test/vcr_cassettes/project_update_not_found.yml +54 -0
  48. data/test/vcr_cassettes/remove_user_from_project.yml +138 -0
  49. data/test/vcr_cassettes/remove_user_from_role.yml +228 -0
  50. data/test/vcr_cassettes/remove_user_from_role_not_found.yml +95 -0
  51. data/test/vcr_cassettes/show_project.yml +58 -0
  52. data/test/vcr_cassettes/show_usage.yml +51 -0
  53. data/test/vcr_cassettes/show_user.yml +97 -0
  54. data/test/vcr_cassettes/show_version.yml +50 -0
  55. data/test/vcr_cassettes/update_project.yml +58 -0
  56. data/test/vcr_cassettes/update_role.yml +98 -0
  57. data/test/vcr_cassettes/update_role_with_invalid_permissions.yml +98 -0
  58. data/test/vcr_cassettes/update_user.yml +97 -0
  59. data/test/vcr_cassettes/usage_not_found.yml +54 -0
  60. data/test/vcr_cassettes/user_create_failed_validation.yml +54 -0
  61. data/test/vcr_cassettes/user_delete_failed_validation.yml +54 -0
  62. data/test/vcr_cassettes/user_delete_not_found.yml +54 -0
  63. data/test/vcr_cassettes/user_show_not_found.yml +54 -0
  64. data/test/vcr_cassettes/user_update_failed_validation.yml +96 -0
  65. data/test/vcr_cassettes/user_update_not_found.yml +48 -0
  66. metadata +165 -0
@@ -0,0 +1,138 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://my.datacentred.io/api/projects/project_id1/users
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/vnd.datacentred.api+json; version=1
12
+ Authorization:
13
+ - Token token=e9d2d4cd37adf1634e2a65b9e18a8fcb:821fac118e7675f28fa42ab79ace57de
14
+ Content-Type:
15
+ - application/json
16
+ User-Agent:
17
+ - Faraday v0.9.2
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ X-Frame-Options:
26
+ - SAMEORIGIN
27
+ X-Xss-Protection:
28
+ - 1; mode=block
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ X-Api-Version:
32
+ - '1'
33
+ Content-Type:
34
+ - application/vnd.datacentred.api+json; charset=utf-8
35
+ Etag:
36
+ - W/"89f589a53690f0175b3b8ee53ccdc4b0"
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Request-Id:
40
+ - 12fedd59-8ca5-4ead-a64a-1bc7bb69531b
41
+ X-Runtime:
42
+ - '0.099706'
43
+ Transfer-Encoding:
44
+ - chunked
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"users":[{"id":"user_id","email":"sean.handley@datacentred.co.uk","first_name":"Sean","last_name":"Handley","created_at":"2017-07-20T13:06:20Z","updated_at":"2017-07-20T13:06:20Z","links":[{"href":"https://my.datacentred.io/api/users/user_id","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/user","rel":"schema"}]},{"id":"06eacbafda355a927f50f304db3af132","email":"eugenia.grieff@datacentred.co.uk","first_name":"Eugenia","last_name":"Grieff","created_at":"2017-07-20T13:06:20Z","updated_at":"2017-07-20T13:06:20Z","links":[{"href":"https://my.datacentred.io/api/users/06eacbafda355a927f50f304db3af132","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/user","rel":"schema"}]}]}'
48
+ http_version:
49
+ recorded_at: Tue, 05 Sep 2017 15:19:09 GMT
50
+ - request:
51
+ method: delete
52
+ uri: https://my.datacentred.io/api/projects/project_id1/users/user_id
53
+ body:
54
+ encoding: US-ASCII
55
+ string: ''
56
+ headers:
57
+ Accept:
58
+ - application/vnd.datacentred.api+json; version=1
59
+ Authorization:
60
+ - Token token=e9d2d4cd37adf1634e2a65b9e18a8fcb:821fac118e7675f28fa42ab79ace57de
61
+ Content-Type:
62
+ - application/json
63
+ User-Agent:
64
+ - Faraday v0.9.2
65
+ Accept-Encoding:
66
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
67
+ response:
68
+ status:
69
+ code: 204
70
+ message: No Content
71
+ headers:
72
+ X-Frame-Options:
73
+ - SAMEORIGIN
74
+ X-Xss-Protection:
75
+ - 1; mode=block
76
+ X-Content-Type-Options:
77
+ - nosniff
78
+ X-Api-Version:
79
+ - '1'
80
+ Cache-Control:
81
+ - no-cache
82
+ X-Request-Id:
83
+ - 07781013-1aff-41a1-8bb4-a69ec3a493e7
84
+ X-Runtime:
85
+ - '0.130612'
86
+ body:
87
+ encoding: UTF-8
88
+ string: ''
89
+ http_version:
90
+ recorded_at: Tue, 05 Sep 2017 15:19:09 GMT
91
+ - request:
92
+ method: get
93
+ uri: https://my.datacentred.io/api/projects/project_id1/users
94
+ body:
95
+ encoding: US-ASCII
96
+ string: ''
97
+ headers:
98
+ Accept:
99
+ - application/vnd.datacentred.api+json; version=1
100
+ Authorization:
101
+ - Token token=e9d2d4cd37adf1634e2a65b9e18a8fcb:821fac118e7675f28fa42ab79ace57de
102
+ Content-Type:
103
+ - application/json
104
+ User-Agent:
105
+ - Faraday v0.9.2
106
+ Accept-Encoding:
107
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
108
+ response:
109
+ status:
110
+ code: 200
111
+ message: OK
112
+ headers:
113
+ X-Frame-Options:
114
+ - SAMEORIGIN
115
+ X-Xss-Protection:
116
+ - 1; mode=block
117
+ X-Content-Type-Options:
118
+ - nosniff
119
+ X-Api-Version:
120
+ - '1'
121
+ Content-Type:
122
+ - application/vnd.datacentred.api+json; charset=utf-8
123
+ Etag:
124
+ - W/"a49ddef61fd02a4859e54c61f0d506bb"
125
+ Cache-Control:
126
+ - max-age=0, private, must-revalidate
127
+ X-Request-Id:
128
+ - 0c20e679-8cbb-46b6-a53c-5ad60d65d690
129
+ X-Runtime:
130
+ - '0.097840'
131
+ Transfer-Encoding:
132
+ - chunked
133
+ body:
134
+ encoding: UTF-8
135
+ string: '{"users":[{"id":"06eacbafda355a927f50f304db3af132","email":"eugenia.grieff@datacentred.co.uk","first_name":"Eugenia","last_name":"Grieff","created_at":"2017-07-20T13:06:20Z","updated_at":"2017-07-20T13:06:20Z","links":[{"href":"https://my.datacentred.io/api/users/06eacbafda355a927f50f304db3af132","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/user","rel":"schema"}]}]}'
136
+ http_version:
137
+ recorded_at: Tue, 05 Sep 2017 15:19:09 GMT
138
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,228 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://my.datacentred.io/api/roles
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"role":{"name":"New Role"}}'
9
+ headers:
10
+ Accept:
11
+ - application/vnd.datacentred.api+json; version=1
12
+ Authorization:
13
+ - Token token=access_key:secret_key
14
+ Content-Type:
15
+ - application/json
16
+ User-Agent:
17
+ - Faraday v0.9.2
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ X-Frame-Options:
26
+ - SAMEORIGIN
27
+ X-Xss-Protection:
28
+ - 1; mode=block
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ X-Api-Version:
32
+ - '1'
33
+ Content-Type:
34
+ - application/vnd.datacentred.api+json; charset=utf-8
35
+ Etag:
36
+ - W/"b0c5f9b8af2bb8a318f7e5653fe71359"
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Request-Id:
40
+ - 83a56fa6-9c83-4cc6-8252-f7b6428bb49b
41
+ X-Runtime:
42
+ - '0.122490'
43
+ Transfer-Encoding:
44
+ - chunked
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"role":{"id":"74aab3e2-4d08-4875-8522-244c2261717d","name":"New Role","admin":false,"permissions":[],"created_at":"2017-09-06T09:31:45Z","updated_at":"2017-09-06T09:31:45Z","links":[{"href":"https://my.datacentred.io/api/roles/74aab3e2-4d08-4875-8522-244c2261717d","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/role","rel":"schema"}]}}'
48
+ http_version:
49
+ recorded_at: Wed, 06 Sep 2017 09:31:45 GMT
50
+ - request:
51
+ method: put
52
+ uri: https://my.datacentred.io/api/roles/74aab3e2-4d08-4875-8522-244c2261717d/users/06eacbafda355a927f50f304db3af132
53
+ body:
54
+ encoding: UTF-8
55
+ string: ''
56
+ headers:
57
+ Accept:
58
+ - application/vnd.datacentred.api+json; version=1
59
+ Authorization:
60
+ - Token token=e9d2d4cd37adf1634e2a65b9e18a8fcb:821fac118e7675f28fa42ab79ace57de
61
+ Content-Type:
62
+ - application/json
63
+ User-Agent:
64
+ - Faraday v0.9.2
65
+ Content-Length:
66
+ - '0'
67
+ Accept-Encoding:
68
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
69
+ response:
70
+ status:
71
+ code: 204
72
+ message: No Content
73
+ headers:
74
+ X-Frame-Options:
75
+ - SAMEORIGIN
76
+ X-Xss-Protection:
77
+ - 1; mode=block
78
+ X-Content-Type-Options:
79
+ - nosniff
80
+ X-Api-Version:
81
+ - '1'
82
+ Cache-Control:
83
+ - no-cache
84
+ X-Request-Id:
85
+ - 11fd4048-8cc8-4feb-acaf-142dbaf23028
86
+ X-Runtime:
87
+ - '0.126202'
88
+ body:
89
+ encoding: UTF-8
90
+ string: ''
91
+ http_version:
92
+ recorded_at: Wed, 06 Sep 2017 09:31:45 GMT
93
+ - request:
94
+ method: get
95
+ uri: https://my.datacentred.io/api/roles/74aab3e2-4d08-4875-8522-244c2261717d/users
96
+ body:
97
+ encoding: US-ASCII
98
+ string: ''
99
+ headers:
100
+ Accept:
101
+ - application/vnd.datacentred.api+json; version=1
102
+ Authorization:
103
+ - Token token=e9d2d4cd37adf1634e2a65b9e18a8fcb:821fac118e7675f28fa42ab79ace57de
104
+ Content-Type:
105
+ - application/json
106
+ User-Agent:
107
+ - Faraday v0.9.2
108
+ Accept-Encoding:
109
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
110
+ response:
111
+ status:
112
+ code: 200
113
+ message: OK
114
+ headers:
115
+ X-Frame-Options:
116
+ - SAMEORIGIN
117
+ X-Xss-Protection:
118
+ - 1; mode=block
119
+ X-Content-Type-Options:
120
+ - nosniff
121
+ X-Api-Version:
122
+ - '1'
123
+ Content-Type:
124
+ - application/vnd.datacentred.api+json; charset=utf-8
125
+ Etag:
126
+ - W/"a49ddef61fd02a4859e54c61f0d506bb"
127
+ Cache-Control:
128
+ - max-age=0, private, must-revalidate
129
+ X-Request-Id:
130
+ - bde5d70f-981a-4912-adb4-c681460ee7d3
131
+ X-Runtime:
132
+ - '0.099862'
133
+ Transfer-Encoding:
134
+ - chunked
135
+ body:
136
+ encoding: UTF-8
137
+ string: '{"users":[{"id":"06eacbafda355a927f50f304db3af132","email":"eugenia.grieff@datacentred.co.uk","first_name":"Eugenia","last_name":"Grieff","created_at":"2017-07-20T13:06:20Z","updated_at":"2017-07-20T13:06:20Z","links":[{"href":"https://my.datacentred.io/api/users/06eacbafda355a927f50f304db3af132","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/user","rel":"schema"}]}]}'
138
+ http_version:
139
+ recorded_at: Wed, 06 Sep 2017 09:31:45 GMT
140
+ - request:
141
+ method: delete
142
+ uri: https://my.datacentred.io/api/roles/74aab3e2-4d08-4875-8522-244c2261717d/users/06eacbafda355a927f50f304db3af132
143
+ body:
144
+ encoding: US-ASCII
145
+ string: ''
146
+ headers:
147
+ Accept:
148
+ - application/vnd.datacentred.api+json; version=1
149
+ Authorization:
150
+ - Token token=e9d2d4cd37adf1634e2a65b9e18a8fcb:821fac118e7675f28fa42ab79ace57de
151
+ Content-Type:
152
+ - application/json
153
+ User-Agent:
154
+ - Faraday v0.9.2
155
+ Accept-Encoding:
156
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
157
+ response:
158
+ status:
159
+ code: 204
160
+ message: No Content
161
+ headers:
162
+ X-Frame-Options:
163
+ - SAMEORIGIN
164
+ X-Xss-Protection:
165
+ - 1; mode=block
166
+ X-Content-Type-Options:
167
+ - nosniff
168
+ X-Api-Version:
169
+ - '1'
170
+ Cache-Control:
171
+ - no-cache
172
+ X-Request-Id:
173
+ - 773a9d03-8ddb-4622-aad4-cc59d80ae969
174
+ X-Runtime:
175
+ - '0.115497'
176
+ body:
177
+ encoding: UTF-8
178
+ string: ''
179
+ http_version:
180
+ recorded_at: Wed, 06 Sep 2017 09:31:46 GMT
181
+ - request:
182
+ method: get
183
+ uri: https://my.datacentred.io/api/roles/74aab3e2-4d08-4875-8522-244c2261717d/users
184
+ body:
185
+ encoding: US-ASCII
186
+ string: ''
187
+ headers:
188
+ Accept:
189
+ - application/vnd.datacentred.api+json; version=1
190
+ Authorization:
191
+ - Token token=e9d2d4cd37adf1634e2a65b9e18a8fcb:821fac118e7675f28fa42ab79ace57de
192
+ Content-Type:
193
+ - application/json
194
+ User-Agent:
195
+ - Faraday v0.9.2
196
+ Accept-Encoding:
197
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
198
+ response:
199
+ status:
200
+ code: 200
201
+ message: OK
202
+ headers:
203
+ X-Frame-Options:
204
+ - SAMEORIGIN
205
+ X-Xss-Protection:
206
+ - 1; mode=block
207
+ X-Content-Type-Options:
208
+ - nosniff
209
+ X-Api-Version:
210
+ - '1'
211
+ Content-Type:
212
+ - application/vnd.datacentred.api+json; charset=utf-8
213
+ Etag:
214
+ - W/"adac7b84dc3b7394d8385aa0c65fe27a"
215
+ Cache-Control:
216
+ - max-age=0, private, must-revalidate
217
+ X-Request-Id:
218
+ - 58780bf4-9334-43cf-9377-8622e6a491f2
219
+ X-Runtime:
220
+ - '0.099676'
221
+ Transfer-Encoding:
222
+ - chunked
223
+ body:
224
+ encoding: UTF-8
225
+ string: '{"users":[]}'
226
+ http_version:
227
+ recorded_at: Wed, 06 Sep 2017 09:31:46 GMT
228
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,95 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://my.datacentred.io/api/roles
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"role":{"name":"New Role"}}'
9
+ headers:
10
+ Accept:
11
+ - application/vnd.datacentred.api+json; version=1
12
+ Authorization:
13
+ - Token token=access_key:secret_key
14
+ Content-Type:
15
+ - application/json
16
+ User-Agent:
17
+ - Faraday v0.9.2
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ X-Frame-Options:
26
+ - SAMEORIGIN
27
+ X-Xss-Protection:
28
+ - 1; mode=block
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ X-Api-Version:
32
+ - '1'
33
+ Content-Type:
34
+ - application/vnd.datacentred.api+json; charset=utf-8
35
+ Etag:
36
+ - W/"ae495ada4adecb5a44d3aee493291c12"
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Request-Id:
40
+ - 1fbbee82-c458-4430-ae24-da8a80492a1a
41
+ X-Runtime:
42
+ - '0.115788'
43
+ Transfer-Encoding:
44
+ - chunked
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"role":{"id":"fbe70b79-775c-4368-b451-da2a4905ba21","name":"New Role","admin":false,"permissions":[],"created_at":"2017-09-06T09:36:18Z","updated_at":"2017-09-06T09:36:18Z","links":[{"href":"https://my.datacentred.io/api/roles/fbe70b79-775c-4368-b451-da2a4905ba21","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/role","rel":"schema"}]}}'
48
+ http_version:
49
+ recorded_at: Wed, 06 Sep 2017 09:36:18 GMT
50
+ - request:
51
+ method: delete
52
+ uri: https://my.datacentred.io/api/roles/fbe70b79-775c-4368-b451-da2a4905ba21/users/unknown
53
+ body:
54
+ encoding: US-ASCII
55
+ string: ''
56
+ headers:
57
+ Accept:
58
+ - application/vnd.datacentred.api+json; version=1
59
+ Authorization:
60
+ - Token token=e9d2d4cd37adf1634e2a65b9e18a8fcb:821fac118e7675f28fa42ab79ace57de
61
+ Content-Type:
62
+ - application/json
63
+ User-Agent:
64
+ - Faraday v0.9.2
65
+ Accept-Encoding:
66
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
67
+ response:
68
+ status:
69
+ code: 404
70
+ message: Not Found
71
+ headers:
72
+ X-Frame-Options:
73
+ - SAMEORIGIN
74
+ X-Xss-Protection:
75
+ - 1; mode=block
76
+ X-Content-Type-Options:
77
+ - nosniff
78
+ X-Api-Version:
79
+ - '1'
80
+ Content-Type:
81
+ - application/json; charset=utf-8
82
+ Cache-Control:
83
+ - no-cache
84
+ X-Request-Id:
85
+ - cd8ce61e-1833-4063-aa53-a9828ca598f3
86
+ X-Runtime:
87
+ - '0.103127'
88
+ Transfer-Encoding:
89
+ - chunked
90
+ body:
91
+ encoding: UTF-8
92
+ string: '{"errors":[{"detail":"No such user ''unknown''"}],"links":[{"href":"https://my.datacentred.io/api","rel":"help"}]}'
93
+ http_version:
94
+ recorded_at: Wed, 06 Sep 2017 09:36:19 GMT
95
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://my.datacentred.io/api/projects/project_id1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/vnd.datacentred.api+json; version=1
12
+ Authorization:
13
+ - Token token=access_key:secret_key
14
+ Content-Type:
15
+ - application/json
16
+ User-Agent:
17
+ - Faraday v0.9.2
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - nginx/1.10.3
27
+ Date:
28
+ - Tue, 29 Aug 2017 14:12:03 GMT
29
+ Content-Type:
30
+ - application/vnd.datacentred.api+json; charset=utf-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ X-Frame-Options:
36
+ - SAMEORIGIN
37
+ X-Xss-Protection:
38
+ - 1; mode=block
39
+ X-Content-Type-Options:
40
+ - nosniff
41
+ X-Api-Version:
42
+ - '1'
43
+ Etag:
44
+ - W/"511e1997037f9d43ef5571093863721c"
45
+ Cache-Control:
46
+ - max-age=0, private, must-revalidate
47
+ X-Request-Id:
48
+ - f006914c-0429-47cd-a865-8ef7979f2bcc
49
+ X-Runtime:
50
+ - '0.188486'
51
+ Strict-Transport-Security:
52
+ - max-age=31536000; includeSubdomains; preload
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"project":{"id":"project_id1","name":"foo_bar_primary","created_at":"2016-02-25T17:00:47Z","updated_at":"2017-08-22T11:14:01Z","quota_set":{"compute":{"instances":6,"cores":10,"ram":20480},"volume":{"volumes":4,"snapshots":4,"gigabytes":40},"network":{"floatingip":1,"router":1,"security_group_rule":100,"security_group":10,"network":10,"port":10,"subnet":10,"pool":10,"vip":10}},"links":[{"href":"https://my.datacentred.io/api/projects/project_id1","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/project","rel":"schema"}]}}'
56
+ http_version:
57
+ recorded_at: Tue, 29 Aug 2017 14:12:03 GMT
58
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://my.datacentred.io/api/usage/2017/7
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/vnd.datacentred.api+json; version=1
12
+ Authorization:
13
+ - Token token=e9d2d4cd37adf1634e2a65b9e18a8fcb:821fac118e7675f28fa42ab79ace57de
14
+ Content-Type:
15
+ - application/json
16
+ User-Agent:
17
+ - Faraday v0.9.2
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ X-Frame-Options:
26
+ - SAMEORIGIN
27
+ X-Xss-Protection:
28
+ - 1; mode=block
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ X-Api-Version:
32
+ - '1'
33
+ Content-Type:
34
+ - application/vnd.datacentred.api+json; charset=utf-8
35
+ Etag:
36
+ - W/"c8bb3838c7292d5d8cbc51497edfaaeb"
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Request-Id:
40
+ - b03cbd08-1a6d-448c-b1f4-ffb88cfad578
41
+ X-Runtime:
42
+ - '0.248797'
43
+ Transfer-Encoding:
44
+ - chunked
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"last_updated_at":"2017-09-05T18:53:06Z","projects":[{"id":"612bfb90f93c4b6e9ba515d51bb16022","name":"datacentred","usage":{"images":[],"instances":[],"ips":{"current_quota":1,"quota_changes":[],"usage":[{"value":0,"unit":"hours","cost":{"currency":"gbp","value":0.0,"rate":0.0027}}]},"load_balancers":[],"object_storage":{"usage":[{"cost":{"currency":"gbp","rate":0.0313,"value":0.0},"unit":"terabyte
48
+ hours","value":0.0}]},"volumes":[],"vpns":[]}}],"links":[{"href":"https://my.datacentred.io/api/usage/2017/7","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/usage","rel":"schema"}]}'
49
+ http_version:
50
+ recorded_at: Wed, 06 Sep 2017 12:45:03 GMT
51
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,97 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://my.datacentred.io/api/users
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"user":{"email":"death@afterlife.com","password":"melvin11","first_name":"Foo","last_name":"Bar"}}'
9
+ headers:
10
+ Accept:
11
+ - application/vnd.datacentred.api+json; version=1
12
+ Authorization:
13
+ - Token token=access_key:secret_key
14
+ Content-Type:
15
+ - application/json
16
+ User-Agent:
17
+ - Faraday v0.9.2
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ X-Frame-Options:
26
+ - SAMEORIGIN
27
+ X-Xss-Protection:
28
+ - 1; mode=block
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ X-Api-Version:
32
+ - '1'
33
+ Content-Type:
34
+ - application/vnd.datacentred.api+json; charset=utf-8
35
+ Etag:
36
+ - W/"77470e294fa860e142229fc3d6c148b1"
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Request-Id:
40
+ - 794b24d4-2d5a-4a16-8d3e-cfdd08d6b7e7
41
+ X-Runtime:
42
+ - '1.776653'
43
+ Transfer-Encoding:
44
+ - chunked
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"user":{"id":"1baca4d531ee475fa083c713e1b617c5","email":"death@afterlife.com","first_name":"Foo","last_name":"Bar","created_at":"2017-09-05T18:37:56Z","updated_at":"2017-09-05T18:37:56Z","links":[{"href":"https://my.datacentred.io/api/users/1baca4d531ee475fa083c713e1b617c5","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/user","rel":"schema"}]}}'
48
+ http_version:
49
+ recorded_at: Tue, 05 Sep 2017 18:37:58 GMT
50
+ - request:
51
+ method: get
52
+ uri: https://my.datacentred.io/api/users/1baca4d531ee475fa083c713e1b617c5
53
+ body:
54
+ encoding: US-ASCII
55
+ string: ''
56
+ headers:
57
+ Accept:
58
+ - application/vnd.datacentred.api+json; version=1
59
+ Authorization:
60
+ - Token token=access_key:secret_key
61
+ Content-Type:
62
+ - application/json
63
+ User-Agent:
64
+ - Faraday v0.9.2
65
+ Accept-Encoding:
66
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
67
+ response:
68
+ status:
69
+ code: 200
70
+ message: OK
71
+ headers:
72
+ X-Frame-Options:
73
+ - SAMEORIGIN
74
+ X-Xss-Protection:
75
+ - 1; mode=block
76
+ X-Content-Type-Options:
77
+ - nosniff
78
+ X-Api-Version:
79
+ - '1'
80
+ Content-Type:
81
+ - application/vnd.datacentred.api+json; charset=utf-8
82
+ Etag:
83
+ - W/"77470e294fa860e142229fc3d6c148b1"
84
+ Cache-Control:
85
+ - max-age=0, private, must-revalidate
86
+ X-Request-Id:
87
+ - 5c58c66d-302f-40ce-997d-9bea48e72cce
88
+ X-Runtime:
89
+ - '0.097506'
90
+ Transfer-Encoding:
91
+ - chunked
92
+ body:
93
+ encoding: UTF-8
94
+ string: '{"user":{"id":"1baca4d531ee475fa083c713e1b617c5","email":"death@afterlife.com","first_name":"Foo","last_name":"Bar","created_at":"2017-09-05T18:37:56Z","updated_at":"2017-09-05T18:37:56Z","links":[{"href":"https://my.datacentred.io/api/users/1baca4d531ee475fa083c713e1b617c5","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/user","rel":"schema"}]}}'
95
+ http_version:
96
+ recorded_at: Tue, 05 Sep 2017 18:37:58 GMT
97
+ recorded_with: VCR 2.8.0