scalingo 3.0.0.beta.2 → 3.1.0

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 (64) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/publish.yml +28 -0
  3. data/.github/workflows/ruby.yml +45 -0
  4. data/.rubocop.yml +16 -0
  5. data/CHANGELOG.md +24 -0
  6. data/README.md +25 -20
  7. data/lib/scalingo/api/client.rb +38 -10
  8. data/lib/scalingo/api/endpoint.rb +12 -2
  9. data/lib/scalingo/api/response.rb +11 -2
  10. data/lib/scalingo/auth/keys.rb +4 -4
  11. data/lib/scalingo/auth/scm_integrations.rb +4 -4
  12. data/lib/scalingo/auth/tokens.rb +6 -6
  13. data/lib/scalingo/auth/two_factor_auth.rb +4 -4
  14. data/lib/scalingo/auth/user.rb +15 -2
  15. data/lib/scalingo/bearer_token.rb +15 -0
  16. data/lib/scalingo/billing/profile.rb +3 -3
  17. data/lib/scalingo/client.rb +26 -113
  18. data/lib/scalingo/configuration.rb +8 -36
  19. data/lib/scalingo/core_client.rb +106 -0
  20. data/lib/scalingo/regional/addons.rb +21 -8
  21. data/lib/scalingo/regional/apps.rb +8 -8
  22. data/lib/scalingo/regional/autoscalers.rb +70 -0
  23. data/lib/scalingo/regional/collaborators.rb +4 -4
  24. data/lib/scalingo/regional/containers.rb +4 -4
  25. data/lib/scalingo/regional/deployments.rb +3 -3
  26. data/lib/scalingo/regional/domains.rb +5 -5
  27. data/lib/scalingo/regional/environment.rb +6 -6
  28. data/lib/scalingo/regional/events.rb +4 -4
  29. data/lib/scalingo/regional/logs.rb +2 -2
  30. data/lib/scalingo/regional/metrics.rb +3 -2
  31. data/lib/scalingo/regional/notifiers.rb +7 -7
  32. data/lib/scalingo/regional/operations.rb +1 -1
  33. data/lib/scalingo/regional/scm_repo_links.rb +8 -8
  34. data/lib/scalingo/regional.rb +2 -0
  35. data/lib/scalingo/token_holder.rb +31 -0
  36. data/lib/scalingo/version.rb +1 -1
  37. data/samples/auth/user/stop-free-trial.json +24 -0
  38. data/samples/regional/addons/token-200.json +49 -0
  39. data/samples/regional/addons/token-404.json +24 -0
  40. data/samples/regional/autoscalers/_meta.json +27 -0
  41. data/samples/regional/autoscalers/create-201.json +49 -0
  42. data/samples/regional/autoscalers/create-500.json +32 -0
  43. data/samples/regional/autoscalers/destroy-204.json +20 -0
  44. data/samples/regional/autoscalers/destroy-404.json +25 -0
  45. data/samples/regional/autoscalers/find-200.json +39 -0
  46. data/samples/regional/autoscalers/find-404.json +25 -0
  47. data/samples/regional/autoscalers/for-200.json +41 -0
  48. data/samples/regional/autoscalers/update-200.json +45 -0
  49. data/samples/regional/autoscalers/update-404.json +31 -0
  50. data/samples/regional/autoscalers/update-500.json +30 -0
  51. data/scalingo.gemspec +8 -8
  52. data/spec/scalingo/api/client_spec.rb +60 -13
  53. data/spec/scalingo/api/endpoint_spec.rb +18 -3
  54. data/spec/scalingo/api/response_spec.rb +32 -16
  55. data/spec/scalingo/auth/user_spec.rb +6 -0
  56. data/spec/scalingo/auth_spec.rb +1 -1
  57. data/spec/scalingo/billing_spec.rb +11 -0
  58. data/spec/scalingo/client_spec.rb +2 -2
  59. data/spec/scalingo/configuration_spec.rb +32 -30
  60. data/spec/scalingo/regional/addons_spec.rb +16 -0
  61. data/spec/scalingo/regional/autoscalers_spec.rb +84 -0
  62. data/spec/scalingo/regional_spec.rb +3 -3
  63. metadata +69 -47
  64. data/.travis.yml +0 -24
