droplet_kit 3.16.0 → 3.16.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/lib/droplet_kit/client.rb +2 -0
  3. data/lib/droplet_kit/error_handling_resourcable.rb +2 -0
  4. data/lib/droplet_kit/mappings/account_mapping.rb +2 -0
  5. data/lib/droplet_kit/mappings/action_mapping.rb +2 -0
  6. data/lib/droplet_kit/mappings/balance_mapping.rb +2 -0
  7. data/lib/droplet_kit/mappings/cdn_mapping.rb +2 -0
  8. data/lib/droplet_kit/mappings/certificate_mapping.rb +2 -0
  9. data/lib/droplet_kit/mappings/container_registry_mapping.rb +2 -0
  10. data/lib/droplet_kit/mappings/container_registry_repository_mapping.rb +2 -0
  11. data/lib/droplet_kit/mappings/container_registry_repository_tag_mapping.rb +2 -0
  12. data/lib/droplet_kit/mappings/database_backup_mapping.rb +2 -0
  13. data/lib/droplet_kit/mappings/database_backup_restore_mapping.rb +2 -0
  14. data/lib/droplet_kit/mappings/database_cluster_mapping.rb +2 -0
  15. data/lib/droplet_kit/mappings/database_connection_mapping.rb +2 -0
  16. data/lib/droplet_kit/mappings/database_connection_pool_mapping.rb +2 -0
  17. data/lib/droplet_kit/mappings/database_eviction_policy_mapping.rb +2 -0
  18. data/lib/droplet_kit/mappings/database_firewall_rule_mapping.rb +2 -0
  19. data/lib/droplet_kit/mappings/database_maintenance_window_mapping.rb +2 -0
  20. data/lib/droplet_kit/mappings/database_mapping.rb +2 -0
  21. data/lib/droplet_kit/mappings/database_replica_mapping.rb +2 -0
  22. data/lib/droplet_kit/mappings/database_sql_mode_mapping.rb +2 -0
  23. data/lib/droplet_kit/mappings/database_user_mapping.rb +2 -0
  24. data/lib/droplet_kit/mappings/database_user_reset_auth_mapping.rb +2 -0
  25. data/lib/droplet_kit/mappings/domain_mapping.rb +2 -0
  26. data/lib/droplet_kit/mappings/domain_record_mapping.rb +2 -0
  27. data/lib/droplet_kit/mappings/droplet_mapping.rb +2 -0
  28. data/lib/droplet_kit/mappings/droplet_upgrade_mapping.rb +2 -0
  29. data/lib/droplet_kit/mappings/error_mapping.rb +2 -0
  30. data/lib/droplet_kit/mappings/firewall_inbound_rule_mapping.rb +2 -0
  31. data/lib/droplet_kit/mappings/firewall_mapping.rb +2 -0
  32. data/lib/droplet_kit/mappings/firewall_outbound_rule_mapping.rb +2 -0
  33. data/lib/droplet_kit/mappings/firewall_pending_change_mapping.rb +2 -0
  34. data/lib/droplet_kit/mappings/firewall_rule_mapping.rb +2 -0
  35. data/lib/droplet_kit/mappings/floating_ip_mapping.rb +2 -0
  36. data/lib/droplet_kit/mappings/forwarding_rule_mapping.rb +2 -0
  37. data/lib/droplet_kit/mappings/health_check_mapping.rb +2 -0
  38. data/lib/droplet_kit/mappings/image_mapping.rb +2 -0
  39. data/lib/droplet_kit/mappings/invoice_mapping.rb +2 -0
  40. data/lib/droplet_kit/mappings/kernel_mapping.rb +2 -0
  41. data/lib/droplet_kit/mappings/kubernetes_cluster_mapping.rb +2 -0
  42. data/lib/droplet_kit/mappings/kubernetes_maintenance_policy_mapping.rb +2 -0
  43. data/lib/droplet_kit/mappings/kubernetes_node_mapping.rb +2 -0
  44. data/lib/droplet_kit/mappings/kubernetes_node_pool_mapping.rb +2 -0
  45. data/lib/droplet_kit/mappings/kubernetes_options_mapping.rb +2 -0
  46. data/lib/droplet_kit/mappings/links_mapping.rb +2 -0
  47. data/lib/droplet_kit/mappings/load_balancer_mapping.rb +2 -0
  48. data/lib/droplet_kit/mappings/network_detail_mapping.rb +2 -0
  49. data/lib/droplet_kit/mappings/network_mapping.rb +2 -0
  50. data/lib/droplet_kit/mappings/project_assignment_mapping.rb +2 -0
  51. data/lib/droplet_kit/mappings/project_mapping.rb +2 -0
  52. data/lib/droplet_kit/mappings/region_mapping.rb +2 -0
  53. data/lib/droplet_kit/mappings/size_mapping.rb +2 -0
  54. data/lib/droplet_kit/mappings/snapshot_mapping.rb +2 -0
  55. data/lib/droplet_kit/mappings/ssh_key_mapping.rb +2 -0
  56. data/lib/droplet_kit/mappings/sticky_session_mapping.rb +2 -0
  57. data/lib/droplet_kit/mappings/tag_mapping.rb +2 -0
  58. data/lib/droplet_kit/mappings/tagged_droplets_resources_mapping.rb +2 -0
  59. data/lib/droplet_kit/mappings/tagged_images_resources_mapping.rb +2 -0
  60. data/lib/droplet_kit/mappings/tagged_resources_mapping.rb +2 -0
  61. data/lib/droplet_kit/mappings/volume_mapping.rb +2 -0
  62. data/lib/droplet_kit/mappings/vpc_mapping.rb +2 -0
  63. data/lib/droplet_kit/mappings/vpc_member_mapping.rb +2 -0
  64. data/lib/droplet_kit/models/account.rb +2 -0
  65. data/lib/droplet_kit/models/action.rb +2 -0
  66. data/lib/droplet_kit/models/balance.rb +2 -0
  67. data/lib/droplet_kit/models/base_model.rb +2 -0
  68. data/lib/droplet_kit/models/cdn.rb +2 -0
  69. data/lib/droplet_kit/models/certificate.rb +2 -0
  70. data/lib/droplet_kit/models/container_registry.rb +2 -0
  71. data/lib/droplet_kit/models/container_registry_repository.rb +2 -0
  72. data/lib/droplet_kit/models/container_registry_repository_tag.rb +2 -0
  73. data/lib/droplet_kit/models/database.rb +2 -0
  74. data/lib/droplet_kit/models/database_backup.rb +2 -0
  75. data/lib/droplet_kit/models/database_cluster.rb +2 -0
  76. data/lib/droplet_kit/models/database_connection.rb +2 -0
  77. data/lib/droplet_kit/models/database_connection_pool.rb +2 -0
  78. data/lib/droplet_kit/models/database_eviction_policy.rb +2 -0
  79. data/lib/droplet_kit/models/database_firewall_rule.rb +2 -0
  80. data/lib/droplet_kit/models/database_maintenance_window.rb +2 -0
  81. data/lib/droplet_kit/models/database_replica.rb +2 -0
  82. data/lib/droplet_kit/models/database_sql_mode.rb +2 -0
  83. data/lib/droplet_kit/models/database_user.rb +2 -0
  84. data/lib/droplet_kit/models/database_user_mysql_settings.rb +2 -0
  85. data/lib/droplet_kit/models/database_user_reset_auth.rb +2 -0
  86. data/lib/droplet_kit/models/domain.rb +2 -0
  87. data/lib/droplet_kit/models/domain_record.rb +2 -0
  88. data/lib/droplet_kit/models/droplet.rb +2 -0
  89. data/lib/droplet_kit/models/droplet_upgrade.rb +2 -0
  90. data/lib/droplet_kit/models/firewall.rb +2 -0
  91. data/lib/droplet_kit/models/firewall_inbound_rule.rb +2 -0
  92. data/lib/droplet_kit/models/firewall_outbound_rule.rb +2 -0
  93. data/lib/droplet_kit/models/firewall_pending_change.rb +2 -0
  94. data/lib/droplet_kit/models/firewall_rule.rb +2 -0
  95. data/lib/droplet_kit/models/floating_ip.rb +2 -0
  96. data/lib/droplet_kit/models/forwarding_rule.rb +2 -0
  97. data/lib/droplet_kit/models/health_check.rb +2 -0
  98. data/lib/droplet_kit/models/image.rb +2 -0
  99. data/lib/droplet_kit/models/invoice.rb +2 -0
  100. data/lib/droplet_kit/models/kernel.rb +2 -0
  101. data/lib/droplet_kit/models/kubernetes_cluster.rb +2 -0
  102. data/lib/droplet_kit/models/kubernetes_maintenance_policy.rb +2 -0
  103. data/lib/droplet_kit/models/kubernetes_node.rb +2 -0
  104. data/lib/droplet_kit/models/kubernetes_node_pool.rb +2 -0
  105. data/lib/droplet_kit/models/kubernetes_options.rb +2 -0
  106. data/lib/droplet_kit/models/links.rb +2 -0
  107. data/lib/droplet_kit/models/load_balancer.rb +2 -0
  108. data/lib/droplet_kit/models/meta_information.rb +2 -0
  109. data/lib/droplet_kit/models/network.rb +2 -0
  110. data/lib/droplet_kit/models/network_hash.rb +2 -0
  111. data/lib/droplet_kit/models/pagination_information.rb +2 -0
  112. data/lib/droplet_kit/models/project.rb +2 -0
  113. data/lib/droplet_kit/models/project_assignment.rb +2 -0
  114. data/lib/droplet_kit/models/region.rb +2 -0
  115. data/lib/droplet_kit/models/size.rb +2 -0
  116. data/lib/droplet_kit/models/snapshot.rb +2 -0
  117. data/lib/droplet_kit/models/ssh_key.rb +2 -0
  118. data/lib/droplet_kit/models/sticky_session.rb +2 -0
  119. data/lib/droplet_kit/models/tag.rb +2 -0
  120. data/lib/droplet_kit/models/tagged_droplets_resources.rb +2 -0
  121. data/lib/droplet_kit/models/tagged_images_resources.rb +2 -0
  122. data/lib/droplet_kit/models/tagged_resources.rb +2 -0
  123. data/lib/droplet_kit/models/volume.rb +2 -0
  124. data/lib/droplet_kit/models/vpc.rb +2 -0
  125. data/lib/droplet_kit/models/vpc_member.rb +2 -0
  126. data/lib/droplet_kit/paginated_resource.rb +2 -0
  127. data/lib/droplet_kit/resources/account_resource.rb +3 -1
  128. data/lib/droplet_kit/resources/action_resource.rb +3 -1
  129. data/lib/droplet_kit/resources/balance_resource.rb +3 -1
  130. data/lib/droplet_kit/resources/cdn_resource.rb +2 -0
  131. data/lib/droplet_kit/resources/certificate_resource.rb +2 -0
  132. data/lib/droplet_kit/resources/container_registry_repository_resource.rb +26 -25
  133. data/lib/droplet_kit/resources/container_registry_resource.rb +22 -21
  134. data/lib/droplet_kit/resources/database_resource.rb +2 -0
  135. data/lib/droplet_kit/resources/domain_record_resource.rb +2 -0
  136. data/lib/droplet_kit/resources/domain_resource.rb +2 -0
  137. data/lib/droplet_kit/resources/droplet_action_resource.rb +2 -0
  138. data/lib/droplet_kit/resources/droplet_resource.rb +2 -0
  139. data/lib/droplet_kit/resources/droplet_upgrade_resource.rb +3 -1
  140. data/lib/droplet_kit/resources/firewall_resource.rb +2 -0
  141. data/lib/droplet_kit/resources/floating_ip_action_resource.rb +3 -1
  142. data/lib/droplet_kit/resources/floating_ip_resource.rb +3 -1
  143. data/lib/droplet_kit/resources/image_action_resource.rb +2 -0
  144. data/lib/droplet_kit/resources/image_resource.rb +3 -1
  145. data/lib/droplet_kit/resources/invoice_resource.rb +13 -11
  146. data/lib/droplet_kit/resources/kubernetes_cluster_resource.rb +2 -0
  147. data/lib/droplet_kit/resources/kubernetes_options_resource.rb +2 -0
  148. data/lib/droplet_kit/resources/load_balancer_resource.rb +2 -0
  149. data/lib/droplet_kit/resources/project_resource.rb +2 -0
  150. data/lib/droplet_kit/resources/region_resource.rb +2 -0
  151. data/lib/droplet_kit/resources/size_resource.rb +2 -0
  152. data/lib/droplet_kit/resources/snapshot_resource.rb +3 -1
  153. data/lib/droplet_kit/resources/ssh_key_resource.rb +2 -0
  154. data/lib/droplet_kit/resources/tag_resource.rb +2 -0
  155. data/lib/droplet_kit/resources/volume_action_resource.rb +3 -1
  156. data/lib/droplet_kit/resources/volume_resource.rb +2 -0
  157. data/lib/droplet_kit/resources/vpc_resource.rb +2 -0
  158. data/lib/droplet_kit/utils.rb +2 -0
  159. data/lib/droplet_kit/version.rb +3 -1
  160. data/lib/droplet_kit.rb +2 -0
  161. data/lib/tasks/resource_doc.rake +2 -0
  162. metadata +4 -4
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class DropletUpgrade < BaseModel
3
5
  attribute :droplet_id
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class Firewall < BaseModel
3
5
  attribute :id
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class FirewallInboundRule < BaseModel
3
5
  attribute :protocol
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class FirewallOutboundRule < BaseModel
3
5
  attribute :protocol
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class FirewallPendingChange < BaseModel
3
5
  attribute :droplet_id
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class FirewallRule < BaseModel
3
5
  attribute :inbound_rules
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class FloatingIp < BaseModel
3
5
  attribute :ip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class ForwardingRule < BaseModel
