scaleway_api 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scaleway_api/image.rb +4 -2
- data/lib/scaleway_api/server.rb +5 -3
- data/lib/scaleway_api/version.rb +1 -1
- data/lib/scaleway_api.rb +7 -16
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f2d3ce352ad484895a1d81456b781767037f893c7f5f6bb92deef623074f7be
|
4
|
+
data.tar.gz: 63a12ad82495fc58b65c79409e0a0d316afff3ea35cdce2915629eccaf981d1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: befae7adeb21b3fdc527ec9fcd6c7fa51966c50974cbe6e2a1900ac0d4df996ec36b187281785a2ef2664b00673ced21b517ad51a9f81e776e79c437c89c5d34
|
7
|
+
data.tar.gz: daa97c4f8f3777753593c041dcccddc36d14341a745f10b6d507544c4b774654e5953e8f39ea1ae79b09297faccf5cb40e31357b89b5bf2a3687c6a1642767ae
|
data/lib/scaleway_api/image.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'activeresource'
|
4
|
+
|
3
5
|
module ScalewayApi
|
4
6
|
class Image < ActiveResource::Base # rubocop:disable Style/Documentation
|
5
|
-
self.site = "https://api.scaleway.com/instance/v1/zones/#{ScalewayApi.
|
6
|
-
headers['X-Auth-Token'] = ScalewayApi.
|
7
|
+
self.site = "https://api.scaleway.com/instance/v1/zones/#{ScalewayApi.config.region}"
|
8
|
+
headers['X-Auth-Token'] = ScalewayApi.config.api_key
|
7
9
|
self.include_format_in_path = false
|
8
10
|
end
|
9
11
|
end
|
data/lib/scaleway_api/server.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'activeresource'
|
4
|
+
|
3
5
|
module ScalewayApi
|
4
|
-
class
|
5
|
-
self.site = "https://api.scaleway.com/instance/v1/zones/#{ScalewayApi.
|
6
|
-
headers['X-Auth-Token'] = ScalewayApi.
|
6
|
+
class Server < ActiveResource::Base # rubocop:disable Style/Documentation
|
7
|
+
self.site = "https://api.scaleway.com/instance/v1/zones/#{ScalewayApi.config.region}"
|
8
|
+
headers['X-Auth-Token'] = ScalewayApi.config.api_key
|
7
9
|
self.include_format_in_path = false
|
8
10
|
end
|
9
11
|
end
|
data/lib/scaleway_api/version.rb
CHANGED
data/lib/scaleway_api.rb
CHANGED
@@ -1,24 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'dry-configurable'
|
4
|
+
require_relative 'scaleway_api/image'
|
5
|
+
require_relative 'scaleway_api/server'
|
3
6
|
require_relative 'scaleway_api/version'
|
4
7
|
|
5
8
|
module ScalewayApi # rubocop:disable Style/Documentation
|
6
|
-
|
7
|
-
|
8
|
-
class << self
|
9
|
-
attr_accessor :configuration
|
10
|
-
end
|
9
|
+
extend Dry::Configurable
|
11
10
|
|
12
|
-
|
13
|
-
self.configuration ||= Configuration.new
|
14
|
-
yield(configuration)
|
15
|
-
end
|
16
|
-
|
17
|
-
class Configuration # rubocop:disable Style/Documentation
|
18
|
-
attr_accessor :region, :api_key
|
11
|
+
class Error < StandardError; end
|
19
12
|
|
20
|
-
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
13
|
+
setting :region
|
14
|
+
setting :api_key
|
24
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scaleway_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas_Skywalker
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '6.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: dry-configurable
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.1'
|
27
41
|
description: Ruby bindings for the Scaleway API.
|
28
42
|
email:
|
29
43
|
- LukasSkywalker@users.noreply.github.com
|