@@ -12,7 +12,7 @@ module Scalingo
12
12
  &block
13
13
  )
14
14
 
15
- unpack(response, key: :variables)
15
+ unpack(:variables) { response }
16
16
  end
17
17
 
18
18
  def create(app_id, payload = {}, headers = nil, &block)
@@ -25,7 +25,7 @@ module Scalingo
25
25
  &block
26
26
  )
27
27
 
28
- unpack(response, key: :variable)
28
+ unpack(:variable) { response }
29
29
  end
30
30
 
31
31
  def update(app_id, variable_id, value, headers = nil, &block)
@@ -38,7 +38,7 @@ module Scalingo
38
38
  &block
39
39
  )
40
40
 
41
- unpack(response, key: :variable)
41
+ unpack(:variable) { response }
42
42
  end
43
43
 
44
44
  def destroy(app_id, variable_id, headers = nil, &block)
@@ -51,7 +51,7 @@ module Scalingo
51
51
  &block
52
52
  )
53
53
 
54
- unpack(response)
54
+ unpack { response }
55
55
  end
56
56
 
57
57
  def bulk_update(app_id, variables, headers = nil, &block)
@@ -64,7 +64,7 @@ module Scalingo
64
64
  &block
65
65
  )
66
66
 
67
- unpack(response, key: :variables)
67
+ unpack(:variables) { response }
68
68
  end
69
69
 
70
70
  def bulk_destroy(app_id, variable_ids, headers = nil, &block)
@@ -77,7 +77,7 @@ module Scalingo
77
77
  &block
78
78
  )
79
79
 
80
- unpack(response)
80
+ unpack { response }
81
81
  end
82
82
  end
83
83
  end
@@ -10,7 +10,7 @@ module Scalingo
10
10
  &block
11
11
  )
12
12
 
13
- unpack(response, key: :events)
13
+ unpack(:events) { response }
14
14
  end
15
15
 
16
16
  def for(app_id, payload = {}, headers = nil, &block)
@@ -23,7 +23,7 @@ module Scalingo
23
23
  &block
24
24
  )
25
25
 
26
- unpack(response, key: :events)
26
+ unpack(:events) { response }
27
27
  end
28
28
 
29
29
  def types(headers = nil, &block)
@@ -36,7 +36,7 @@ module Scalingo
36
36
  &block
37
37
  )
38
38
 
39
- unpack(response, key: :event_types)
39
+ unpack(:event_types) { response }
40
40
  end
41
41
 
42
42
  def categories(headers = nil, &block)
@@ -49,7 +49,7 @@ module Scalingo
49
49
  &block
50
50
  )
51
51
 
52
- unpack(response, key: :event_categories)
52
+ unpack(:event_categories) { response }
53
53
  end
54
54
  end
55
55
  end
@@ -10,7 +10,7 @@ module Scalingo
10
10
  &block
11
11
  )
12
12
 
13
- unpack(response)
13
+ unpack { response }
14
14
  end
15
15
 
16
16
  def archives(app_id, headers = nil, &block)
@@ -23,7 +23,7 @@ module Scalingo
23
23
  &block
24
24
  )
25
25
 
26
- unpack(response, key: :archives)
26
+ unpack(:archives) { response }
27
27
  end
28
28
 
29
29
  ## Helper method to avoid having to manually chain two operations
@@ -1,4 +1,5 @@
1
1
  require "scalingo/api/endpoint"
2
+ require "active_support"
2
3
  require "active_support/core_ext/hash/indifferent_access"
3
4
 
4
5
  module Scalingo
@@ -22,7 +23,7 @@ module Scalingo
22
23
  &block
23
24
  )
24
25
 