3
5
  attribute :entry_protocol
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class HealthCheck < BaseModel
3
5
  attribute :protocol
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class Image < BaseModel
3
5
  # @!attribute id
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class Invoice < BaseModel
3
5
  attribute :invoice_uuid
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class Kernel < BaseModel
3
5
  attribute :id
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class KubernetesCluster < BaseModel
3
5
  [:id, :name, :region, :version, :auto_upgrade, :cluster_subnet, :service_subnet, :ipv4, :endpoint, :tags, :maintenance_policy, :node_pools, :vpc_uuid, :ha].each do |key|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class KubernetesMaintenancePolicy < BaseModel
3
5
  attribute :start_time
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class KubernetesNode < BaseModel
3
5
  [:id, :name, :status, :created_at, :updated_at].each do |key|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class KubernetesNodePool < BaseModel
3
5
  [:id, :name, :size, :count, :tags, :labels, :nodes, :auto_scale, :min_nodes, :max_nodes].each do |key|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class KubernetesOptions < BaseModel
3
5
  attribute :versions
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class Links < BaseModel
3
5
  attribute :myself
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class LoadBalancer < BaseModel
3
5
  attribute :id
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class MetaInformation < BaseModel
3
5
  include Kartograph::DSL
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  Network = Struct.new(:ip_address, :netmask, :gateway, :type, :cidr)
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  NetworkHash = Struct.new(:v4, :v6)
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class PaginationInformation < BaseModel
3
5
  include Kartograph::DSL
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class Project < BaseModel
3
5
  DEFAULT = 'default'.freeze
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class ProjectAssignment < BaseModel
3
5
  attribute :urn
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class Region < BaseModel
3
5
  attribute :slug
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class Size < BaseModel
3
5
  attribute :slug
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class Snapshot < BaseModel
3
5
  attribute :id
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class SSHKey < BaseModel
3
5
  attribute :id
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class StickySession < BaseModel
3
5
  attribute :type, String
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class Tag < BaseModel
3
5
  attribute :name
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class TaggedDropletsResources < BaseModel
3
5
  attribute :count
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class TaggedImagesResources < BaseModel
3
5
  attribute :count
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class TaggedResources < BaseModel
3
5
  attribute :count
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class Volume < BaseModel
3
5
  attribute :id
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class VPC < BaseModel
3
5
  attribute :id
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class VPCMember < BaseModel
3
5
  attribute :urn
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class PaginatedResource
3
5
  include Enumerable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class AccountResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -7,4 +9,4 @@ module DropletKit
