droplet_kit 3.20.0 → 3.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +77 -0
- data/lib/droplet_kit/client.rb +6 -1
- data/lib/droplet_kit/mappings/app_mapping.rb +121 -0
- data/lib/droplet_kit/mappings/app_spec_mapping.rb +549 -0
- data/lib/droplet_kit/mappings/database_connection_pool_mapping.rb +4 -4
- data/lib/droplet_kit/mappings/database_kafka_config_mapping.rb +56 -0
- data/lib/droplet_kit/mappings/database_metrics_credentials_mapping.rb +15 -0
- data/lib/droplet_kit/mappings/database_mongo_config_mapping.rb +22 -0
- data/lib/droplet_kit/mappings/database_mysql_config_mapping.rb +50 -0
- data/lib/droplet_kit/mappings/database_opensearch_config_mapping.rb +55 -0
- data/lib/droplet_kit/mappings/database_postgres_config_mapping.rb +97 -0
- data/lib/droplet_kit/mappings/database_redis_config_mapping.rb +28 -0
- data/lib/droplet_kit/mappings/deployment_mapping.rb +136 -0
- data/lib/droplet_kit/mappings/one_click_kubernetes_mapping.rb +16 -0
- data/lib/droplet_kit/mappings/one_click_mapping.rb +17 -0
- data/lib/droplet_kit/mappings/reserved_ipv6_mapping.rb +17 -0
- data/lib/droplet_kit/mappings/vpc_peering_mapping.rb +29 -0
- data/lib/droplet_kit/models/app.rb +70 -0
- data/lib/droplet_kit/models/app_spec.rb +290 -0
- data/lib/droplet_kit/models/database_kafka_config.rb +47 -0
- data/lib/droplet_kit/models/database_metrics_credentials.rb +8 -0
- data/lib/droplet_kit/models/database_mongo_config.rb +13 -0
- data/lib/droplet_kit/models/database_mysql_config.rb +41 -0
- data/lib/droplet_kit/models/database_opensearch_config.rb +46 -0
- data/lib/droplet_kit/models/database_postgres_config.rb +76 -0
- data/lib/droplet_kit/models/database_redis_config.rb +19 -0
- data/lib/droplet_kit/models/deployment.rb +73 -0
- data/lib/droplet_kit/models/one_click.rb +8 -0
- data/lib/droplet_kit/models/one_click_kubernetes.rb +8 -0
- data/lib/droplet_kit/models/reserved_ipv6.rb +19 -0
- data/lib/droplet_kit/models/vpc_peering.rb +11 -0
- data/lib/droplet_kit/resources/app_resource.rb +36 -0
- data/lib/droplet_kit/resources/database_resource.rb +36 -0
- data/lib/droplet_kit/resources/droplet_action_resource.rb +1 -1
- data/lib/droplet_kit/resources/one_click_resource.rb +23 -0
- data/lib/droplet_kit/resources/reserved_ipv6_action_resource.rb +20 -0
- data/lib/droplet_kit/resources/reserved_ipv6_resource.rb +33 -0
- data/lib/droplet_kit/resources/vpc_peering_resource.rb +43 -0
- data/lib/droplet_kit/version.rb +1 -1
- data/lib/droplet_kit.rb +137 -0
- metadata +52 -5
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DropletKit
|
4
|
+
class DatabaseOpensearchConfigMapping
|
5
|
+
include Kartograph::DSL
|
6
|
+
|
7
|
+
kartograph do
|
8
|
+
mapping DatabaseOpensearchConfig
|
9
|
+
root_key singular: 'config', scopes: %i[read update]
|
10
|
+
|
11
|
+
scoped :read, :update do
|
12
|
+
%i[http_max_content_length_bytes
|
13
|
+
http_max_header_size_bytes
|
14
|
+
http_max_initial_line_length_bytes
|
15
|
+
indices_query_bool_max_clause_count
|
16
|
+
indices_fielddata_cache_size_percentage
|
17
|
+
indices_memory_index_buffer_size_percentage
|
18
|
+
indices_memory_min_index_buffer_size_mb
|
19
|
+
indices_memory_max_index_buffer_size_mb
|
20
|
+
indices_queries_cache_size_percentage
|
21
|
+
indices_recovery_max_mb_per_sec
|
22
|
+
indices_recovery_max_concurrent_file_chunks
|
23
|
+
thread_pool_search_size
|
24
|
+
thread_pool_search_throttled_size
|
25
|
+
thread_pool_get_size
|
26
|
+
thread_pool_analyze_size
|
27
|
+
thread_pool_write_size
|
28
|
+
thread_pool_force_merge_size
|
29
|
+
thread_pool_search_queue_size
|
30
|
+
thread_pool_search_throttled_queue_size
|
31
|
+
thread_pool_get_queue_size
|
32
|
+
thread_pool_analyze_queue_size
|
33
|
+
thread_pool_write_queue_size
|
34
|
+
ism_enabled
|
35
|
+
ism_history_enabled
|
36
|
+
ism_history_max_age_hours
|
37
|
+
ism_history_max_docs
|
38
|
+
ism_history_rollover_check_period_hours
|
39
|
+
ism_history_rollover_retention_period_days
|
40
|
+
search_max_buckets
|
41
|
+
action_auto_create_index_enabled
|
42
|
+
enable_security_audit
|
43
|
+
action_destructive_requires_name
|
44
|
+
cluster_max_shards_per_node
|
45
|
+
override_main_response_version
|
46
|
+
script_max_compilations_rate
|
47
|
+
cluster_routing_allocation_node_concurrent_recoveries
|
48
|
+
reindex_remote_whitelist
|
49
|
+
plugins_alerting_filter_by_backend_roles_enabled].each do |key|
|
50
|
+
property(key)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DropletKit
|
4
|
+
class DatabasePostgresPgbouncerConfigMapping
|
5
|
+
include Kartograph::DSL
|
6
|
+
kartograph do
|
7
|
+
mapping DatabasePostgresPgbouncerConfig
|
8
|
+
|
9
|
+
scoped :read, :update do
|
10
|
+
property :server_reset_query_always
|
11
|
+
property :ignore_startup_parameters
|
12
|
+
property :min_pool_size
|
13
|
+
property :server_lifetime
|
14
|
+
property :server_idle_timeout
|
15
|
+
property :autodb_pool_size
|
16
|
+
property :autodb_pool_mode
|
17
|
+
property :autodb_max_db_connections
|
18
|
+
property :autodb_idle_timeout
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class DatabasePostgresTimescaledbConfigMapping
|
24
|
+
include Kartograph::DSL
|
25
|
+
kartograph do
|
26
|
+
mapping DatabasePostgresTimescaledbConfig
|
27
|
+
property :max_background_workers, scopes: %i[read update]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
class DatabasePostgresConfigMapping
|
32
|
+
include Kartograph::DSL
|
33
|
+
|
34
|
+
kartograph do
|
35
|
+
mapping DatabasePostgresConfig
|
36
|
+
root_key singular: 'config', scopes: %i[read update]
|
37
|
+
|
38
|
+
scoped :read, :update do
|
39
|
+
%i[autovacuum_freeze_max_age
|
40
|
+
autovacuum_max_workers
|
41
|
+
autovacuum_naptime
|
42
|
+
autovacuum_vacuum_threshold
|
43
|
+
autovacuum_analyze_threshold
|
44
|
+
autovacuum_vacuum_scale_factor
|
45
|
+
autovacuum_analyze_scale_factor
|
46
|
+
autovacuum_vacuum_cost_delay
|
47
|
+
autovacuum_vacuum_cost_limit
|
48
|
+
bgwriter_delay
|
49
|
+
bgwriter_flush_after
|
50
|
+
bgwriter_lru_maxpages
|
51
|
+
bgwriter_lru_multiplier
|
52
|
+
deadlock_timeout
|
53
|
+
default_toast_compression
|
54
|
+
idle_in_transaction_session_timeout
|
55
|
+
jit
|
56
|
+
log_autovacuum_min_duration
|
57
|
+
log_error_verbosity
|
58
|
+
log_line_prefix
|
59
|
+
log_min_duration_statement
|
60
|
+
max_files_per_process
|
61
|
+
max_prepared_transactions
|
62
|
+
max_pred_locks_per_transaction
|
63
|
+
max_locks_per_transaction
|
64
|
+
max_stack_depth
|
65
|
+
max_standby_archive_delay
|
66
|
+
max_standby_streaming_delay
|
67
|
+
max_replication_slots
|
68
|
+
max_logical_replication_workers
|
69
|
+
max_parallel_workers
|
70
|
+
max_parallel_workers_per_gather
|
71
|
+
max_worker_processes
|
72
|
+
temp_file_limit
|
73
|
+
timezone
|
74
|
+
track_activity_query_size
|
75
|
+
track_commit_timestamp
|
76
|
+
track_functions
|
77
|
+
track_io_timing
|
78
|
+
max_wal_senders
|
79
|
+
wal_sender_timeout
|
80
|
+
wal_writer_delay
|
81
|
+
shared_buffers_percentage
|
82
|
+
backup_hour
|
83
|
+
backup_minute
|
84
|
+
work_mem].each do |key|
|
85
|
+
property(key)
|
86
|
+
end
|
87
|
+
|
88
|
+
property :pg_partman_bgw_role, key: 'pg_partman_bgw.role'
|
89
|
+
property :pg_partman_bgw_interval, key: 'pg_partman_bgw.interval'
|
90
|
+
property :pg_stat_statements_track, key: 'pg_stat_statements.track'
|
91
|
+
|
92
|
+
property :pgbouncer, include: DatabasePostgresPgbouncerConfigMapping
|
93
|
+
property :timescaledb, include: DatabasePostgresTimescaledbConfigMapping
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DropletKit
|
4
|
+
class DatabaseRedisConfigMapping
|
5
|
+
include Kartograph::DSL
|
6
|
+
|
7
|
+
kartograph do
|
8
|
+
mapping DatabaseRedisConfig
|
9
|
+
root_key singular: 'config', scopes: %i[read update]
|
10
|
+
|
11
|
+
scoped :read, :update do
|
12
|
+
%i[redis_maxmemory_policy
|
13
|
+
redis_pubsub_client_output_buffer_limit
|
14
|
+
redis_number_of_databases
|
15
|
+
redis_io_threads
|
16
|
+
redis_lfu_log_factor
|
17
|
+
redis_lfu_decay_time
|
18
|
+
redis_ssl
|
19
|
+
redis_timeout
|
20
|
+
redis_notify_keyspace_events
|
21
|
+
redis_persistence
|
22
|
+
redis_acl_channels_default].each do |key|
|
23
|
+
property(key)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,136 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DropletKit
|
4
|
+
class DeploymentJobMapping
|
5
|
+
include Kartograph::DSL
|
6
|
+
|
7
|
+
kartograph do
|
8
|
+
mapping DeploymentJob
|
9
|
+
scoped :read do
|
10
|
+
property :name
|
11
|
+
property :source_commit_hash
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class DeploymentFunctionMapping
|
17
|
+
include Kartograph::DSL
|
18
|
+
|
19
|
+
kartograph do
|
20
|
+
mapping DeploymentFunction
|
21
|
+
scoped :read do
|
22
|
+
property :name
|
23
|
+
property :source_commit_hash
|
24
|
+
property :namespace
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
class DeploymentProgressStepReasonMapping
|
30
|
+
include Kartograph::DSL
|
31
|
+
|
32
|
+
kartograph do
|
33
|
+
mapping DeploymentProgressStepReason
|
34
|
+
scoped :read do
|
35
|
+
property :code
|
36
|
+
property :message
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
class DeploymentProgressStepMapping
|
42
|
+
include Kartograph::DSL
|
43
|
+
|
44
|
+
kartograph do
|
45
|
+
mapping DeploymentProgressStep
|
46
|
+
scoped :read do
|
47
|
+
property :component_name
|
48
|
+
property :ended_at
|
49
|
+
property :message_base
|
50
|
+
property :name
|
51
|
+
property :reason, include: DeploymentProgressStepReasonMapping
|
52
|
+
property :started_at
|
53
|
+
property :status
|
54
|
+
property :steps
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
class DeploymentProgressMapping
|
60
|
+
include Kartograph::DSL
|
61
|
+
|
62
|
+
kartograph do
|
63
|
+
mapping DeploymentProgress
|
64
|
+
scoped :read do
|
65
|
+
property :error_steps
|
66
|
+
property :pending_steps
|
67
|
+
property :running_steps
|
68
|
+
property :steps, plural: true, include: DeploymentProgressStepMapping
|
69
|
+
property :success_steps
|
70
|
+
property :summary_steps, plural: true, include: DeploymentProgressStepMapping
|
71
|
+
property :total_steps
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
class DeploymentServiceMapping
|
77
|
+
include Kartograph::DSL
|
78
|
+
|
79
|
+
kartograph do
|
80
|
+
mapping DeploymentService
|
81
|
+
scoped :read do
|
82
|
+
property :name
|
83
|
+
property :source_commit_hash
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
class DeploymentStaticSiteMapping
|
89
|
+
include Kartograph::DSL
|
90
|
+
|
91
|
+
kartograph do
|
92
|
+
mapping DeploymentStaticSite
|
93
|
+
scoped :read do
|
94
|
+
property :name
|
95
|
+
property :source_commit_hash
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
class DeploymentWorkerMapping
|
101
|
+
include Kartograph::DSL
|
102
|
+
|
103
|
+
kartograph do
|
104
|
+
mapping DeploymentWorker
|
105
|
+
scoped :read do
|
106
|
+
property :name
|
107
|
+
property :source_commit_hash
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
class DeploymentMapping
|
113
|
+
include Kartograph::DSL
|
114
|
+
|
115
|
+
kartograph do
|
116
|
+
mapping Deployment
|
117
|
+
scoped :read do
|
118
|
+
property :cause
|
119
|
+
property :cloned_from
|
120
|
+
property :created_at
|
121
|
+
property :id
|
122
|
+
property :jobs, plural: true, include: DeploymentJobMapping
|
123
|
+
property :functions, plural: true, include: DeploymentFunctionMapping
|
124
|
+
property :phase
|
125
|
+
property :phase_last_updated_at
|
126
|
+
property :progress, include: DeploymentProgressMapping
|
127
|
+
property :services, plural: true, include: DeploymentServiceMapping
|
128
|
+
property :spec, include: AppSpecMapping
|
129
|
+
property :static_sites, plural: true, include: DeploymentStaticSiteMapping
|
130
|
+
property :tier_slug
|
131
|
+
property :updated_at
|
132
|
+
property :workers, plural: true, include: DeploymentWorkerMapping
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DropletKit
|
4
|
+
class OneClickKubernetesMapping
|
5
|
+
include Kartograph::DSL
|
6
|
+
|
7
|
+
kartograph do
|
8
|
+
mapping OneClickKubernetes
|
9
|
+
|
10
|
+
scoped :create do
|
11
|
+
property :addon_slugs
|
12
|
+
property :cluster_uuid
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DropletKit
|
4
|
+
class OneClickMapping
|
5
|
+
include Kartograph::DSL
|
6
|
+
|
7
|
+
kartograph do
|
8
|
+
mapping OneClick
|
9
|
+
root_key plural: '1_clicks', scopes: [:read]
|
10
|
+
|
11
|
+
scoped :read do
|
12
|
+
property :slug
|
13
|
+
property :type
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DropletKit
|
4
|
+
class ReservedIpv6Mapping
|
5
|
+
include Kartograph::DSL
|
6
|
+
|
7
|
+
kartograph do
|
8
|
+
mapping ReservedIpv6
|
9
|
+
root_key plural: 'reserved_ipv6s', singular: 'reserved_ipv6', scopes: [:read]
|
10
|
+
|
11
|
+
property :ip, scopes: [:read]
|
12
|
+
property :region_slug, scopes: %i[read create]
|
13
|
+
property :droplet, scopes: [:read], include: DropletMapping
|
14
|
+
property :reserved_at, scopes: [:read]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DropletKit
|
4
|
+
class VPCPeeringMapping
|
5
|
+
include Kartograph::DSL
|
6
|
+
|
7
|
+
kartograph do
|
8
|
+
mapping VPCPeering
|
9
|
+
root_key plural: 'vpc_peerings', singular: 'vpc_peering', scopes: [:read]
|
10
|
+
|
11
|
+
scoped :read do
|
12
|
+
property :id
|
13
|
+
property :name
|
14
|
+
property :vpc_ids
|
15
|
+
property :created_at
|
16
|
+
property :status
|
17
|
+
end
|
18
|
+
|
19
|
+
scoped :update, :patch do
|
20
|
+
property :name
|
21
|
+
end
|
22
|
+
|
23
|
+
scoped :create do
|
24
|
+
property :name
|
25
|
+
property :vpc_ids
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DropletKit
|
4
|
+
class AppDomainProgress < BaseModel
|
5
|
+
attribute :steps
|
6
|
+
end
|
7
|
+
|
8
|
+
class AppDomainSpec < BaseModel
|
9
|
+
attribute :domain
|
10
|
+
attribute :type
|
11
|
+
attribute :wildcard
|
12
|
+
attribute :zone
|
13
|
+
attribute :minimum_tls_version
|
14
|
+
end
|
15
|
+
|
16
|
+
class AppDomainValidation < BaseModel
|
17
|
+
attribute :txt_name
|
18
|
+
attribute :txt_value
|
19
|
+
end
|
20
|
+
|
21
|
+
class AppDomain < BaseModel
|
22
|
+
attribute :id
|
23
|
+
attribute :phase
|
24
|
+
attribute :progress, AppDomainProgress
|
25
|
+
attribute :spec, AppDomainSpec
|
26
|
+
attribute :validation, [AppDomainValidation]
|
27
|
+
attribute :rotate_validation_records
|
28
|
+
attribute :certificate_expires_at
|
29
|
+
end
|
30
|
+
|
31
|
+
class AppRegion < BaseModel
|
32
|
+
attribute :continent
|
33
|
+
attribute :data_centers
|
34
|
+
attribute :default
|
35
|
+
attribute :disabled
|
36
|
+
attribute :flag
|
37
|
+
attribute :label
|
38
|
+
attribute :reason
|
39
|
+
attribute :slug
|
40
|
+
end
|
41
|
+
|
42
|
+
class AppDedicatedIp < BaseModel
|
43
|
+
attribute :ip
|
44
|
+
attribute :id
|
45
|
+
attribute :status
|
46
|
+
end
|
47
|
+
|
48
|
+
class App < BaseModel
|
49
|
+
attribute :active_deployment, Deployment
|
50
|
+
attribute :created_at
|
51
|
+
attribute :default_ingress
|
52
|
+
attribute :domains, [AppDomain]
|
53
|
+
attribute :id
|
54
|
+
attribute :in_progress_deployment, Deployment
|
55
|
+
attribute :last_deployment_created_at
|
56
|
+
attribute :live_domain
|
57
|
+
attribute :live_url
|
58
|
+
attribute :live_url_base
|
59
|
+
attribute :owner_uuid
|
60
|
+
attribute :pending_deployment, Deployment
|
61
|
+
attribute :project_id
|
62
|
+
attribute :region, AppRegion
|
63
|
+
attribute :spec, AppSpec
|
64
|
+
attribute :tier_slug
|
65
|
+
attribute :updated_at
|
66
|
+
attribute :pinned_deployment, Deployment
|
67
|
+
attribute :dedicated_ips, [AppDedicatedIp]
|
68
|
+
attribute :update_all_source_versions
|
69
|
+
end
|
70
|
+
end
|