droplet_kit 3.13.0 → 3.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/lib/droplet_kit/mappings/droplet_mapping.rb +1 -0
- data/lib/droplet_kit/mappings/kubernetes_cluster_mapping.rb +1 -0
- data/lib/droplet_kit/mappings/kubernetes_options_mapping.rb +2 -1
- data/lib/droplet_kit/mappings/load_balancer_mapping.rb +3 -0
- data/lib/droplet_kit/models/droplet.rb +1 -0
- data/lib/droplet_kit/models/kubernetes_cluster.rb +1 -1
- data/lib/droplet_kit/models/load_balancer.rb +2 -0
- data/lib/droplet_kit/resources/kubernetes_cluster_resource.rb +14 -1
- data/lib/droplet_kit/resources/project_resource.rb +1 -1
- data/lib/droplet_kit/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fa0c9cc44fd5cdd1d1759d1a9b05132e8f435183ec4a1a1c50204c5480d188d
|
4
|
+
data.tar.gz: 1484e8319b240f2c5d9a875c5a87bc8525779e9aab991aaa9e69a13f377297ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a7934357d0b29035c5b9d3d6a858cd52a43ebd99dc090e63aa1f78644269d590834fe50fbee3545805a908701d1501529c8f11a04d117cf936c0638f63b94d6
|
7
|
+
data.tar.gz: af9834af90b2f38b7bfc9e5c28c892a405a1b9b178d07792c1eade9525fd4689535fd34f06dda8c5640d333ea64df7684eddd06347b6ba88607716029ba0bf0d
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# DropletKit
|
2
|
-
[![Build Status](https://
|
2
|
+
[![Build Status](https://github.com/digitalocean/droplet_kit/workflows/CI/badge.svg?branch=main)](https://github.com/digitalocean/droplet_kit/actions)
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/droplet_kit.svg)](https://badge.fury.io/rb/droplet_kit)
|
4
4
|
|
5
5
|
DropletKit is the official [DigitalOcean V2 API](https://developers.digitalocean.com/v2/) client. It supports everything the API can do with a simple interface written in Ruby.
|
@@ -284,7 +284,8 @@ inbound_rule = DropletKit::FirewallInboundRule.new(
|
|
284
284
|
ports: '0',
|
285
285
|
sources: {
|
286
286
|
tags: ['frontend', 'backend'],
|
287
|
-
load_balancer_uids: ['d2d3920a-9d45-41b0-b018-d15e18ec60a4']
|
287
|
+
load_balancer_uids: ['d2d3920a-9d45-41b0-b018-d15e18ec60a4'],
|
288
|
+
kubernetes_ids: ['a47b6fb1-4791-4b29-aae1-2b1b9f68a2da']
|
288
289
|
}
|
289
290
|
)
|
290
291
|
|
@@ -38,6 +38,7 @@ module DropletKit
|
|
38
38
|
property :ssh_keys, scopes: [:create]
|
39
39
|
property :backups, scopes: [:create]
|
40
40
|
property :monitoring, scopes: [:create]
|
41
|
+
property :with_droplet_agent, scopes: [:create]
|
41
42
|
property :ipv6, scopes: [:create]
|
42
43
|
property :user_data, scopes: [:create]
|
43
44
|
property :private_networking, scopes: [:create]
|
@@ -5,11 +5,12 @@ module DropletKit
|
|
5
5
|
mapping KubernetesOptions
|
6
6
|
root_key singular: 'options', scopes: [:read]
|
7
7
|
|
8
|
-
Version = Struct.new(:slug, :kubernetes_version)
|
8
|
+
Version = Struct.new(:slug, :kubernetes_version, :supported_features)
|
9
9
|
property :versions, plural: true, scopes: [:read] do
|
10
10
|
mapping Version
|
11
11
|
property :slug, scopes: [:read]
|
12
12
|
property :kubernetes_version, scopes: [:read]
|
13
|
+
property :supported_features, scopes: [:read]
|
13
14
|
end
|
14
15
|
|
15
16
|
Region = Struct.new(:name, :slug)
|
@@ -13,6 +13,7 @@ module DropletKit
|
|
13
13
|
property :created_at
|
14
14
|
property :region, include: RegionMapping
|
15
15
|
property :size
|
16
|
+
property :size_unit
|
16
17
|
property :vpc_uuid
|
17
18
|
end
|
18
19
|
|
@@ -27,11 +28,13 @@ module DropletKit
|
|
27
28
|
property :sticky_sessions, include: StickySessionMapping
|
28
29
|
property :health_check, include: HealthCheckMapping
|
29
30
|
property :forwarding_rules, plural: true, include: ForwardingRuleMapping
|
31
|
+
property :disable_lets_encrypt_dns_records
|
30
32
|
end
|
31
33
|
|
32
34
|
scoped :update, :create do
|
33
35
|
property :region
|
34
36
|
property :size
|
37
|
+
property :size_unit
|
35
38
|
end
|
36
39
|
|
37
40
|
scoped :create do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module DropletKit
|
2
2
|
class KubernetesCluster < BaseModel
|
3
|
-
[:id, :name, :region, :version, :auto_upgrade, :cluster_subnet, :service_subnet, :ipv4, :endpoint, :tags, :maintenance_policy, :node_pools, :vpc_uuid].each do |key|
|
3
|
+
[:id, :name, :region, :version, :auto_upgrade, :cluster_subnet, :service_subnet, :ipv4, :endpoint, :tags, :maintenance_policy, :node_pools, :vpc_uuid, :ha].each do |key|
|
4
4
|
attribute(key)
|
5
5
|
end
|
6
6
|
end
|
@@ -9,9 +9,11 @@ module DropletKit
|
|
9
9
|
attribute :tag
|
10
10
|
attribute :region
|
11
11
|
attribute :size
|
12
|
+
attribute :size_unit
|
12
13
|
attribute :redirect_http_to_https, Boolean, :default => false
|
13
14
|
attribute :enable_proxy_protocol, Boolean, :default => false
|
14
15
|
attribute :enable_backend_keepalive, Boolean, :default => false
|
16
|
+
attribute :disable_lets_encrypt_dns_records, Boolean, :default => false
|
15
17
|
attribute :droplet_ids
|
16
18
|
attribute :sticky_sessions, StickySession
|
17
19
|
attribute :health_check
|
@@ -13,7 +13,20 @@ module DropletKit
|
|
13
13
|
end
|
14
14
|
|
15
15
|
action :create, 'POST /v2/kubernetes/clusters' do
|
16
|
-
body
|
16
|
+
body do |object|
|
17
|
+
# This ensures that both a hash and an instance of KubernetesNodePool can be passed
|
18
|
+
# into the node_pools array
|
19
|
+
#
|
20
|
+
# Ex:
|
21
|
+
# KubernetesCluster.new(node_pools: [{}])
|
22
|
+
# or
|
23
|
+
# KubernetesCluster.new(node_pools: [KubernetesNodePool.new()])
|
24
|
+
if object.respond_to?(:node_pools) && object.node_pools.respond_to?(:map)
|
25
|
+
object.node_pools = object.node_pools.map(&:to_hash)
|
26
|
+
end
|
27
|
+
|
28
|
+
KubernetesClusterMapping.representation_for(:create, object)
|
29
|
+
end
|
17
30
|
handler(201) { |response, cluster| KubernetesClusterMapping.extract_into_object(cluster, response.body, :read) }
|
18
31
|
handler(422) { |response| ErrorMapping.fail_with(FailedCreate, response.body) }
|
19
32
|
end
|
@@ -49,7 +49,7 @@ module DropletKit
|
|
49
49
|
resources.to_a.map do |resource|
|
50
50
|
if resource.is_a?(String) && DropletKit::BaseModel.valid_urn?(resource)
|
51
51
|
resource
|
52
|
-
elsif resource.
|
52
|
+
elsif resource.respond_to?(:urn) && resource.urn && DropletKit::BaseModel.valid_urn?(resource.urn)
|
53
53
|
resource.urn
|
54
54
|
else
|
55
55
|
raise DropletKit::Error.new("cannot assign resource without valid urn: #{resource}")
|
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.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DigitalOcean API Engineering team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|
@@ -324,7 +324,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
324
324
|
- !ruby/object:Gem::Version
|
325
325
|
version: '0'
|
326
326
|
requirements: []
|
327
|
-
rubygems_version: 3.
|
327
|
+
rubygems_version: 3.1.6
|
328
328
|
signing_key:
|
329
329
|
specification_version: 4
|
330
330
|
summary: Droplet Kit is the official Ruby library for DigitalOcean's API
|