datacentred 0.1.0pre

Sign up to get free protection for your applications and to get access to all the features.
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,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://my.datacentred.io/api
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
+ 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/"c412e4e0acf3d617e7774edb0fe82c87"
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Request-Id:
40
+ - 558c95f0-1a25-4b83-912c-db88b96eeab2
41
+ X-Runtime:
42
+ - '0.023523'
43
+ Transfer-Encoding:
44
+ - chunked
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"versions":[{"id":"1","status":"CURRENT","links":[{"href":"https://my.datacentred.io/api","rel":"self"}]}]}'
48
+ http_version:
49
+ recorded_at: Wed, 06 Sep 2017 09:01:36 GMT
50
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://my.datacentred.io/api/projects/project_id2
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"project":{"name":"new_project_name"}}'
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
+ - Wed, 30 Aug 2017 13:52:49 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/"44f59a8c8ff577611c188b9b55637128"
45
+ Cache-Control:
46
+ - max-age=0, private, must-revalidate
47
+ X-Request-Id:
48
+ - e3953be0-3278-4675-89f0-cbfd4719369f
49
+ X-Runtime:
50
+ - '1.301371'
51
+ Strict-Transport-Security:
52
+ - max-age=31536000; includeSubdomains; preload
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"project":{"id":"project_id2","name":"test_new_project_name","created_at":"2017-08-30T13:52:06Z","updated_at":"2017-08-30T13:52:49Z","quota_set":{"compute":{"instances":5,"cores":5,"ram":10240},"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_id2","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/project","rel":"schema"}]}}'
56
+ http_version:
57
+ recorded_at: Wed, 30 Aug 2017 13:52:49 GMT
58
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,98 @@
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/"1d263f2b35ea28248d64757b67bcf242"
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Request-Id:
40
+ - 58ac29b0-0ffe-42bd-80d0-b1d21189fa0d
41
+ X-Runtime:
42
+ - '0.133222'
43
+ Transfer-Encoding:
44
+ - chunked
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"role":{"id":"45f75b4d-2773-4719-9e09-a913ed244f3e","name":"New Role","admin":false,"permissions":[],"created_at":"2017-09-05T15:31:22Z","updated_at":"2017-09-05T15:31:22Z","links":[{"href":"https://my.datacentred.io/api/roles/45f75b4d-2773-4719-9e09-a913ed244f3e","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/role","rel":"schema"}]}}'
48
+ http_version:
49
+ recorded_at: Tue, 05 Sep 2017 15:31:22 GMT
50
+ - request:
51
+ method: put
52
+ uri: https://my.datacentred.io/api/roles/45f75b4d-2773-4719-9e09-a913ed244f3e
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"role":{"name":"Administrator 2"}}'
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: 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/"65a3ea5b4cfe4f058860635d25b12b07"
84
+ Cache-Control:
85
+ - max-age=0, private, must-revalidate
86
+ X-Request-Id:
87
+ - 5bcadb58-537d-4e32-b0b1-2240979c7d8b
88
+ X-Runtime:
89
+ - '0.112445'
90
+ Transfer-Encoding:
91
+ - chunked
92
+ body:
93
+ encoding: UTF-8
94
+ string: '{"role":{"id":"45f75b4d-2773-4719-9e09-a913ed244f3e","name":"Administrator
95
+ 2","admin":false,"permissions":[],"created_at":"2017-09-05T15:31:22Z","updated_at":"2017-09-05T15:31:23Z","links":[{"href":"https://my.datacentred.io/api/roles/45f75b4d-2773-4719-9e09-a913ed244f3e","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/role","rel":"schema"}]}}'
96
+ http_version:
97
+ recorded_at: Tue, 05 Sep 2017 15:31:23 GMT
98
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,98 @@
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/"41b511803b74af08f16067a9d1e3bc5a"
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Request-Id:
40
+ - 19be8bd6-bb38-480b-949d-b78410bf2243
41
+ X-Runtime:
42
+ - '0.114881'
43
+ Transfer-Encoding:
44
+ - chunked
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"role":{"id":"b7d9843a-6d52-4fc5-917e-e555b132a17a","name":"New Role","admin":false,"permissions":[],"created_at":"2017-09-05T15:31:38Z","updated_at":"2017-09-05T15:31:38Z","links":[{"href":"https://my.datacentred.io/api/roles/b7d9843a-6d52-4fc5-917e-e555b132a17a","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/role","rel":"schema"}]}}'
48
+ http_version:
49
+ recorded_at: Tue, 05 Sep 2017 15:31:38 GMT
50
+ - request:
51
+ method: put
52
+ uri: https://my.datacentred.io/api/roles/b7d9843a-6d52-4fc5-917e-e555b132a17a
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"role":{"name":"Genghis Khan","permissions":["fighting"]}}'
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: 422
70
+ message: Unprocessable Entity
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
+ - 069b9bff-e479-409c-8c9b-7393763853a0
86
+ X-Runtime:
87
+ - '0.106739'
88
+ Transfer-Encoding:
89
+ - chunked
90
+ body:
91
+ encoding: UTF-8
92
+ string: '{"errors":[{"resource":"role","detail":"Role permissions must be one
93
+ of: ''access requests.raise for others'', ''access requests.raise for self'',
94
+ ''api.read'', ''cloud.read'', ''roles.modify'', ''roles.read'', ''storage.read'',
95
+ ''tickets.modify'', ''usage.read''. ''fighting'' is not allowed.","field":"permissions"}],"links":[{"href":"https://my.datacentred.io/api","rel":"help"}]}'
96
+ http_version:
97
+ recorded_at: Tue, 05 Sep 2017 15:31:38 GMT
98
+ 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/"00819519241a9df321fe488721a328f1"
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Request-Id:
40
+ - b89643b2-abdb-445d-80bd-9ec105716878
41
+ X-Runtime:
42
+ - '3.215506'
43
+ Transfer-Encoding:
44
+ - chunked
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"user":{"id":"80bf74807be84904a1349c5457044f5f","email":"death@afterlife.com","first_name":"Foo","last_name":"Bar","created_at":"2017-09-05T18:41:30Z","updated_at":"2017-09-05T18:41:30Z","links":[{"href":"https://my.datacentred.io/api/users/80bf74807be84904a1349c5457044f5f","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/user","rel":"schema"}]}}'
48
+ http_version:
49
+ recorded_at: Tue, 05 Sep 2017 18:41:31 GMT
50
+ - request:
51
+ method: put
52
+ uri: https://my.datacentred.io/api/users/80bf74807be84904a1349c5457044f5f
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"user":{"first_name":"Foo2"}}'
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: 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/"7aeeed340a7c86e739b9db7a74668d24"
84
+ Cache-Control:
85
+ - max-age=0, private, must-revalidate
86
+ X-Request-Id:
87
+ - ab1b15c6-ce55-4abc-babc-d70c1da00ae9
88
+ X-Runtime:
89
+ - '0.382527'
90
+ Transfer-Encoding:
91
+ - chunked
92
+ body:
93
+ encoding: UTF-8
94
+ string: '{"user":{"id":"80bf74807be84904a1349c5457044f5f","email":"death@afterlife.com","first_name":"Foo2","last_name":"Bar","created_at":"2017-09-05T18:41:30Z","updated_at":"2017-09-05T18:41:31Z","links":[{"href":"https://my.datacentred.io/api/users/80bf74807be84904a1349c5457044f5f","rel":"self"},{"href":"https://my.datacentred.io/api/schemas/user","rel":"schema"}]}}'
95
+ http_version:
96
+ recorded_at: Tue, 05 Sep 2017 18:41:31 GMT
97
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://my.datacentred.io/api/usage/2010/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=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: 404
23
+ message: Not Found
24
+ headers:
25
+ Server:
26
+ - nginx/1.10.3
27
+ Date:
28
+ - Thu, 31 Aug 2017 11:15:47 GMT
29
+ Content-Type:
30
+ - text/html
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
+ Cache-Control:
44
+ - no-cache
45
+ X-Request-Id:
46
+ - a2679082-c302-47db-a46b-af11c3e2ff3d
47
+ X-Runtime:
48
+ - '0.272113'
49
+ body:
50
+ encoding: ASCII-8BIT
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Thu, 31 Aug 2017 11:15:47 GMT
54
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,54 @@
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@afterlife2.com"}}'
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: 422
23
+ message: Unprocessable Entity
24
+ headers:
25
+ Server:
26
+ - nginx/1.10.3
27
+ Date:
28
+ - Wed, 30 Aug 2017 14:45:25 GMT
29
+ Content-Type:
30
+ - application/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
+ Cache-Control:
44
+ - no-cache
45
+ X-Request-Id:
46
+ - be3cb73f-b6dd-4637-9c10-6e202963316b
47
+ X-Runtime:
48
+ - '0.419927'
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"errors":[{"resource":"user","detail":"User password can''t be blank.","field":"password"}],"links":[{"href":"https://my.datacentred.io/api","rel":"help"}]}'
52
+ http_version:
53
+ recorded_at: Wed, 30 Aug 2017 14:45:26 GMT
54
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: https://my.datacentred.io/api/users/my_user_id
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: 422
23
+ message: Unprocessable Entity
24
+ headers:
25
+ Server:
26
+ - nginx/1.10.3
27
+ Date:
28
+ - Thu, 31 Aug 2017 10:16:29 GMT
29
+ Content-Type:
30
+ - application/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
+ Cache-Control:
44
+ - no-cache
45
+ X-Request-Id:
46
+ - 53e28fff-038a-4377-a4aa-1208f048b2e1
47
+ X-Runtime:
48
+ - '0.127991'
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"errors":[{"detail":"You can''t delete yourself.","resource":"user"}],"links":[{"href":"https://my.datacentred.io/api","rel":"help"}]}'
52
+ http_version:
53
+ recorded_at: Thu, 31 Aug 2017 10:16:29 GMT
54
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: https://my.datacentred.io/api/users/unknown
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: 404
23
+ message: Not Found
24
+ headers:
25
+ Server:
26
+ - nginx/1.10.3
27
+ Date:
28
+ - Thu, 31 Aug 2017 10:26:07 GMT
29
+ Content-Type:
30
+ - application/vnd.datacentred.api+json
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
+ Cache-Control:
44
+ - no-cache
45
+ X-Request-Id:
46
+ - ec88358c-c9da-4c87-8116-6f819cab7934
47
+ X-Runtime:
48
+ - '0.128784'
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Thu, 31 Aug 2017 10:26:07 GMT
54
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://my.datacentred.io/api/users/unknown
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: 404
23
+ message: Not Found
24
+ headers:
25
+ Server:
26
+ - nginx/1.10.3
27
+ Date:
28
+ - Wed, 30 Aug 2017 14:30:27 GMT
29
+ Content-Type:
30
+ - application/vnd.datacentred.api+json
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
+ Cache-Control:
44
+ - no-cache
45
+ X-Request-Id:
46
+ - 6fe8f935-9f2d-4423-8f83-6e1fddcb27fa
47
+ X-Runtime:
48
+ - '0.125679'
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Wed, 30 Aug 2017 14:30:28 GMT
54
+ recorded_with: VCR 2.8.0