scalingo 3.3.0 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/dependabot.yml +17 -0
  3. data/.github/workflows/publish.yml +6 -3
  4. data/.github/workflows/ruby.yml +3 -3
  5. data/.rubocop.yml +9 -21
  6. data/CHANGELOG.md +10 -0
  7. data/README.md +1 -1
  8. data/lib/scalingo/api/client.rb +6 -15
  9. data/lib/scalingo/api/response.rb +3 -3
  10. data/lib/scalingo/auth/tokens.rb +2 -2
  11. data/lib/scalingo/auth.rb +1 -1
  12. data/lib/scalingo/billing.rb +1 -1
  13. data/lib/scalingo/client.rb +6 -6
  14. data/lib/scalingo/configuration.rb +3 -3
  15. data/lib/scalingo/core_client.rb +2 -3
  16. data/lib/scalingo/regional/addons.rb +1 -1
  17. data/lib/scalingo/regional.rb +1 -1
  18. data/lib/scalingo/regional_database/databases.rb +13 -0
  19. data/lib/scalingo/regional_database.rb +1 -1
  20. data/lib/scalingo/token_holder.rb +1 -1
  21. data/lib/scalingo/version.rb +1 -1
  22. data/samples/regional_database/backups/_meta.json +1 -1
  23. data/samples/regional_database/backups/archive-200.json +2 -2
  24. data/samples/regional_database/backups/archive-400.json +1 -1
  25. data/samples/regional_database/backups/create-201.json +1 -1
  26. data/samples/regional_database/backups/create-400.json +1 -1
  27. data/samples/regional_database/backups/for-200.json +1 -1
  28. data/samples/regional_database/backups/for-400.json +1 -1
  29. data/samples/regional_database/databases/_meta.json +1 -1
  30. data/samples/regional_database/databases/find-200.json +5 -3
  31. data/samples/regional_database/databases/find-400.json +1 -1
  32. data/samples/regional_database/databases/upgrade-202.json +39 -0
  33. data/samples/regional_database/databases/upgrade-400.json +24 -0
  34. data/scalingo.gemspec +4 -7
  35. metadata +13 -92
  36. data/spec/scalingo/api/client_spec.rb +0 -256
  37. data/spec/scalingo/api/endpoint_spec.rb +0 -45
  38. data/spec/scalingo/api/response_spec.rb +0 -301
  39. data/spec/scalingo/auth/keys_spec.rb +0 -58
  40. data/spec/scalingo/auth/scm_integrations_spec.rb +0 -58
  41. data/spec/scalingo/auth/tokens_spec.rb +0 -74
  42. data/spec/scalingo/auth/two_factor_auth_spec.rb +0 -69
  43. data/spec/scalingo/auth/user_spec.rb +0 -31
  44. data/spec/scalingo/auth_spec.rb +0 -15
  45. data/spec/scalingo/bearer_token_spec.rb +0 -72
  46. data/spec/scalingo/billing/profile_spec.rb +0 -55
  47. data/spec/scalingo/billing_spec.rb +0 -11
  48. data/spec/scalingo/client_spec.rb +0 -93
  49. data/spec/scalingo/configuration_spec.rb +0 -57
  50. data/spec/scalingo/core_client_spec.rb +0 -23
  51. data/spec/scalingo/regional/addons_spec.rb +0 -169
  52. data/spec/scalingo/regional/apps_spec.rb +0 -137
  53. data/spec/scalingo/regional/autoscalers_spec.rb +0 -84
  54. data/spec/scalingo/regional/collaborators_spec.rb +0 -69
  55. data/spec/scalingo/regional/containers_spec.rb +0 -67
  56. data/spec/scalingo/regional/deployments_spec.rb +0 -45
  57. data/spec/scalingo/regional/domains_spec.rb +0 -84
  58. data/spec/scalingo/regional/environment_spec.rb +0 -77
  59. data/spec/scalingo/regional/events_spec.rb +0 -65
  60. data/spec/scalingo/regional/logs_spec.rb +0 -39
  61. data/spec/scalingo/regional/metrics_spec.rb +0 -46
  62. data/spec/scalingo/regional/notifiers_spec.rb +0 -113
  63. data/spec/scalingo/regional/operations_spec.rb +0 -27
  64. data/spec/scalingo/regional/scm_repo_links_spec.rb +0 -48
  65. data/spec/scalingo/regional_database/backups_spec.rb +0 -58
  66. data/spec/scalingo/regional_database/databases_spec.rb +0 -23
  67. data/spec/scalingo/regional_database_spec.rb +0 -11
  68. data/spec/scalingo/regional_spec.rb +0 -14
  69. data/spec/scalingo/token_holder_spec.rb +0 -81
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd6577391c3a1b7c40866c6fbcc56eff45216d448f415ceb16a4ebfbe8ce4f38
4
- data.tar.gz: 02d3d754ec2c0216b95a254621d5d06a09114131a6ea661699124039b6ead7c7
3
+ metadata.gz: 98e17d7eb47e72aad2aefb6a07c6096542b1debd1533b15353b79ae7681c95f0
4
+ data.tar.gz: f224c29ecdeaba0fe9bba5d3bd3898fb9ed34de6c1ad6a58fddab89fcce2cedc
5
5
  SHA512:
