droplet_kit 3.13.1 → 3.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/droplet_kit/client.rb +2 -0
- data/lib/droplet_kit/error_handling_resourcable.rb +2 -0
- data/lib/droplet_kit/mappings/account_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/action_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/balance_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/cdn_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/certificate_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/container_registry_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/container_registry_repository_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/container_registry_repository_tag_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/database_backup_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/database_backup_restore_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/database_cluster_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/database_connection_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/database_connection_pool_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/database_eviction_policy_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/database_firewall_rule_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/database_maintenance_window_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/database_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/database_replica_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/database_sql_mode_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/database_user_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/database_user_reset_auth_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/domain_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/domain_record_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/droplet_mapping.rb +3 -0
- data/lib/droplet_kit/mappings/droplet_upgrade_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/error_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/firewall_inbound_rule_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/firewall_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/firewall_outbound_rule_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/firewall_pending_change_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/firewall_rule_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/floating_ip_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/forwarding_rule_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/health_check_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/image_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/invoice_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/kernel_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/kubernetes_cluster_mapping.rb +3 -0
- data/lib/droplet_kit/mappings/kubernetes_maintenance_policy_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/kubernetes_node_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/kubernetes_node_pool_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/kubernetes_options_mapping.rb +4 -1
- data/lib/droplet_kit/mappings/links_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/load_balancer_mapping.rb +5 -0
- data/lib/droplet_kit/mappings/network_detail_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/network_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/project_assignment_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/project_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/region_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/size_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/snapshot_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/ssh_key_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/sticky_session_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/tag_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/tagged_droplets_resources_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/tagged_images_resources_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/tagged_resources_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/volume_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/vpc_mapping.rb +2 -0
- data/lib/droplet_kit/mappings/vpc_member_mapping.rb +2 -0
- data/lib/droplet_kit/models/account.rb +2 -0
- data/lib/droplet_kit/models/action.rb +2 -0
- data/lib/droplet_kit/models/balance.rb +2 -0
- data/lib/droplet_kit/models/base_model.rb +2 -0
- data/lib/droplet_kit/models/cdn.rb +2 -0
- data/lib/droplet_kit/models/certificate.rb +2 -0
- data/lib/droplet_kit/models/container_registry.rb +2 -0
- data/lib/droplet_kit/models/container_registry_repository.rb +2 -0
- data/lib/droplet_kit/models/container_registry_repository_tag.rb +2 -0
- data/lib/droplet_kit/models/database.rb +2 -0
- data/lib/droplet_kit/models/database_backup.rb +2 -0
- data/lib/droplet_kit/models/database_cluster.rb +2 -0
- data/lib/droplet_kit/models/database_connection.rb +2 -0
- data/lib/droplet_kit/models/database_connection_pool.rb +2 -0
- data/lib/droplet_kit/models/database_eviction_policy.rb +2 -0
- data/lib/droplet_kit/models/database_firewall_rule.rb +2 -0
- data/lib/droplet_kit/models/database_maintenance_window.rb +2 -0
- data/lib/droplet_kit/models/database_replica.rb +2 -0
- data/lib/droplet_kit/models/database_sql_mode.rb +2 -0
- data/lib/droplet_kit/models/database_user.rb +2 -0
- data/lib/droplet_kit/models/database_user_mysql_settings.rb +2 -0
- data/lib/droplet_kit/models/database_user_reset_auth.rb +2 -0
- data/lib/droplet_kit/models/domain.rb +2 -0
- data/lib/droplet_kit/models/domain_record.rb +2 -0
- data/lib/droplet_kit/models/droplet.rb +3 -0
- data/lib/droplet_kit/models/droplet_upgrade.rb +2 -0
- data/lib/droplet_kit/models/firewall.rb +2 -0
- data/lib/droplet_kit/models/firewall_inbound_rule.rb +2 -0
- data/lib/droplet_kit/models/firewall_outbound_rule.rb +2 -0
- data/lib/droplet_kit/models/firewall_pending_change.rb +2 -0
- data/lib/droplet_kit/models/firewall_rule.rb +2 -0
- data/lib/droplet_kit/models/floating_ip.rb +2 -0
- data/lib/droplet_kit/models/forwarding_rule.rb +2 -0
- data/lib/droplet_kit/models/health_check.rb +2 -0
- data/lib/droplet_kit/models/image.rb +2 -0
- data/lib/droplet_kit/models/invoice.rb +2 -0
- data/lib/droplet_kit/models/kernel.rb +2 -0
- data/lib/droplet_kit/models/kubernetes_cluster.rb +3 -1
- data/lib/droplet_kit/models/kubernetes_maintenance_policy.rb +2 -0
- data/lib/droplet_kit/models/kubernetes_node.rb +2 -0
- data/lib/droplet_kit/models/kubernetes_node_pool.rb +2 -0
- data/lib/droplet_kit/models/kubernetes_options.rb +2 -0
- data/lib/droplet_kit/models/links.rb +2 -0
- data/lib/droplet_kit/models/load_balancer.rb +4 -0
- data/lib/droplet_kit/models/meta_information.rb +2 -0
- data/lib/droplet_kit/models/network.rb +2 -0
- data/lib/droplet_kit/models/network_hash.rb +2 -0
- data/lib/droplet_kit/models/pagination_information.rb +2 -0
- data/lib/droplet_kit/models/project.rb +2 -0
- data/lib/droplet_kit/models/project_assignment.rb +2 -0
- data/lib/droplet_kit/models/region.rb +2 -0
- data/lib/droplet_kit/models/size.rb +2 -0
- data/lib/droplet_kit/models/snapshot.rb +2 -0
- data/lib/droplet_kit/models/ssh_key.rb +2 -0
- data/lib/droplet_kit/models/sticky_session.rb +2 -0
- data/lib/droplet_kit/models/tag.rb +2 -0
- data/lib/droplet_kit/models/tagged_droplets_resources.rb +2 -0
- data/lib/droplet_kit/models/tagged_images_resources.rb +2 -0
- data/lib/droplet_kit/models/tagged_resources.rb +2 -0
- data/lib/droplet_kit/models/volume.rb +2 -0
- data/lib/droplet_kit/models/vpc.rb +2 -0
- data/lib/droplet_kit/models/vpc_member.rb +2 -0
- data/lib/droplet_kit/paginated_resource.rb +2 -0
- data/lib/droplet_kit/resources/account_resource.rb +3 -1
- data/lib/droplet_kit/resources/action_resource.rb +3 -1
- data/lib/droplet_kit/resources/balance_resource.rb +3 -1
- data/lib/droplet_kit/resources/cdn_resource.rb +2 -0
- data/lib/droplet_kit/resources/certificate_resource.rb +2 -0
- data/lib/droplet_kit/resources/container_registry_repository_resource.rb +26 -25
- data/lib/droplet_kit/resources/container_registry_resource.rb +22 -21
- data/lib/droplet_kit/resources/database_resource.rb +2 -0
- data/lib/droplet_kit/resources/domain_record_resource.rb +2 -0
- data/lib/droplet_kit/resources/domain_resource.rb +2 -0
- data/lib/droplet_kit/resources/droplet_action_resource.rb +2 -0
- data/lib/droplet_kit/resources/droplet_resource.rb +2 -0
- data/lib/droplet_kit/resources/droplet_upgrade_resource.rb +3 -1
- data/lib/droplet_kit/resources/firewall_resource.rb +2 -0
- data/lib/droplet_kit/resources/floating_ip_action_resource.rb +3 -1
- data/lib/droplet_kit/resources/floating_ip_resource.rb +3 -1
- data/lib/droplet_kit/resources/image_action_resource.rb +2 -0
- data/lib/droplet_kit/resources/image_resource.rb +3 -1
- data/lib/droplet_kit/resources/invoice_resource.rb +13 -11
- data/lib/droplet_kit/resources/kubernetes_cluster_resource.rb +16 -1
- data/lib/droplet_kit/resources/kubernetes_options_resource.rb +2 -0
- data/lib/droplet_kit/resources/load_balancer_resource.rb +2 -0
- data/lib/droplet_kit/resources/project_resource.rb +2 -0
- data/lib/droplet_kit/resources/region_resource.rb +2 -0
- data/lib/droplet_kit/resources/size_resource.rb +2 -0
- data/lib/droplet_kit/resources/snapshot_resource.rb +3 -1
- data/lib/droplet_kit/resources/ssh_key_resource.rb +2 -0
- data/lib/droplet_kit/resources/tag_resource.rb +2 -0
- data/lib/droplet_kit/resources/volume_action_resource.rb +3 -1
- data/lib/droplet_kit/resources/volume_resource.rb +2 -0
- data/lib/droplet_kit/resources/vpc_resource.rb +2 -0
- data/lib/droplet_kit/utils.rb +2 -0
- data/lib/droplet_kit/version.rb +3 -1
- data/lib/droplet_kit.rb +2 -0
- data/lib/tasks/resource_doc.rake +2 -0
- metadata +5 -5
@@ -1,15 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module DropletKit
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
class InvoiceResource < ResourceKit::Resource
|
5
|
+
include ErrorHandlingResourcable
|
6
|
+
|
7
|
+
resources do
|
8
|
+
action :list, 'GET /v2/customers/my/invoices' do
|
9
|
+
handler(200) { |response| InvoiceMapping.extract_collection(response.body, :read) }
|
10
|
+
end
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
end
|
12
|
+
action :find, 'GET v2/customers/my/invoices/:id' do
|
13
|
+
handler(200) { |response| InvoiceMapping.extract_collection(response.body, :find) }
|
13
14
|
end
|
14
15
|
end
|
15
|
-
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module DropletKit
|
2
4
|
class KubernetesClusterResource < ResourceKit::Resource
|
3
5
|
include ErrorHandlingResourcable
|
@@ -13,7 +15,20 @@ module DropletKit
|
|
13
15
|
end
|
14
16
|
|
15
17
|
action :create, 'POST /v2/kubernetes/clusters' do
|
16
|
-
body
|
18
|
+
body do |object|
|
19
|
+
# This ensures that both a hash and an instance of KubernetesNodePool can be passed
|
20
|
+
# into the node_pools array
|
21
|
+
#
|
22
|
+
# Ex:
|
23
|
+
# KubernetesCluster.new(node_pools: [{}])
|
24
|
+
# or
|
25
|
+
# KubernetesCluster.new(node_pools: [KubernetesNodePool.new()])
|
26
|
+
if object.respond_to?(:node_pools) && object.node_pools.respond_to?(:map)
|
27
|
+
object.node_pools = object.node_pools.map(&:to_hash)
|
28
|
+
end
|
29
|
+
|
30
|
+
KubernetesClusterMapping.representation_for(:create, object)
|
31
|
+
end
|
17
32
|
handler(201) { |response, cluster| KubernetesClusterMapping.extract_into_object(cluster, response.body, :read) }
|
18
33
|
handler(422) { |response| ErrorMapping.fail_with(FailedCreate, response.body) }
|
19
34
|
end
|
data/lib/droplet_kit/utils.rb
CHANGED
data/lib/droplet_kit/version.rb
CHANGED
data/lib/droplet_kit.rb
CHANGED
data/lib/tasks/resource_doc.rake
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.1
|
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:
|
11
|
+
date: 2022-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.2.
|
47
|
+
version: 0.2.8
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.2.
|
54
|
+
version: 0.2.8
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: faraday
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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
|