7
9
  get '/v2/account' => :info
8
10
  end
9
11
  end
10
- end
12
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class ActionResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -17,4 +19,4 @@ module DropletKit
17
19
  PaginatedResource.new(action(:all), self, *args)
18
20
  end
19
21
  end
20
- end
22
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class BalanceResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -7,4 +9,4 @@ module DropletKit
7
9
  get '/v2/customers/my/balance' => :info
8
10
  end
9
11
  end
10
- end
12
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class CDNResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class CertificateResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -1,35 +1,36 @@
1
- module DropletKit
2
- class ContainerRegistryRepositoryResource < ResourceKit::Resource
3
- include ErrorHandlingResourcable
4
-
5
- resources do
6
- action :all, 'GET /v2/registry/:registry_name/repositories' do
7
- query_keys :per_page, :page
8
- handler(200) { |response| ContainerRegistryRepositoryMapping.extract_collection(response.body, :read) }
9
- end
1
+ # frozen_string_literal: true
10
2
 
11
- action :tags, 'GET /v2/registry/:registry_name/repositories/:repository/tags' do
12
- query_keys :per_page, :page
13
- handler(200) { |response| DropletKit::ContainerRegistryRepositoryTagMapping.extract_collection(response.body, :read) }
14
- end
3
+ module DropletKit
4
+ class ContainerRegistryRepositoryResource < ResourceKit::Resource
5
+ include ErrorHandlingResourcable
15
6
 