6
- metadata.gz: d11cd9d73cba2c8890949db5fb3e9f450ae5db662e7a5f9c91e7dedfeb2f96be72468b1f56000a0dd250379d1b979572283c4e3ef866fef72556e0563852f331
7
- data.tar.gz: 3b3cf9f52ba33b05d14941c5e83aa0ef618bf0b85339a1b55212336b162131ea49265cfa9d051f591886f67d988473c7927108ea6595ea9d70792cffd2a19307
6
+ metadata.gz: bd981473899a583adab7c970aa2255fd0f5c70d112d3358241d512e7c300f7d710d5cc6c71ac73050f07bfe36b7aad0bf74fadc8219cfd7dbf5e245e1a9f80f5
7
+ data.tar.gz: 524aea983112d2e5a323151fc974104b8890e7b133f0bcaaa974a7884f93e76caf2f5a78894e831092467f4ea1de4ab5b91d1a3c9ec1becd856e9ff94e499073
@@ -0,0 +1,17 @@
1
+ name: Dependabot auto-approve
2
+ on: pull_request
3
+
4
+ permissions:
5
+ # Mandatory for both the auto-merge enabling and approval steps
6
+ pull-requests: write
7
+ # Mandatory for the auto-merge enabling step
8
+ contents: write
9
+
10
+ jobs:
11
+ dependabot:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Automatically merge Dependabot PRs
15
+ uses: scalingo/ghaction-dependabot-automerge@v1
16
+ env:
17
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -7,15 +7,18 @@ on:
7
7
 
8
8
  jobs:
9
9
  build:
10
+ name: Build + Publish
10
11
  runs-on: ubuntu-latest
11
-
12
+ permissions:
13
+ contents: read
12
14
  steps:
13
- - uses: actions/checkout@v3
15
+ - uses: actions/checkout@v4
14
16
  - name: Set up Ruby
15
17
  uses: ruby/setup-ruby@v1
16
18
  with:
17
- ruby-version: 3.0
19
+ ruby-version: "3.1"
18
20
  bundler-cache: true
21
+ rubygems: "latest"
19
22
  - name: Publish to RubyGems
20
23
  run: |
21
24
  mkdir -p $HOME/.gem
@@ -14,7 +14,7 @@ jobs:
14
14
  lint:
15
15
  runs-on: ubuntu-latest
16
16
  steps:
17
- - uses: actions/checkout@v3
17
+ - uses: actions/checkout@v4
18
18
  - name: Set up Ruby
19
19
  uses: ruby/setup-ruby@v1
20
20
  with:
@@ -27,9 +27,9 @@ jobs:
27
27
  runs-on: ubuntu-latest
28
28
  strategy:
29
29
  matrix:
30
- ruby-version: ['2.6', '2.7', '3.0', '3.2']
30
+ ruby-version: ['3.0', '3.1', '3.2', '3.3']
31
31
  steps:
32
- - uses: actions/checkout@v3
32
+ - uses: actions/checkout@v4
33
33
  - name: Set up Ruby