25
- unpack(response)
26
+ unpack { response }
26
27
  end
27
28
 
28
29
  def types(headers = nil, &block)
@@ -35,7 +36,7 @@ module Scalingo
35
36
  &block
36
37
  )
37
38
 
38
- unpack(response, key: :metrics)
39
+ unpack(:metrics) { response }
39
40
  end
40
41
  end
41
42
  end
@@ -12,7 +12,7 @@ module Scalingo
12
12
  &block
13
13
  )
14
14
 
15
- unpack(response, key: :notifiers)
15
+ unpack(:notifiers) { response }
16
16
  end
17
17
 
18
18
  def find(app_id, notifier_id, headers = nil, &block)
@@ -25,7 +25,7 @@ module Scalingo
25
25
  &block
26
26
  )
27
27
 
28
- unpack(response, key: :notifier)
28
+ unpack(:notifier) { response }
29
29
  end
30
30
 
31
31
  def create(app_id, payload = {}, headers = nil, &block)
@@ -38,7 +38,7 @@ module Scalingo
38
38
  &block
39
39
  )
40
40
 
41
- unpack(response, key: :notifier)
41
+ unpack(:notifier) { response }
42
42
  end
43
43
 
44
44
  def update(app_id, notifier_id, payload = {}, headers = nil, &block)
@@ -51,7 +51,7 @@ module Scalingo
51
51
  &block
52
52
  )
53
53
 
54
- unpack(response, key: :notifier)
54
+ unpack(:notifier) { response }
55
55
  end
56
56
 
57
57
  def destroy(app_id, notifier_id, headers = nil, &block)
@@ -64,7 +64,7 @@ module Scalingo
64
64
  &block
65
65
  )
66
66
 
67
- unpack(response)
67
+ unpack { response }
68
68
  end
69
69
 
70
70
  def test(app_id, notifier_id, headers = nil, &block)
@@ -77,7 +77,7 @@ module Scalingo
77
77
  &block
78
78
  )
79
79
 
80
- unpack(response)
80
+ unpack { response }
81
81
  end
82
82
 
83
83
  def platforms(headers = nil, &block)
@@ -90,7 +90,7 @@ module Scalingo
90
90
  &block
91
91
  )
92
92
 
93
- unpack(response, key: :notification_platforms)
93
+ unpack(:notification_platforms) { response }
94
94
  end
95
95
  end
96
96
  end
@@ -20,7 +20,7 @@ module Scalingo
20
20
  &block
21
21
  )
22
22
 
23
- unpack(response, key: :operation)
23
+ unpack(:operation) { response }
24
24
  end
25
25
  end
26
26
  end
@@ -12,7 +12,7 @@ module Scalingo
12
12
  &block
13
13
  )
14
14
 
15
- unpack(response, key: :scm_repo_link)
15
+ unpack(:scm_repo_link) { response }
16
16
  end
17
17
 
18
18
  def create(app_id, payload = {}, headers = nil, &block)
@@ -25,7 +25,7 @@ module Scalingo
25
25
  &block
26
26
  )
27
27
 
28
- unpack(response, key: :scm_repo_link)
28
+ unpack(:scm_repo_link) { response }
29
29
  end
30
30
 
31
31
  def update(app_id, payload = {}, headers = nil, &block)
@@ -38,7 +38,7 @@ module Scalingo
38
38
  &block
39
39
  )
40
40
 
41
- unpack(response, key: :scm_repo_link)
41
+ unpack(:scm_repo_link) { response }
42
42
  end
43
43
 
44
44
  def destroy(app_id, headers = nil, &block)
@@ -51,7 +51,7 @@ module Scalingo
51
51
  &block
52
52
  )
53
53
 
54
- unpack(response, key: :scm_repo_link)
54
+ unpack(:scm_repo_link) { response }
55
55
  end
56
56
 
57
57
  def deploy(app_id, branch, headers = nil, &block)
@@ -64,7 +64,7 @@ module Scalingo
64
64
  &block