16
- action :delete_tag, 'DELETE /v2/registry/:registry_name/repositories/:repository/tags/:tag' do
17
- handler(204) { |response| true }
18
- end
7
+ resources do
8
+ action :all, 'GET /v2/registry/:registry_name/repositories' do
9
+ query_keys :per_page, :page
10
+ handler(200) { |response| ContainerRegistryRepositoryMapping.extract_collection(response.body, :read) }
11
+ end
19
12
 
20
- action :delete_manifest, 'DELETE /v2/registry/:registry_name/repositories/:repository/digests/:manifest_digest' do
21
- handler(204) { |response| true }
22
- handler(400) { |response| ErrorMapping.fail_with(FailedDelete, response.body) }
23
- end
13
+ action :tags, 'GET /v2/registry/:registry_name/repositories/:repository/tags' do
14
+ query_keys :per_page, :page
15
+ handler(200) { |response| DropletKit::ContainerRegistryRepositoryTagMapping.extract_collection(response.body, :read) }
24
16
  end
25
17
 
26
- def all(*args)
27
- PaginatedResource.new(action(:all), self, *args)
18
+ action :delete_tag, 'DELETE /v2/registry/:registry_name/repositories/:repository/tags/:tag' do
19
+ handler(204) { |response| true }
28
20
  end