34
34
  # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
35
35
  # change this to (see https://github.com/ruby/setup-ruby#versioning):
data/.rubocop.yml CHANGED
@@ -1,32 +1,20 @@
1
- inherit_from: []
2
-
3
- inherit_gem:
4
- standard: config/base.yml
5
-
6
1
  require:
7
2
  - standard
3
+ - standard-custom
4
+ - standard-performance
8
5
  - rubocop-performance
9
6
 
7
+ inherit_gem:
8
+ standard: config/base.yml
9
+ standard-custom: config/base.yml
10
+ standard-performance: config/base.yml
11
+
10
12
  AllCops:
13
+ TargetRubyVersion: 3.0
14
+ NewCops: enable
11
15
  SuggestExtensions: false
12
16
  Exclude:
13
17
  - 'node_modules/**/*'
14
18
  - 'tmp/**/*'
15
19
  - 'vendor/**/*'
16
20
  - '.git/**/*'
17
-
18
- Style/TrailingCommaInArguments:
19
- Enabled: true
20
- EnforcedStyleForMultiline: consistent_comma
21
-
22
- Style/TrailingCommaInArrayLiteral:
23
- Enabled: true
24
- EnforcedStyleForMultiline: consistent_comma
25
-
26
- Style/TrailingCommaInHashLiteral:
27
- Enabled: true
28
- EnforcedStyleForMultiline: consistent_comma
29
-
30
- Style/Alias:
31
- Enabled: true
32
- EnforcedStyle: prefer_alias_method
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 3.5.0 - 2023-12-28
4
+
5
+ * Change: update Faraday to 2.x, released about two years ago. The public API of this gem doesn't change, therefore this is not a major release. However, if you manipulate directly faraday's objects, you may encounter breaking changes. Refer to [Faraday's website](https://lostisland.github.io/faraday/) for how to migrate.
6
+ * Compat: drop support for Ruby < 3. The lib is still expected to work for the time being.
7
+ * Compat: include Ruby 3.3 in the test matrix
8
+
9
+ ## 3.4.0 - 2023-01-26
10
+
11
+ * New: Add `databases#upgrade` endpoint for database API ([#51](https://github.com/Scalingo/scalingo-ruby-api/pull/51))
12
+
3
13
  ## 3.3.0 - 2023-01-03
4
14
 
5
15
  * Bugfix: response of Backups#create was not properly unpacked ([#44](https://github.com/Scalingo/scalingo-ruby-api/issues/44))
data/README.md CHANGED
@@ -191,7 +191,7 @@ bundle
191
191
  ### Run tests
192
192
 
193
193
  ```bash
194
- bundle exec rake test
194
+ bundle exec rspec
195
195
  ```
196
196
 
197
197
  ### Release a new version
@@ -29,11 +29,11 @@ module Scalingo
29
29
 
30
30
  def self.register_handler!(method_name, klass)
31
31
  define_method(method_name) do
32
- value = instance_variable_get("@#{method_name}")
32
+ value = instance_variable_get(:"@#{method_name}")
33
33
 
34
34
  if value.nil?
35
35
  value = klass.new(self)
36
- instance_variable_set("@#{method_name}", value)
36
+ instance_variable_set(:"@#{method_name}", value)
37
37
  end
38
38
 
39
39
  value
@@ -54,7 +54,7 @@ module Scalingo
54
54
  def headers
55
55
  hash = {
56
56
  "User-Agent" => config.user_agent,
57
- "Accept" => "application/json",
57
+ "Accept" => "application/json"
58
58
  }
59
59
 
60
60
  if (extra = config.additional_headers).present?
@@ -67,7 +67,7 @@ module Scalingo
67
67
  def connection_options
68
68
  {
69
69
  url: url,
70
- headers: headers,
70
+ headers: headers
71
71
  }
72
72
  end
73
73
 
@@ -106,11 +106,7 @@ module Scalingo
106
106
  @connection = Faraday.new(connection_options) { |conn|
107
107
  conn.response :json, content_type: /\bjson$/, parser_options: {symbolize_names: true}
108
108
  conn.request :json
109
-
110
- if token_holder.token&.value
111
- auth_header = Faraday::Request::Authorization.header "Bearer", token_holder.token.value
112
- conn.headers[Faraday::Request::Authorization::KEY] = auth_header
113
- end
109
+ conn.request :authorization, "Bearer", -> { token_holder.token&.value }
114
110
 
115
111
  conn.adapter(config.faraday_adapter) if config.faraday_adapter
116
112
  }
@@ -123,12 +119,7 @@ module Scalingo
123
119
  @database_connections[database_id] ||= Faraday.new(connection_options) { |conn|
124
120
  conn.response :json, content_type: /\bjson$/, parser_options: {symbolize_names: true}
125
121
  conn.request :json
126
-
127
- bearer_token = token_holder.database_tokens[database_id]&.value
128
- if bearer_token
129
- auth_header = Faraday::Request::Authorization.header "Bearer", bearer_token
130
- conn.headers[Faraday::Request::Authorization::KEY] = auth_header
131
- end
122
+ conn.request :authorization, "Bearer", -> { token_holder.database_tokens[database_id]&.value }
132
123
 
133
124
  conn.adapter(config.faraday_adapter) if config.faraday_adapter
134
125
  }
@@ -1,8 +1,8 @@
1
1
  module Scalingo
2
2
  module API
3
3
  class Response
4
- def self.unpack(client, key: nil, keys: nil, &block)
5
- response = block.call
4
+ def self.unpack(client, key: nil, keys: nil)
5
+ response = yield
6
6
 
7
7
  body = response.body
8
8
  has_hash_body = body.present? && body.respond_to?(:key)
@@ -24,7 +24,7 @@ module Scalingo
24
24
  headers: response.headers,
25
25
  data: data,
26
26
  meta: meta,
27
- full_body: body,
27
+ full_body: body
28
28
  )
29
29
  end
30
30
 
@@ -5,10 +5,10 @@ module Scalingo
5
5
  def exchange(token, headers = nil, &block)
6
6
  data = nil
7
7
 
8
- authorization = Faraday::Request::BasicAuthentication.header("", token)
8
+ authorization = Faraday::Utils.basic_header_from("", token)
9
9
 
10
10
  request_headers = {
11
- Faraday::Request::Authorization::KEY => authorization,
11
+ Faraday::Request::Authorization::KEY => authorization
12
12
  }
13
13
 
14
14
  request_headers.update(headers) if headers
data/lib/scalingo/auth.rb CHANGED
@@ -13,7 +13,7 @@ module Scalingo
13
13
  scm_integrations: ScmIntegrations,
14
14
  tokens: Tokens,
15
15
  two_factor_auth: TwoFactorAuth,
16
- user: User,
16
+ user: User
17
17
  )
18
18
 
19
19
  alias_method :tfa, :two_factor_auth
@@ -5,7 +5,7 @@ module Scalingo
5
5
  require "scalingo/billing/profile"
6
6
 
7
7
  register_handlers!(
8
- profile: Profile,
8
+ profile: Profile
9
9
  )
10
10
  end
11
11
  end
@@ -10,21 +10,21 @@ module Scalingo
10
10
  def auth
11
11
  @auth ||= Auth.new(
12
12
  "https://auth.scalingo.com/v1",
13
- scalingo: self,
13
+ scalingo: self
14
14
  )
15
15
  end
16
16
 
17
17
  def billing
18
18
  @billing ||= Billing.new(
19
19
  "https://cashmachine.scalingo.com",
20
- scalingo: self,
20
+ scalingo: self
21
21
  )
22
22
  end
23
23
 
24
24
  def osc_fr1
25
25
  @osc_fr1 ||= Regional.new(
26
26
  "https://api.osc-fr1.scalingo.com/v1",
27
- scalingo: self,
27
+ scalingo: self
28
28
  )
29
29
  end
30
30
  alias_method :apps_api_osc_fr1, :osc_fr1
@@ -32,7 +32,7 @@ module Scalingo
32
32
  def osc_secnum_fr1
33
33
  @osc_secnum_fr1 ||= Regional.new(
34
34
  "https://api.osc-secnum-fr1.scalingo.com/v1",
35
- scalingo: self,
35
+ scalingo: self
36
36
  )
37
37
  end
38
38
  alias_method :apps_api_osc_secnum_fr1, :osc_secnum_fr1
@@ -40,14 +40,14 @@ module Scalingo
40
40
  def db_api_osc_fr1
41
41
  @db_api_osc_fr1 ||= RegionalDatabase.new(
42
42
  "https://db-api.osc-fr1.scalingo.com/api",
43
- scalingo: self,
43
+ scalingo: self
44
44
  )
45
45
  end
46
46
 
47
47
  def db_api_osc_secnum_fr1
48
48
  @db_api_osc_secnum_fr1 ||= RegionalDatabase.new(
49
49
  "https://db-api.osc-secnum-fr1.scalingo.com/api",
50
- scalingo: self,
50
+ scalingo: self
51
51
  )
52
52
  end
53
53
  end
@@ -37,7 +37,7 @@ module Scalingo
37
37
  :additional_headers,
38
38
 
39
39
  # Specify an adapter for faraday. Leave nil for the default one (Net::HTTP)
40
- :faraday_adapter,
40
+ :faraday_adapter
41
41
  ]