65
65
  )
66
66
 
67
- unpack(response, key: :deployment)
67
+ unpack(:deployment) { response }
68
68
  end
69
69
 
70
70
  def review_app(review_app, pull_request_id, headers = nil, &block)
@@ -77,7 +77,7 @@ module Scalingo
77
77
  &block
78
78
  )
79
79
 
80
- unpack(response, key: :review_app)
80
+ unpack(:review_app) { response }
81
81
  end
82
82
 
83
83
  def branches(app_id, headers = nil, &block)
@@ -90,7 +90,7 @@ module Scalingo
90
90
  &block
91
91
  )
92
92
 
93
- unpack(response, key: :branches)
93
+ unpack(:branches) { response }
94
94
  end
95
95
 
96
96
  def pulls(app_id, headers = nil, &block)
@@ -103,7 +103,7 @@ module Scalingo
103
103
  &block
104
104
  )
105
105
 
106
- unpack(response, key: :pulls)
106
+ unpack(:pulls) { response }
107
107
  end
108
108
  end
109
109
  end
@@ -4,6 +4,7 @@ module Scalingo
4
4
  class Regional < API::Client
5
5
  require "scalingo/regional/addons"
6
6
  require "scalingo/regional/apps"
7
+ require "scalingo/regional/autoscalers"
7
8
  require "scalingo/regional/collaborators"
8
9
  require "scalingo/regional/containers"
9
10
  require "scalingo/regional/deployments"