29
21
 
30
- def tags(*args)
31
- PaginatedResource.new(action(:tags), self, *args)
22
+ action :delete_manifest, 'DELETE /v2/registry/:registry_name/repositories/:repository/digests/:manifest_digest' do
23
+ handler(204) { |response| true }
24
+ handler(400) { |response| ErrorMapping.fail_with(FailedDelete, response.body) }
32
25
  end
33
26
  end
27
+
28
+ def all(*args)
29
+ PaginatedResource.new(action(:all), self, *args)
30
+ end
31
+
32
+ def tags(*args)
33
+ PaginatedResource.new(action(:tags), self, *args)
34
+ end
35
+ end
34
36
  end
35
-
@@ -1,26 +1,27 @@
1
+ # frozen_string_literal: true
2
+
1
3
  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
4
+ class ContainerRegistryResource < ResourceKit::Resource
5
+ include ErrorHandlingResourcable
6
+
7
+ resources do
8
+ action :get, 'GET /v2/registry' do
9
+ handler(200) { |response| ContainerRegistryMapping.extract_single(response.body, :read) }
10
+ end
11
+
12
+ action :create, 'POST /v2/registry' do
13
+ body { |object| ContainerRegistryMapping.representation_for(:create, object) }
14
+ handler(201) { |response, registry| ContainerRegistryMapping.extract_into_object(registry, response.body, :read) }
15
+ handler(422) { |response| ErrorMapping.fail_with(FailedCreate, response.body) }
16
+ end
17
+
18
+ action :delete, 'DELETE /v2/registry' do
19
+ handler(204) { |response| true }
20
+ end
19
21
 