42
42
 
43
43
  ATTRIBUTES.each { |attr| attr_accessor(attr) }
@@ -49,13 +49,13 @@ module Scalingo
49
49
  exchanged_token_validity: 1.hour,
50
50
  raise_on_missing_authentication: true,
51
51
  raise_on_expired_token: false,
52
- additional_headers: {},
52
+ additional_headers: {}
53
53
  )
54
54
  end
55
55
 
56
56
  def initialize(attributes = {}, parent = nil)
57
57
  ATTRIBUTES.each do |name|
58
- public_send("#{name}=", attributes.fetch(name, parent&.public_send(name)))
58
+ public_send(:"#{name}=", attributes.fetch(name, parent&.public_send(name)))
59
59
  end
60
60
  end
61
61
  end
@@ -1,6 +1,5 @@
1
1
  require "forwardable"
2
2
  require "faraday"
3
- require "faraday_middleware"
4
3
  require "scalingo/token_holder"
5
4
  require "scalingo/errors"
6
5
 
@@ -67,7 +66,7 @@ module Scalingo
67
66
  self.token = BearerToken.new(
68
67
  response.data[:token],
69
68
  expires_at: expiration,
70
- raise_on_expired: config.raise_on_expired_token,
69
+ raise_on_expired: config.raise_on_expired_token
71
70
  )