@@ -19,6 +20,7 @@ module Scalingo
19
20
  register_handlers!(
20
21
  addons: Addons,
21
22
  apps: Apps,
23
+ autoscalers: Autoscalers,
22
24
  collaborators: Collaborators,
23
25
  containers: Containers,
24
26
  deployments: Deployments,
@@ -0,0 +1,31 @@
1
+ require "scalingo/bearer_token"
2
+
3
+ module Scalingo
4
+ module TokenHolder
5
+ def self.included(base)
6
+ base.attr_reader :token
7
+ end
8
+
9
+ def token=(input)
10
+ @token = input.is_a?(BearerToken) ? input : BearerToken.new(input.to_s, raise_on_expired: config.raise_on_expired_token)
11
+ end
12
+
13
+ def authenticated?
14
+ token.present? && !token.expired?
15
+ end
16
+
17
+ def authenticate_with_bearer_token(bearer_token, expires_at:, raise_on_expired_token:)
18
+ self.token = if expires_at
19
+ token = bearer_token.is_a?(BearerToken) ? bearer_token.value : bearer_token.to_s
20
+
21
+ BearerToken.new(
22
+ token,
23
+ expires_at: expires_at,
24
+ raise_on_expired: raise_on_expired_token,
25
+ )
26
+ else
27
+ bearer_token
28
+ end
29
+ end
30
+ end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module Scalingo
2
- VERSION = "3.0.0.beta.2"
2
+ VERSION = "3.1.0"
3
3
  end
@@ -0,0 +1,24 @@
1
+ {
2
+ "path": "/users/stop_free_trial",
3
+ "method": "post",
4
+ "request": {
5
+ "headers": {
6
+ "Authorization": "Bearer the-bearer-token"
7
+ }
8
+ },
9
+ "response": {
10
+ "status": 200,
11
+ "headers": {
12
+ "Date": "Thu, 27 Aug 2020 10:46:32 GMT",
13
+ "Etag": "W/\"08bf4adf1520d417f7f03783353a3b5d\"",
14
+ "Content-Type": "application/json; charset=utf-8",
15
+ "Transfer-Encoding": "chunked",
16
+ "Connection": "keep-alive",
17
+ "Cache-Control": "max-age=0, private, must-revalidate",
18
+ "Referrer-Policy": "strict-origin-when-cross-origin"
19
+ },
20
+ "json_body": {
21
+ "message": "ok"
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "path": "/apps/5ed10967884fef000f5e4fff/addons/ad-6733873b-1628-4b8e-8e74-c30f1c3f3b63/token",
3
+ "method": "post",
4
+ "request": {
5
+ "headers": {
6
+ "Authorization": "Bearer the-bearer-token"
7
+ }
8
+ },
9
+ "response": {
10
+ "status": 200,
11
+ "headers": {
12
+ "Date": "Fri, 29 May 2020 13:09:00 GMT",
13
+ "Etag": "W/\"ece1ff1263aad47584f356e20127cf3b\"",
14
+ "Content-Type": "application/json; charset=utf-8",
15
+ "Transfer-Encoding": "chunked",
16
+ "Connection": "keep-alive",
17
+ "Cache-Control": "max-age=0, private, must-revalidate",
18
+ "Referrer-Policy": "strict-origin-when-cross-origin"
19
+ },
20
+ "json_body": {
21
+ "addon": {
22
+ "id": "ad-6733873b-1628-4b8e-8e74-c30f1c3f3b63",
23
+ "app_id": "5ed10967884fef000f5e4fff",
24
+ "resource_id": "some_example_5629",
25
+ "addon_provider": {
26
+ "id": "postgresql",
27
+ "name": "PostgreSQL",
28
+ "logo_url": "//cdn.scalingo.com/addons/Scalingo_Postgresql.svg"
29
+ },
30
+ "plan": {
31
+ "id": "5d1e03873e6b3b000eefa827",
32
+ "name": "postgresql-sandbox",
33
+ "display_name": "Sandbox",
34
+ "price": 0.0,
35
+ "description": "<p>Pouet</p>\n",
36
+ "position": null,
37
+ "on_demand": false,
38
+ "disabled": false,
39
+ "disabled_alternative_plan_id": null,
40
+ "sku": "ovh-st-fr1-postgresql-sandbox"
41
+ },
42
+ "provisioned_at": "2020-05-29T13:08:58.103Z",
43
+ "deprovisioned_at": null,
44
+ "status": "provisioning",
45
+ "token": "eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJTY2FsaW5nbyIsImlhdCI6MTU5Mjg0MjQ3OSwidXVpZCI6InVzLTY3NmJiMGMxLTFjYTktNDY4Mi04ZWUxLTI1NzQyMmU5ZWFiNSIsInJuZCI6IjlhZGZlMzNlNDUxNzNmZTBiNjg4ZjQxZTY4OTg1OWQ0IiwiZXhwIjoxNTkyODQ2MDc5LCJhZGRvbl91dWlkIjoiYWQtNTRlYzczMzItYjViOS00MGUyLTg2NWQtYmNkYTg1Yzc2Y2I2In0.-rYijDhFRWcycSFLcCbdQD3tg9rh1MhXE_rTvlOtQt-48BJcPmxH9Wpazzp7tkspYrx8jfIrWrALoujvW33WVw"
46
+ }
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "path": "/apps/5ed10967884fef000f5e4fff/addons/wrong-addon-id/token",
3
+ "method": "post",
4
+ "request": {
5
+ "headers": {
6
+ "Authorization": "Bearer the-bearer-token"
7
+ }
8
+ },
9
+ "response": {
10
+ "status": 404,
11
+ "headers": {
12
+ "Date": "Fri, 29 May 2020 13:08:59 GMT",
13
+ "Content-Type": "application/json; charset=utf-8",
14
+ "Transfer-Encoding": "chunked",
15
+ "Connection": "keep-alive",
16
+ "Cache-Control": "no-cache",
17
+ "Referrer-Policy": "strict-origin-when-cross-origin"
18
+ },
19
+ "json_body": {
20
+ "resource": "addon",
21
+ "error": "not found"
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "app_id": "example-running-application",
3
+ "id": "sc-5418fe67-885d-4e50-8cbe-9a9a2d2d690a",
4
+ "not_found_id": "wrong-autoscaler-id",
5
+ "create": {
6
+ "invalid": {
7
+ "container_type": "web",
8
+ "min_containers": 3,
9
+ "metric": "rpm_per_container"
10
+ },
11
+ "valid": {
12
+ "container_type": "web",
13
+ "min_containers": 3,
14
+ "max_containers": 7,
15
+ "metric": "rpm_per_container",
16
+ "target": 150
17
+ }
18
+ },
19
+ "update": {
20
+ "invalid": {
21
+ "metric": "unknown"
22
+ },
23
+ "valid": {
24
+ "target": 200
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "path": "/apps/example-running-application/autoscalers",
3
+ "method": "post",
4
+ "request": {
5
+ "headers": {
6
+ "Accept": "application/json",
7
+ "Authorization": "Bearer the-bearer-token",
8
+ "Content-Type": "application/json"
9
+ },
10
+ "json_body": {
11
+ "autoscaler": {
12
+ "container_type": "web",
13
+ "min_containers": 3,
14
+ "max_containers": 7,
15
+ "metric": "rpm_per_container",
16
+ "target": 150
17
+ }
18
+ }
19
+ },
20
+ "response": {
21
+ "status": 201,
22
+ "headers": {
23
+ "Date": "Fri, 28 Aug 2020 11:48:29 GMT",
24
+ "Etag": "W/\"90db16192d022937f3968d284f6e4f77\"",
25
+ "Content-Type": "application/json; charset=utf-8",
26
+ "Transfer-Encoding": "chunked",
27
+ "Connection": "keep-alive",
28
+ "Cache-Control": "max-age=0, private, must-revalidate",
29
+ "Referrer-Policy": "strict-origin-when-cross-origin"
30
+ },
31
+ "json_body": {
32
+ "autoscaler": {
33
+ "created_at": "2020-08-28T11:48:29.963295861Z",
34
+ "updated_at": "2020-08-28T11:48:29.963296084Z",
35
+ "id": "sc-5418fe67-885d-4e50-8cbe-9a9a2d2d690a",
36
+ "app_id": "5f48ecb6f112e2000ef34f14",
37
+ "container_type": "web",
38
+ "alert_id_scale_up": "al-ecf1cff6-c415-4e7b-8a86-e0ef697b2d87",
39
+ "alert_id_scale_down": "al-6ef726e8-d69b-44e1-8d67-3acef2a4802d",
40
+ "min_containers": 3,
41
+ "max_containers": 7,
42
+ "last_scale": "0001-01-01T00:00:00Z",
43
+ "disabled": false,
44
+ "metric": "rpm_per_container",
45
+ "target": 150
46
+ }
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "path": "/apps/example-running-application/autoscalers",
3
+ "method": "post",
4
+ "request": {
5
+ "headers": {
6
+ "Accept": "application/json",
7
+ "Authorization": "Bearer the-bearer-token",
8
+ "Content-Type": "application/json"
9
+ },
10
+ "json_body": {
11
+ "autoscaler": {
12
+ "container_type": "web",
13
+ "min_containers": 3,
14
+ "metric": "rpm_per_container"
15
+ }
16
+ }
17
+ },
18
+ "response": {
19
+ "status": 500,
20
+ "headers": {
21
+ "Date": "Fri, 28 Aug 2020 11:48:29 GMT",
22
+ "Content-Type": "application/json; charset=utf-8",
23
+ "Transfer-Encoding": "chunked",
24
+ "Connection": "keep-alive",
25
+ "Cache-Control": "no-cache",
26
+ "Referrer-Policy": "strict-origin-when-cross-origin"
27
+ },
28
+ "json_body": {
29
+ "error": "Internal error occured, we're on it!"
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "path": "/apps/example-running-application/autoscalers/sc-5418fe67-885d-4e50-8cbe-9a9a2d2d690a",
3
+ "method": "delete",
4
+ "request": {
5
+ "headers": {
6
+ "Accept": "application/json",
7
+ "Authorization": "Bearer the-bearer-token"
8
+ }
9
+ },
10
+ "response": {
11
+ "status": 204,
12
+ "headers": {
13
+ "Date": "Fri, 28 Aug 2020 11:48:32 GMT",
14
+ "Connection": "keep-alive",
15
+ "Cache-Control": "no-cache",
16
+ "Referrer-Policy": "strict-origin-when-cross-origin"
17
+ },
18
+ "body": ""
19
+ }
20
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "path": "/apps/example-running-application/autoscalers/wrong-autoscaler-id",
3
+ "method": "delete",
4
+ "request": {
5
+ "headers": {
6
+ "Accept": "application/json",
7
+ "Authorization": "Bearer the-bearer-token"
8
+ }
9
+ },
10
+ "response": {
11
+ "status": 404,
12
+ "headers": {
13
+ "Date": "Fri, 28 Aug 2020 11:48:31 GMT",
14
+ "Content-Type": "application/json; charset=utf-8",
15
+ "Transfer-Encoding": "chunked",
16
+ "Connection": "keep-alive",
17
+ "Cache-Control": "no-cache",
18
+ "Referrer-Policy": "strict-origin-when-cross-origin"
19
+ },
20
+ "json_body": {
21
+ "resource": "autoscaler",
22
+ "error": "not found"
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "path": "/apps/example-running-application/autoscalers/sc-5418fe67-885d-4e50-8cbe-9a9a2d2d690a",
3
+ "method": "get",
4
+ "request": {
5
+ "headers": {
6
+ "Accept": "application/json",
7
+ "Authorization": "Bearer the-bearer-token"
8
+ }
9
+ },
10
+ "response": {
11
+ "status": 200,
12
+ "headers": {
13
+ "Date": "Fri, 28 Aug 2020 11:48:30 GMT",
14
+ "Etag": "W/\"c870c2f312d82030bde9ae13625f746d\"",
15
+ "Content-Type": "application/json; charset=utf-8",
16
+ "Transfer-Encoding": "chunked",
17
+ "Connection": "keep-alive",
18
+ "Cache-Control": "max-age=0, private, must-revalidate",
19
+ "Referrer-Policy": "strict-origin-when-cross-origin"
20
+ },
21
+ "json_body": {
22
+ "autoscaler": {
23
+ "created_at": "2020-08-28T11:48:29.963Z",
24
+ "updated_at": "2020-08-28T11:48:29.963Z",
25
+ "id": "sc-5418fe67-885d-4e50-8cbe-9a9a2d2d690a",
26
+ "app_id": "5f48ecb6f112e2000ef34f14",
27
+ "container_type": "web",
28
+ "alert_id_scale_up": "al-ecf1cff6-c415-4e7b-8a86-e0ef697b2d87",
29
+ "alert_id_scale_down": "al-6ef726e8-d69b-44e1-8d67-3acef2a4802d",
30
+ "min_containers": 3,
31
+ "max_containers": 7,
32
+ "last_scale": "0001-01-01T00:00:00Z",
33
+ "disabled": false,
34
+ "metric": "rpm_per_container",
35
+ "target": 150
36
+ }
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "path": "/apps/example-running-application/autoscalers/wrong-autoscaler-id",
3
+ "method": "get",
4
+ "request": {
5
+ "headers": {
6
+ "Accept": "application/json",
7
+ "Authorization": "Bearer the-bearer-token"
8
+ }
9
+ },
10
+ "response": {
11
+ "status": 404,
12
+ "headers": {
13
+ "Date": "Fri, 28 Aug 2020 11:48:30 GMT",
14
+ "Content-Type": "application/json; charset=utf-8",
15
+ "Transfer-Encoding": "chunked",
16
+ "Connection": "keep-alive",
17
+ "Cache-Control": "no-cache",
18
+ "Referrer-Policy": "strict-origin-when-cross-origin"
19
+ },
20
+ "json_body": {
21
+ "resource": "autoscaler",
22
+ "error": "not found"
23
+ }
24
+ }
25
+ }