20
- action :docker_credentials, 'GET /v2/registry/docker-credentials' do
21
- handler(200) { |response| response.body }
22
- end
22
+ action :docker_credentials, 'GET /v2/registry/docker-credentials' do
23
+ handler(200) { |response| response.body }
23
24
  end
24
25
  end
26
+ end
25
27
  end
26
-
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class DatabaseResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class DomainRecordResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class DomainResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class DropletActionResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class DropletResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class DropletUpgradeResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -8,4 +10,4 @@ module DropletKit
8
10
  end
9
11
  end
10
12
  end
11
- end
13
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class FirewallResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class FloatingIpActionResource < ResourceKit::Resource
3
5
  resources do
@@ -27,4 +29,4 @@ module DropletKit
27
29
  PaginatedResource.new(action(:all), self, *args)
28
30
  end
29
31
  end
30
- end
32
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class FloatingIpResource < ResourceKit::Resource
3
5
  resources do
@@ -26,4 +28,4 @@ module DropletKit
26
28
  PaginatedResource.new(action(:all), self, *args)
27
29
  end
28
30
  end
29
- end
31
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class ImageActionResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class ImageResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -26,4 +28,4 @@ module DropletKit
26
28
  PaginatedResource.new(action(:all), self, *args)
27
29
  end
28
30
  end
29
- end
31
+ end
@@ -1,15 +1,17 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
- class InvoiceResource < ResourceKit::Resource
3
- include ErrorHandlingResourcable
4
-
5
- resources do
6
- action :list, 'GET /v2/customers/my/invoices' do
7
- handler(200) { |response| InvoiceMapping.extract_collection(response.body, :read) }
8
- end
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
- action :find, 'GET v2/customers/my/invoices/:id' do
11
- handler(200) { |response| InvoiceMapping.extract_collection(response.body, :find) }
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class KubernetesOptionsResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class LoadBalancerResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class ProjectResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class RegionResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class SizeResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class SnapshotResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -21,4 +23,4 @@ module DropletKit
21
23
  PaginatedResource.new(action(:all), self, *args)
22
24
  end
23
25
  end
24
- end
26
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class SSHKeyResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DropletKit
2
4
  class TagResource < ResourceKit::Resource
3
5
  include ErrorHandlingResourcable