72
71
  end
73
72
 
@@ -78,7 +77,7 @@ module Scalingo
78
77
  authenticate_with_bearer_token(
79
78
  bearer_token,
80
79
  expires_at: expires_at,
81
- raise_on_expired_token: config.raise_on_expired_token,
80
+ raise_on_expired_token: config.raise_on_expired_token
82
81
  )
83
82
 
84
83
  true
@@ -89,7 +89,7 @@ module Scalingo
89
89
  addon_id,
90
90
  token,
91
91
  expires_at: Time.now + 1.hour,
92
- raise_on_expired_token: client.config.raise_on_expired_token,
92
+ raise_on_expired_token: client.config.raise_on_expired_token
93
93
  )
94
94
 
95
95
  response
@@ -31,7 +31,7 @@ module Scalingo
31
31
  metrics: Metrics,
32
32
  notifiers: Notifiers,
33
33
  operations: Operations,
34
- scm_repo_links: ScmRepoLinks,
34
+ scm_repo_links: ScmRepoLinks
35
35
  )
36
36
  end
37
37
  end
@@ -14,5 +14,18 @@ module Scalingo
14
14
 
15
15
  unpack(:database) { response }
16
16
  end
17
+
18
+ def upgrade(id, headers = nil, &block)
19
+ data = nil
20
+
21
+ response = database_connection(id).post(
22
+ "databases/#{id}/upgrade",
23
+ data,
24
+ headers,
25
+ &block
26
+ )
27
+
28
+ unpack(:database) { response }
29
+ end
17
30
  end
18
31
  end
@@ -7,7 +7,7 @@ module Scalingo
7
7
 
8
8
  register_handlers!(
9
9
  databases: Databases,
10
- backups: Backups,
10
+ backups: Backups
11
11
  )
