scalingo 3.3.0 → 3.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd6577391c3a1b7c40866c6fbcc56eff45216d448f415ceb16a4ebfbe8ce4f38
4
- data.tar.gz: 02d3d754ec2c0216b95a254621d5d06a09114131a6ea661699124039b6ead7c7
3
+ metadata.gz: 90d46c83c5910349a51d707d80748ed81a542947e95397ce34f52c0f75a0bd56
4
+ data.tar.gz: e6e2840344c04d9ea78ef69dbfadfb601f4dd1c7c62f3af511c16a0652f6b1d2
5
5
  SHA512:
6
- metadata.gz: d11cd9d73cba2c8890949db5fb3e9f450ae5db662e7a5f9c91e7dedfeb2f96be72468b1f56000a0dd250379d1b979572283c4e3ef866fef72556e0563852f331
7
- data.tar.gz: 3b3cf9f52ba33b05d14941c5e83aa0ef618bf0b85339a1b55212336b162131ea49265cfa9d051f591886f67d988473c7927108ea6595ea9d70792cffd2a19307
6
+ metadata.gz: 7f166cbc46cd1ef4237e72765fb69348374f1c0d5f6e42bc3c544ff2f8926c3832a115d135241e2f3dd5a679297ce9b5a0196af80660d189d57aba3b9b11ab3f
7
+ data.tar.gz: f261a4617f0dc6f8ef3158ac918386020bb6243d93a89f315efb1a338bc7348287f23d7ae3307f61c9e29eef673f4fe41c23343d168cc3fd8ebb526530b15187
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 3.4.0 - 2023-01-26
4
+
5
+ * New: Add `databases#upgrade` endpoint for database API ([#51](https://github.com/Scalingo/scalingo-ruby-api/pull/51))
6
+
3
7
  ## 3.3.0 - 2023-01-03
4
8
 
5
9
  * 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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Scalingo
2
- VERSION = "3.3.0"
2
+ VERSION = "3.4.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
+ }
@@ -20,4 +20,20 @@ RSpec.describe Scalingo::RegionalDatabase::Databases do
20
20
  it_behaves_like "a client error"
21
21
  end
22
22
  end
23
+
24
+ describe_method "upgrade" do
25
+ context "success" do
26
+ let(:arguments) { [meta[:id]] }
27
+ let(:stub_pattern) { "upgrade-202" }
28
+
29
+ it_behaves_like "a singular object response", 202
30
+ end
31
+
32
+ context "failure" do
33
+ let(:arguments) { [meta[:id]] }
34
+ let(:stub_pattern) { "upgrade-400" }
35
+
36
+ it_behaves_like "a client error"
37
+ end
38
+ end
23
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scalingo
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leo Unbekandt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-01-03 00:00:00.000000000 Z
12
+ date: 2023-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -428,6 +428,8 @@ files:
428
428
  - samples/regional_database/databases/_meta.json
429
429
  - samples/regional_database/databases/find-200.json
430
430
  - samples/regional_database/databases/find-400.json
431
+ - samples/regional_database/databases/upgrade-202.json
432
+ - samples/regional_database/databases/upgrade-400.json
431
433
  - scalingo.gemspec
432
434
  - spec/scalingo/api/client_spec.rb
433
435
  - spec/scalingo/api/endpoint_spec.rb