droplet_kit 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/lib/droplet_kit.rb +3 -0
- data/lib/droplet_kit/client.rb +1 -0
- data/lib/droplet_kit/mappings/container_registry_mapping.rb +11 -0
- data/lib/droplet_kit/mappings/volume_mapping.rb +2 -0
- data/lib/droplet_kit/models/container_registry.rb +7 -0
- data/lib/droplet_kit/models/volume.rb +2 -0
- data/lib/droplet_kit/resources/container_registry_resource.rb +26 -0
- data/lib/droplet_kit/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f529675d7f97e0fe92b4787071a0d608fc414726d99d0f196d17d5c5a6d72714
|
4
|
+
data.tar.gz: 70da3bd332f370dbf1ed58d17e852404410a5a79d55a7ca5404d49fefc1a97b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32144a7341efd9610298826fb4e18d057dbb085fa4aa32d9257c3fa52ca577f2f5a01a48ebf6fe85fe0ad625a5e66a051bfdda8bae00c99b6143dbeee2bcdceb
|
7
|
+
data.tar.gz: e069461935b59cbfc9a917fc2b06d92e018a8dd8fbe1e960fbdbe2047384bb7355f3d6dcb73935c294e92cac1594d232e6932bad4b4f6820e013c27f45a93795
|
data/lib/droplet_kit.rb
CHANGED
@@ -7,6 +7,7 @@ module DropletKit
|
|
7
7
|
|
8
8
|
# Models
|
9
9
|
autoload :BaseModel, 'droplet_kit/models/base_model'
|
10
|
+
autoload :ContainerRegistry, 'droplet_kit/models/container_registry'
|
10
11
|
autoload :Droplet, 'droplet_kit/models/droplet'
|
11
12
|
autoload :Region, 'droplet_kit/models/region'
|
12
13
|
autoload :Image, 'droplet_kit/models/image'
|
@@ -52,6 +53,7 @@ module DropletKit
|
|
52
53
|
# Resources
|
53
54
|
autoload :DropletResource, 'droplet_kit/resources/droplet_resource'
|
54
55
|
autoload :ActionResource, 'droplet_kit/resources/action_resource'
|
56
|
+
autoload :ContainerRegistryResource, 'droplet_kit/resources/container_registry_resource'
|
55
57
|
autoload :DomainResource, 'droplet_kit/resources/domain_resource'
|
56
58
|
autoload :DomainRecordResource, 'droplet_kit/resources/domain_record_resource'
|
57
59
|
autoload :DropletActionResource, 'droplet_kit/resources/droplet_action_resource'
|
@@ -79,6 +81,7 @@ module DropletKit
|
|
79
81
|
|
80
82
|
# JSON Maps
|
81
83
|
autoload :DropletMapping, 'droplet_kit/mappings/droplet_mapping'
|
84
|
+
autoload :ContainerRegistryMapping, 'droplet_kit/mappings/container_registry_mapping'
|
82
85
|
autoload :ImageMapping, 'droplet_kit/mappings/image_mapping'
|
83
86
|
autoload :RegionMapping, 'droplet_kit/mappings/region_mapping'
|
84
87
|
autoload :SizeMapping, 'droplet_kit/mappings/size_mapping'
|
data/lib/droplet_kit/client.rb
CHANGED
@@ -31,6 +31,7 @@ module DropletKit
|
|
31
31
|
actions: ActionResource,
|
32
32
|
cdns: CDNResource,
|
33
33
|
certificates: CertificateResource,
|
34
|
+
container_registry: ContainerRegistryResource,
|
34
35
|
droplets: DropletResource,
|
35
36
|
kubernetes_clusters: KubernetesClusterResource,
|
36
37
|
kubernetes_options: KubernetesOptionsResource,
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module DropletKit
|
2
|
+
class ContainerRegistryResource < ResourceKit::Resource
|
3
|
+
include ErrorHandlingResourcable
|
4
|
+
|
5
|
+
resources do
|
6
|
+
action :get, 'GET /v2/registry' do
|
7
|
+
handler(200) { |response| ContainerRegistryMapping.extract_single(response.body, :read) }
|
8
|
+
end
|
9
|
+
|
10
|
+
action :create, 'POST /v2/registry' do
|
11
|
+
body { |object| ContainerRegistryMapping.representation_for(:create, object) }
|
12
|
+
handler(201) { |response, registry| ContainerRegistryMapping.extract_into_object(registry, response.body, :read) }
|
13
|
+
handler(422) { |response| ErrorMapping.fail_with(FailedCreate, response.body) }
|
14
|
+
end
|
15
|
+
|
16
|
+
action :delete, 'DELETE /v2/registry' do
|
17
|
+
handler(204) { |response| true }
|
18
|
+
end
|
19
|
+
|
20
|
+
action :docker_credentials, 'GET /v2/registry/docker-credentials' do
|
21
|
+
handler(200) { |response| response.body }
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
data/lib/droplet_kit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: droplet_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Ross
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|
@@ -166,6 +166,7 @@ files:
|
|
166
166
|
- lib/droplet_kit/mappings/action_mapping.rb
|
167
167
|
- lib/droplet_kit/mappings/cdn_mapping.rb
|
168
168
|
- lib/droplet_kit/mappings/certificate_mapping.rb
|
169
|
+
- lib/droplet_kit/mappings/container_registry_mapping.rb
|
169
170
|
- lib/droplet_kit/mappings/domain_mapping.rb
|
170
171
|
- lib/droplet_kit/mappings/domain_record_mapping.rb
|
171
172
|
- lib/droplet_kit/mappings/droplet_mapping.rb
|
@@ -209,6 +210,7 @@ files:
|
|
209
210
|
- lib/droplet_kit/models/base_model.rb
|
210
211
|
- lib/droplet_kit/models/cdn.rb
|
211
212
|
- lib/droplet_kit/models/certificate.rb
|
213
|
+
- lib/droplet_kit/models/container_registry.rb
|
212
214
|
- lib/droplet_kit/models/domain.rb
|
213
215
|
- lib/droplet_kit/models/domain_record.rb
|
214
216
|
- lib/droplet_kit/models/droplet.rb
|
@@ -253,6 +255,7 @@ files:
|
|
253
255
|
- lib/droplet_kit/resources/action_resource.rb
|
254
256
|
- lib/droplet_kit/resources/cdn_resource.rb
|
255
257
|
- lib/droplet_kit/resources/certificate_resource.rb
|
258
|
+
- lib/droplet_kit/resources/container_registry_resource.rb
|
256
259
|
- lib/droplet_kit/resources/domain_record_resource.rb
|
257
260
|
- lib/droplet_kit/resources/domain_resource.rb
|
258
261
|
- lib/droplet_kit/resources/droplet_action_resource.rb
|