12
12
  end
13
13
  end
@@ -55,7 +55,7 @@ module Scalingo
55
55
  BearerToken.new(
56
56
  token,
57
57
  expires_at: expires_at,
58
- raise_on_expired: raise_on_expired_token,
58
+ raise_on_expired: raise_on_expired_token
59
59
  )
60
60
  end
61
61
  end
@@ -1,3 +1,3 @@
1
1
  module Scalingo
2
- VERSION = "3.3.0"
2
+ VERSION = "3.5.0"
3
3
  end
@@ -1,4 +1,4 @@
1
1
  {
2
- "addon_id": "ad-5ed10967884fef000f5e4fff",
2
+ "addon_id": "63bfe3b600deff4f0516cc12",
3
3
  "backup_id": "5bb95a904ffb096e9a2831b8"
4
4
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "path": "/databases/ad-5ed10967884fef000f5e4fff/backups/5bb95a904ffb096e9a2831b8/archive",
2
+ "path": "/databases/63bfe3b600deff4f0516cc12/backups/5bb95a904ffb096e9a2831b8/archive",
3
3
  "method": "get",
4
4
  "request": {
5
5
  "headers": {
@@ -18,7 +18,7 @@
18
18
  "Referrer-Policy": "strict-origin-when-cross-origin"
19
19
  },
20
20
  "json_body": {
21
- "download_url": "https://regional-database.scalingo.test/databases/ad-5ed10967884fef000f5e4fff/backups/5bb95a904ffb096e9a2831b8/download?token=token1234"
21
+ "download_url": "https://regional-database.scalingo.test/databases/63bfe3b600deff4f0516cc12/backups/5bb95a904ffb096e9a2831b8/download?token=token1234"
22
22
  }
23
23
  }
24
24
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "path": "/databases/ad-5ed10967884fef000f5e4fff/backups/5bb95a904ffb096e9a2831b8/archive",
2
+ "path": "/databases/63bfe3b600deff4f0516cc12/backups/5bb95a904ffb096e9a2831b8/archive",
3
3
  "method": "get",
4
4
  "request": {
5
5
  "headers": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "path": "/databases/ad-5ed10967884fef000f5e4fff/backups",
2
+ "path": "/databases/63bfe3b600deff4f0516cc12/backups",
3
3
  "method": "post",
4
4
  "request": {
5
5
  "headers": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "path": "/databases/ad-5ed10967884fef000f5e4fff/backups",
2
+ "path": "/databases/63bfe3b600deff4f0516cc12/backups",
3
3
  "method": "post",
4
4
  "request": {
5
5
  "headers": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "path": "/databases/ad-5ed10967884fef000f5e4fff/backups",
2
+ "path": "/databases/63bfe3b600deff4f0516cc12/backups",
3
3
  "method": "get",
4
4
  "request": {
5
5
  "headers": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "path": "/databases/ad-5ed10967884fef000f5e4fff/backups",
2
+ "path": "/databases/63bfe3b600deff4f0516cc12/backups",
3
3
  "method": "get",
4
4
  "request": {
5
5
  "headers": {
@@ -1,3 +1,3 @@
1
1
  {
2
- "id": "ad-5ed10967884fef000f5e4fff"
2
+ "id": "63bfe3b600deff4f0516cc12"
3
3
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "path": "/databases/ad-5ed10967884fef000f5e4fff",
2
+ "path": "/databases/63bfe3b600deff4f0516cc12",
3
3
  "method": "get",
4
4
  "request": {
5
5
  "headers": {
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "json_body": {
21
21
  "database": {
22
- "id": "ad-5ed10967884fef000f5e4fff",
22
+ "id": "63bfe3b600deff4f0516cc12",
23
23
  "resource_id": "my-db-123",
24
24
  "app_name": "my-app",
25
25
  "created_at": "2019-02-05T15:38:14.343+01:00",
@@ -38,7 +38,9 @@
38
38
  "instances": [],
39
39
  "readable_version": "3.2.9-1",
40
40
  "periodic_backups_enabled": true,
41
- "periodic_backups_scheduled_at": [0]
41
+ "periodic_backups_scheduled_at": [
42
+ 0
43
+ ]
42
44
  }
43
45
  }
44
46
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "path": "/databases/ad-5ed10967884fef000f5e4fff",
2
+ "path": "/databases/63bfe3b600deff4f0516cc12",
3
3
  "method": "get",
4
4
  "request": {
5
5
  "headers": {
@@ -0,0 +1,39 @@
1
+ {
2
+ "path": "/databases/63bfe3b600deff4f0516cc12/upgrade",
3
+ "method": "post",
4
+ "request": {
5
+ "headers": {
6
+ "Authorization": "Bearer the-bearer-token"
7
+ }
8
+ },
9
+ "response": {
10
+ "status": 202,
11
+ "headers": {
12
+ "Date": "Fri, 29 May 2020 13:08:59 GMT",
13
+ "Etag": "W/\"a9504bb2f6f87c65ff68074ae787831e\"",
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
+ "Location": "https://db-api.osc-st-fr1.st-sc.fr/api/operations/63bef2179307d55a9658cd99"
20
+ },
21
+ "json_body": {
22
+ "message": "Database upgrade to 7.0.5-1 is pending",
23
+ "id": "6335961fb07f4c000fe7461c",
24
+ "created_at": "2022-09-29T12:57:03.372Z",
25
+ "updated_at": "2022-09-29T12:57:03.372Z",
26
+ "database_type_id": "5eea3345d6f2bd5a55e2aad0",
27
+ "major": 7,
28
+ "minor": 0,
29
+ "patch": 5,
30
+ "build": 1,
31
+ "features": [
32
+ "tls"
33
+ ],
34
+ "release_number": 330,
35
+ "allowed_plugins": null,
36
+ "warning_message": ""
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "path": "/databases/63bfe3b600deff4f0516cc12/upgrade",
3
+ "method": "post",
4
+ "request": {
5
+ "headers": {
6
+ "Authorization": "Bearer the-bearer-token"
7
+ }
8
+ },
9
+ "response": {
10
+ "status": 400,
11
+ "headers": {
12
+ "Date": "Fri, 29 May 2020 13:08:59 GMT",
13
+ "Etag": "W/\"a9504bb2f6f87c65ff68074ae787831e\"",
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
+ "error": "unauthorized"
22
+ }
23
+ }
24
+ }
data/scalingo.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  "changelog_uri" => "https://github.com/Scalingo/scalingo-ruby-api/blob/master/CHANGELOG.md",
20
20
  "documentation_uri" => "https://developers.scalingo.com/",
21
21
  "homepage_uri" => "https://www.scalingo.com/",
22
- "source_code_uri" => "https://github.com/Scalingo/scalingo-ruby-api",
22
+ "source_code_uri" => "https://github.com/Scalingo/scalingo-ruby-api"
23
23
  }
24
24
 
25
25
  # Specify which files should be added to the gem when it is released.
@@ -32,18 +32,15 @@ Gem::Specification.new do |s|
32
32
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
33
  s.require_paths = ["lib"]
34
34
 
35
- s.test_files = Dir["spec/**/*_spec.rb"]
36
-
37
35
  s.add_dependency "activesupport", [">= 5", "< 8"]
38
- s.add_dependency "faraday", "~> 1.0"
39
- s.add_dependency "faraday_middleware", "~> 1.0"
36
+ s.add_dependency "faraday", "~> 2.0"
40
37
  s.add_dependency "multi_json", ">= 1.0.3", "~> 1.0"
41
38
 
42
39
  s.add_development_dependency "bundler", "~> 2.0"
43
40
  s.add_development_dependency "rake", "~> 13.0"
44
41
  s.add_development_dependency "rspec", "~> 3.0"
45
- s.add_development_dependency "standard", "~> 1.1.0"
42
+ s.add_development_dependency "standard", "~> 1.32"
46
43
  s.add_development_dependency "rubocop-rspec"
47
44
  s.add_development_dependency "pry", "~> 0.14.1"
48
- s.add_development_dependency "webmock", "~> 3.12.2"
45
+ s.add_development_dependency "webmock", "~> 3.19"
49
46
  end