scalingo 3.2.0 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +1 -1
- data/CHANGELOG.md +5 -0
- data/README.md +4 -0
- data/lib/scalingo/core_client.rb +7 -0
- data/lib/scalingo/regional_database/backups.rb +1 -1
- data/lib/scalingo/version.rb +1 -1
- data/samples/regional_database/backups/create-201.json +9 -7
- data/spec/scalingo/core_client_spec.rb +23 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd6577391c3a1b7c40866c6fbcc56eff45216d448f415ceb16a4ebfbe8ce4f38
|
4
|
+
data.tar.gz: 02d3d754ec2c0216b95a254621d5d06a09114131a6ea661699124039b6ead7c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d11cd9d73cba2c8890949db5fb3e9f450ae5db662e7a5f9c91e7dedfeb2f96be72468b1f56000a0dd250379d1b979572283c4e3ef866fef72556e0563852f331
|
7
|
+
data.tar.gz: 3b3cf9f52ba33b05d14941c5e83aa0ef618bf0b85339a1b55212336b162131ea49265cfa9d051f591886f67d988473c7927108ea6595ea9d70792cffd2a19307
|
data/.github/workflows/ruby.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
## 3.3.0 - 2023-01-03
|
4
|
+
|
5
|
+
* Bugfix: response of Backups#create was not properly unpacked ([#44](https://github.com/Scalingo/scalingo-ruby-api/issues/44))
|
6
|
+
* New: Add default region for database API ([#45](https://github.com/Scalingo/scalingo-ruby-api/issues/44))
|
7
|
+
|
3
8
|
## 3.2.0 - 2022-12-23
|
4
9
|
|
5
10
|
* Removal: `Scalingo::Client#agora_fr1` had been removed since the region no longer exists.
|
data/README.md
CHANGED
@@ -174,6 +174,10 @@ scalingo.db_api_osc_fr1.backups.for(addon_id)
|
|
174
174
|
|
175
175
|
# get URL to download backup archive
|
176
176
|
scalingo.db_api_osc_fr1.backups.archive(addon_id, backup_id)
|
177
|
+
|
178
|
+
# you can omit the region to use the default one
|
179
|
+
scalingo.databases.find(addon_id)
|
180
|
+
|
177
181
|
```
|
178
182
|
|
179
183
|
## Development
|
data/lib/scalingo/core_client.rb
CHANGED
@@ -41,6 +41,10 @@ module Scalingo
|
|
41
41
|
public_send(name || config.default_region)
|
42
42
|
end
|
43
43
|
|
44
|
+
def database_region(name = nil)
|
45
|
+
public_send(name || "db_api_#{config.default_region}")
|
46
|
+
end
|
47
|
+
|
44
48
|
## Authentication helpers / Token management
|
45
49
|
def authenticate_with(access_token: nil, bearer_token: nil, expires_at: nil)
|
46
50
|
if !access_token && !bearer_token
|
@@ -102,5 +106,8 @@ module Scalingo
|
|
102
106
|
def_delegator :region, :notifiers
|
103
107
|
def_delegator :region, :operations
|
104
108
|
def_delegator :region, :scm_repo_links
|
109
|
+
|
110
|
+
def_delegator :database_region, :databases
|
111
|
+
def_delegator :database_region, :backups
|
105
112
|
end
|
106
113
|
end
|
data/lib/scalingo/version.rb
CHANGED
@@ -18,13 +18,15 @@
|
|
18
18
|
"Referrer-Policy": "strict-origin-when-cross-origin"
|
19
19
|
},
|
20
20
|
"json_body": {
|
21
|
-
"
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
21
|
+
"database_backup": {
|
22
|
+
"id": "5b8b36104ffb090be1ac3ce1",
|
23
|
+
"created_at": "2019-07-18T03:00:00.178+02:00",
|
24
|
+
"name": "20180902010000_kibana-3938",
|
25
|
+
"size": 0,
|
26
|
+
"status": "pending",
|
27
|
+
"database_id": "597601234ffb097af4f3099b",
|
28
|
+
"type": "postgresql"
|
29
|
+
}
|
28
30
|
}
|
29
31
|
}
|
30
32
|
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe Scalingo::CoreClient do
|
4
|
+
subject { described_class.new }
|
5
|
+
|
6
|
+
describe "#database_region" do
|
7
|
+
it "forwards call to the specified region" do
|
8
|
+
allow(subject).to receive("db_api_osc_secnum_fr1")
|
9
|
+
|
10
|
+
subject.database_region("db_api_osc_secnum_fr1")
|
11
|
+
|
12
|
+
expect(subject).to have_received("db_api_osc_secnum_fr1")
|
13
|
+
end
|
14
|
+
|
15
|
+
it "forwards call to default db_api region" do
|
16
|
+
allow(subject).to receive("db_api_#{subject.config.default_region}")
|
17
|
+
|
18
|
+
subject.database_region
|
19
|
+
|
20
|
+
expect(subject).to have_received("db_api_#{subject.config.default_region}")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
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.
|
4
|
+
version: 3.3.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:
|
12
|
+
date: 2023-01-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -443,6 +443,7 @@ files:
|
|
443
443
|
- spec/scalingo/billing_spec.rb
|
444
444
|
- spec/scalingo/client_spec.rb
|
445
445
|
- spec/scalingo/configuration_spec.rb
|
446
|
+
- spec/scalingo/core_client_spec.rb
|
446
447
|
- spec/scalingo/regional/addons_spec.rb
|
447
448
|
- spec/scalingo/regional/apps_spec.rb
|
448
449
|
- spec/scalingo/regional/autoscalers_spec.rb
|
@@ -486,7 +487,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
486
487
|
- !ruby/object:Gem::Version
|
487
488
|
version: '0'
|
488
489
|
requirements: []
|
489
|
-
rubygems_version: 3.
|
490
|
+
rubygems_version: 3.4.1
|
490
491
|
signing_key:
|
491
492
|
specification_version: 4
|
492
493
|
summary: Ruby client for Scalingo APIs
|
@@ -505,6 +506,7 @@ test_files:
|
|
505
506
|
- spec/scalingo/billing_spec.rb
|
506
507
|
- spec/scalingo/client_spec.rb
|
507
508
|
- spec/scalingo/configuration_spec.rb
|
509
|
+
- spec/scalingo/core_client_spec.rb
|
508
510
|
- spec/scalingo/regional/addons_spec.rb
|
509
511
|
- spec/scalingo/regional/apps_spec.rb
|
510
512
|
- spec/scalingo/regional/autoscalers_spec.rb
|