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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a482f4679dd8fe42fad27bbf85151777108bc2ac4d361c64c2a02480b988bfc
4
- data.tar.gz: ac6c62a63eabbb5cf077fae7578bda59dab98fbb1c086b6b50bbf17dae50e1cc
3
+ metadata.gz: f529675d7f97e0fe92b4787071a0d608fc414726d99d0f196d17d5c5a6d72714
4
+ data.tar.gz: 70da3bd332f370dbf1ed58d17e852404410a5a79d55a7ca5404d49fefc1a97b4
5
5
  SHA512:
6
- metadata.gz: b830d7461f8fb8edcc430aef1e80f0893f6df649402f25489da8221eb484b0028f38feb6b925c15c9da8e339edb638cc58fa0ffd375915d9d2a80497969700c8
7
- data.tar.gz: 73a313dc86a7eb1247ce335abc59bbd394dba2e2b27decda42d247e17c525cc11de7acbd501fe6b6dfd9ef4e7181bee6b59d2e3499f8bd698c65445764d9cdf4
6
+ metadata.gz: 32144a7341efd9610298826fb4e18d057dbb085fa4aa32d9257c3fa52ca577f2f5a01a48ebf6fe85fe0ad625a5e66a051bfdda8bae00c99b6143dbeee2bcdceb
7
+ data.tar.gz: e069461935b59cbfc9a917fc2b06d92e018a8dd8fbe1e960fbdbe2047384bb7355f3d6dcb73935c294e92cac1594d232e6932bad4b4f6820e013c27f45a93795
@@ -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'
@@ -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,11 @@
1
+ module DropletKit
2
+ class ContainerRegistryMapping
3
+ include Kartograph::DSL
4
+ kartograph do
5
+ mapping ContainerRegistry
6
+ root_key singular: 'registry', scopes: [:read]
7
+
8
+ property :name, scopes: [:read, :create]
9
+ end
10
+ end
11
+ end
@@ -16,6 +16,8 @@ module DropletKit
16
16
 
17
17
  property :region, scopes: [:create]
18
18
  property :snapshot_id, scopes: [:create]
19
+ property :filesystem_type, scopes: [:read, :create]
20
+ property :filesystem_label, scopes: [:read, :create]
19
21
  end
20
22
  end
21
23
  end
@@ -0,0 +1,7 @@
1
+ module DropletKit
2
+ class ContainerRegistry < BaseModel
3
+ [:name].each do |key|
4
+ attribute(key)
5
+ end
6
+ end
7
+ end
@@ -7,6 +7,8 @@ module DropletKit
7
7
  attribute :description
8
8
  attribute :size_gigabytes
9
9
  attribute :created_at
10
+ attribute :filesystem_type
11
+ attribute :filesystem_label
10
12
 
11
13
  # Used for creates
12
14
  attribute :snapshot_id
@@ -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
+
@@ -1,3 +1,3 @@
1
1
  module DropletKit
2
- VERSION = "3.2.0"
2
+ VERSION = "3.3.0"
3
3
  end
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.2.0
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-10-02 00:00:00.000000000 Z
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