knife-ionoscloud 6.1.0 → 6.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +17 -0
- data/.rubocop.yml +72 -0
- data/docs/docs_generator.rb +21 -24
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_backup_get.md +1 -1
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_backup_list.md +1 -2
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_create.md +6 -3
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_delete.md +1 -1
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_get.md +1 -1
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_list.md +1 -1
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_restore.md +1 -1
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_update.md +2 -2
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_logs_get.md +7 -4
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_version_list.md +1 -2
- data/docs/subcommands/kubernetes/k8s_create.md +4 -1
- data/docs/subcommands/kubernetes/nodepool_create.md +4 -1
- data/docs/summary.md +124 -124
- data/knife-ionoscloud.gemspec +2 -2
- data/lib/chef/knife/ionoscloud_backupunit_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_update.rb +1 -1
- data/lib/chef/knife/ionoscloud_base.rb +3 -0
- data/lib/chef/knife/ionoscloud_composite_server_create.rb +2 -2
- data/lib/chef/knife/ionoscloud_contract_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_cube_server_create.rb +3 -3
- data/lib/chef/knife/ionoscloud_datacenter_create.rb +2 -2
- data/lib/chef/knife/ionoscloud_datacenter_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_datacenter_update.rb +2 -2
- data/lib/chef/knife/ionoscloud_dbaas_postgres_backup_get.rb +2 -2
- data/lib/chef/knife/ionoscloud_dbaas_postgres_backup_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_create.rb +11 -7
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_delete.rb +2 -2
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_get.rb +3 -3
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_list.rb +3 -1
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_update.rb +2 -4
- data/lib/chef/knife/ionoscloud_dbaas_postgres_logs_get.rb +37 -6
- data/lib/chef/knife/ionoscloud_dbaas_postgres_version_list.rb +3 -2
- data/lib/chef/knife/ionoscloud_firewall_create.rb +1 -1
- data/lib/chef/knife/ionoscloud_firewall_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_firewall_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_flowlog_delete.rb +1 -3
- data/lib/chef/knife/ionoscloud_flowlog_list.rb +3 -5
- data/lib/chef/knife/ionoscloud_group_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_group_update.rb +1 -1
- data/lib/chef/knife/ionoscloud_ipblock_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_k8s_create.rb +6 -0
- data/lib/chef/knife/ionoscloud_k8s_delete.rb +2 -2
- data/lib/chef/knife/ionoscloud_k8s_list.rb +3 -1
- data/lib/chef/knife/ionoscloud_k8s_update.rb +2 -6
- data/lib/chef/knife/ionoscloud_label_list.rb +1 -3
- data/lib/chef/knife/ionoscloud_lan_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_loadbalancer_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_natgateway_create.rb +1 -1
- data/lib/chef/knife/ionoscloud_natgateway_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_natgateway_rule_add.rb +1 -1
- data/lib/chef/knife/ionoscloud_natgateway_rule_update.rb +1 -1
- data/lib/chef/knife/ionoscloud_natgateway_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_add.rb +1 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove.rb +1 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_nic_create.rb +3 -3
- data/lib/chef/knife/ionoscloud_nic_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_node_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_node_replace.rb +3 -3
- data/lib/chef/knife/ionoscloud_nodepool_create.rb +7 -2
- data/lib/chef/knife/ionoscloud_nodepool_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_nodepool_list.rb +3 -1
- data/lib/chef/knife/ionoscloud_pcc_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_pcc_update.rb +1 -1
- data/lib/chef/knife/ionoscloud_request_list.rb +6 -18
- data/lib/chef/knife/ionoscloud_resource_list.rb +10 -12
- data/lib/chef/knife/ionoscloud_s3key_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_server_create.rb +3 -3
- data/lib/chef/knife/ionoscloud_server_delete.rb +3 -3
- data/lib/chef/knife/ionoscloud_server_upgrade.rb +1 -1
- data/lib/chef/knife/ionoscloud_share_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_snapshot_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_snapshot_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_user_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_detach.rb +4 -4
- data/lib/knife-ionoscloud/version.rb +1 -1
- data/sonar-project.properties +3 -0
- data/spec/chef/knife/ionoscloud_backupunit_create_spec.rb +1 -2
- data/spec/chef/knife/ionoscloud_backupunit_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_backupunit_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_backupunit_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_backupunit_ssourl_spec.rb +2 -4
- data/spec/chef/knife/ionoscloud_backupunit_update_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_base_spec.rb +3 -4
- data/spec/chef/knife/ionoscloud_composite_server_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_contract_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_cube_server_create_spec.rb +2 -3
- data/spec/chef/knife/ionoscloud_datacenter_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_datacenter_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_datacenter_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_datacenter_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_datacenter_update_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_dbaas_postgres_backup_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_dbaas_postgres_backup_list_spec.rb +1 -2
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_create_spec.rb +4 -3
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_delete_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_get_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_list_spec.rb +3 -2
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_restore_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_update_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_dbaas_postgres_logs_get_spec.rb +75 -4
- data/spec/chef/knife/ionoscloud_dbaas_postgres_version_list_spec.rb +2 -3
- data/spec/chef/knife/ionoscloud_firewall_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_firewall_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_firewall_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_firewall_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_firewall_update_spec.rb +2 -3
- data/spec/chef/knife/ionoscloud_flowlog_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_flowlog_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_flowlog_get_spec.rb +0 -2
- data/spec/chef/knife/ionoscloud_flowlog_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_flowlog_update_spec.rb +0 -2
- data/spec/chef/knife/ionoscloud_group_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_group_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_group_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_group_list_spec.rb +2 -3
- data/spec/chef/knife/ionoscloud_group_update_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_group_user_add_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_group_user_remove_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_image_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_ipblock_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_ipblock_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_ipblock_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_ipblock_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_ipblock_update_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_ipfailover_add_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_ipfailover_remove_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_k8s_create_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_k8s_delete_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_k8s_get_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_k8s_list_spec.rb +3 -2
- data/spec/chef/knife/ionoscloud_k8s_update_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_kubeconfig_get_spec.rb +2 -4
- data/spec/chef/knife/ionoscloud_label_add_spec.rb +1 -2
- data/spec/chef/knife/ionoscloud_label_list_spec.rb +4 -5
- data/spec/chef/knife/ionoscloud_label_remove_spec.rb +1 -2
- data/spec/chef/knife/ionoscloud_lan_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_lan_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_lan_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_lan_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_lan_update_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_loadbalancer_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_loadbalancer_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_loadbalancer_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_loadbalancer_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_loadbalancer_nic_add_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_loadbalancer_nic_remove_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_loadbalancer_update_spec.rb +1 -2
- data/spec/chef/knife/ionoscloud_location_list_spec.rb +1 -2
- data/spec/chef/knife/ionoscloud_natgateway_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_natgateway_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_natgateway_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_natgateway_lan_add_spec.rb +2 -3
- data/spec/chef/knife/ionoscloud_natgateway_lan_remove_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_natgateway_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_natgateway_rule_add_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_natgateway_rule_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_natgateway_rule_remove_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_natgateway_rule_update_spec.rb +4 -5
- data/spec/chef/knife/ionoscloud_natgateway_update_spec.rb +4 -6
- data/spec/chef/knife/ionoscloud_networkloadbalancer_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_networkloadbalancer_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_networkloadbalancer_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_networkloadbalancer_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_add_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_remove_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_add_spec.rb +1 -2
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove_spec.rb +12 -15
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_update_spec.rb +4 -6
- data/spec/chef/knife/ionoscloud_networkloadbalancer_update_spec.rb +2 -3
- data/spec/chef/knife/ionoscloud_nic_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_nic_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_nic_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_nic_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_nic_update_spec.rb +1 -2
- data/spec/chef/knife/ionoscloud_node_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_node_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_node_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_node_replace_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_nodepool_create_spec.rb +2 -1
- data/spec/chef/knife/ionoscloud_nodepool_delete_spec.rb +2 -1
- data/spec/chef/knife/ionoscloud_nodepool_get_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_nodepool_lan_add_spec.rb +3 -3
- data/spec/chef/knife/{ionoscloud_nodepool_lan_remove.rb → ionoscloud_nodepool_lan_remove_spec.rb} +14 -17
- data/spec/chef/knife/ionoscloud_nodepool_list_spec.rb +3 -2
- data/spec/chef/knife/ionoscloud_nodepool_update_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_pcc_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_pcc_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_pcc_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_pcc_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_pcc_update_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_request_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_request_list_spec.rb +1 -3
- data/spec/chef/knife/ionoscloud_request_status_spec.rb +2 -4
- data/spec/chef/knife/ionoscloud_request_wait_spec.rb +2 -5
- data/spec/chef/knife/ionoscloud_resource_list_spec.rb +1 -3
- data/spec/chef/knife/ionoscloud_s3key_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_s3key_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_s3key_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_s3key_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_server_console_spec.rb +2 -4
- data/spec/chef/knife/ionoscloud_server_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_server_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_server_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_server_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_server_reboot_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_server_resume_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_server_start_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_server_stop_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_server_suspend_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_server_token_spec.rb +2 -4
- data/spec/chef/knife/ionoscloud_server_update_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_server_upgrade_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_share_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_share_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_share_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_share_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_share_update_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_snapshot_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_snapshot_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_snapshot_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_snapshot_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_snapshot_restore_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_snapshot_update_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_template_list_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_user_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_user_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_user_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_user_list_spec.rb +2 -3
- data/spec/chef/knife/ionoscloud_user_ssourl_spec.rb +2 -4
- data/spec/chef/knife/ionoscloud_user_update_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_volume_attach_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_volume_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_volume_delete_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_volume_detach_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_volume_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_volume_list_spec.rb +2 -3
- data/spec/chef/knife/ionoscloud_volume_update_spec.rb +0 -1
- data/spec/spec_helper.rb +10 -7
- metadata +12 -12
@@ -19,11 +19,26 @@ class Chef
|
|
19
19
|
|
20
20
|
option :start,
|
21
21
|
long: '--start START',
|
22
|
-
description: 'The start time for the query in RFC3339 format.'
|
22
|
+
description: 'The start time for the query in RFC3339 format. If both start and since are set, start will be used.'
|
23
|
+
|
24
|
+
option :since,
|
25
|
+
long: '--since SINCE',
|
26
|
+
description: 'The start time for the query using a time delta since the current moment: 2h - 2 hours ago, 20m - 20 minutes ago. '\
|
27
|
+
'Only hours and minutes ar supported, and not at the same time. If both start and since are set, start will be used.'
|
23
28
|
|
24
29
|
option :end,
|
25
30
|
long: '--end END',
|
26
|
-
description: 'The end time for the query in RFC3339 format.'
|
31
|
+
description: 'The end time for the query in RFC3339 format. If both end and until are set, end will be used.'
|
32
|
+
|
33
|
+
option :until,
|
34
|
+
long: '--until UNTIL',
|
35
|
+
description: 'The end time for the query using a time delta since the current moment: 2h - 2 hours ago, 20m - 20 minutes ago. '\
|
36
|
+
'Only hours and minutes ar supported, and not at the same time. If both end and until are set, end will be used.'
|
37
|
+
|
38
|
+
option :direction,
|
39
|
+
long: '--direction DIRECTION',
|
40
|
+
description: 'The direction in which to scan through the logs. '\
|
41
|
+
'The logs are returned in order of the direction. One of ["BACKWARD", "FORWARD"]'
|
27
42
|
|
28
43
|
def initialize(args = [])
|
29
44
|
super(args)
|
@@ -38,21 +53,37 @@ class Chef
|
|
38
53
|
handle_extra_config
|
39
54
|
validate_required_params(@required_options, config)
|
40
55
|
|
56
|
+
def delta_to_date(delta)
|
57
|
+
return nil if delta.nil?
|
58
|
+
|
59
|
+
unit = delta[-1]
|
60
|
+
unless ['h', 'm'].include? unit
|
61
|
+
ui.error('Time delta may only be specified in hours(h) or minutes(m)!')
|
62
|
+
exit(1)
|
63
|
+
end
|
64
|
+
|
65
|
+
minute_count = Integer(delta[0..-2])
|
66
|
+
minute_count *= 60 if unit == 'h'
|
67
|
+
|
68
|
+
(Time.now - minute_count * 60).iso8601
|
69
|
+
end
|
70
|
+
|
41
71
|
logs = IonoscloudDbaasPostgres::LogsApi.new(api_client_dbaas).cluster_logs_get(
|
42
72
|
config[:cluster_id],
|
43
73
|
{
|
44
74
|
limit: (config[:limit] != nil ? Integer(config[:limit]) : nil),
|
45
|
-
start: config[:start],
|
46
|
-
end: config[:end],
|
75
|
+
start: config[:start].nil? ? delta_to_date(config[:since]) : config[:start],
|
76
|
+
_end: config[:end].nil? ? delta_to_date(config[:until]) : config[:end],
|
77
|
+
direction: config[:direction],
|
47
78
|
},
|
48
79
|
)
|
49
80
|
|
50
|
-
logs.instances.each
|
81
|
+
logs.instances.each do |instance|
|
51
82
|
puts "Instance Name: #{instance.name}"
|
52
83
|
print "\n"
|
53
84
|
puts instance.messages.map { |message| message.message }
|
54
85
|
puts "\n"
|
55
|
-
|
86
|
+
end
|
56
87
|
end
|
57
88
|
end
|
58
89
|
end
|
@@ -15,8 +15,9 @@ class Chef
|
|
15
15
|
def initialize(args = [])
|
16
16
|
super(args)
|
17
17
|
@description =
|
18
|
-
'If cluster_id is provided, retrieves a list of all PostgreSQL versions
|
19
|
-
|
18
|
+
'If cluster_id is provided, retrieves a list of all PostgreSQL versions '\
|
19
|
+
'available for a cluster including the current version, '\
|
20
|
+
'otherwise retrieves a list of all available PostgreSQL versions.'
|
20
21
|
@directory = 'dbaas-postgres'
|
21
22
|
@required_options = [:ionoscloud_username, :ionoscloud_password]
|
22
23
|
end
|
@@ -52,7 +52,7 @@ class Chef
|
|
52
52
|
firewallrules_api = Ionoscloud::FirewallRulesApi.new(api_client)
|
53
53
|
|
54
54
|
firewallrules_api.datacenters_servers_nics_firewallrules_get(
|
55
|
-
config[:datacenter_id], config[:server_id], config[:nic_id], { depth: 1 }
|
55
|
+
config[:datacenter_id], config[:server_id], config[:nic_id], { depth: 1 },
|
56
56
|
).items.each do |firewall|
|
57
57
|
firewall_list << firewall.id
|
58
58
|
firewall_list << firewall.properties.name
|
@@ -50,8 +50,6 @@ class Chef
|
|
50
50
|
handle_extra_config
|
51
51
|
validate_required_params(@required_options, config)
|
52
52
|
|
53
|
-
flowlogs_api = Ionoscloud::FlowLogsApi.new(api_client)
|
54
|
-
|
55
53
|
case config[:type]
|
56
54
|
when 'nic'
|
57
55
|
validate_required_params([:server_id, :nic_id], config)
|
@@ -89,7 +87,7 @@ class Chef
|
|
89
87
|
|
90
88
|
begin
|
91
89
|
confirm('Do you really want to delete this Flow Log')
|
92
|
-
rescue SystemExit
|
90
|
+
rescue SystemExit
|
93
91
|
next
|
94
92
|
end
|
95
93
|
|
@@ -64,27 +64,25 @@ class Chef
|
|
64
64
|
validate_required_params([:server_id, :nic_id], config)
|
65
65
|
flowlogs_api = Ionoscloud::FlowLogsApi.new(api_client)
|
66
66
|
flowlogs = flowlogs_api.datacenters_servers_nics_flowlogs_get(
|
67
|
-
config[:datacenter_id], config[:server_id], config[:nic_id], { depth: 1 }
|
67
|
+
config[:datacenter_id], config[:server_id], config[:nic_id], { depth: 1 },
|
68
68
|
)
|
69
69
|
when 'natgateway'
|
70
70
|
validate_required_params([:natgateway_id], config)
|
71
71
|
flowlogs_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
72
72
|
flowlogs = flowlogs_api.datacenters_natgateways_flowlogs_get(
|
73
|
-
config[:datacenter_id], config[:natgateway_id], { depth: 1 }
|
73
|
+
config[:datacenter_id], config[:natgateway_id], { depth: 1 },
|
74
74
|
)
|
75
75
|
when 'networkloadbalancer'
|
76
76
|
validate_required_params([:network_loadbalancer_id], config)
|
77
77
|
flowlogs_api = Ionoscloud::NetworkLoadBalancersApi.new(api_client)
|
78
78
|
flowlogs = flowlogs_api.datacenters_networkloadbalancers_flowlogs_get(
|
79
|
-
config[:datacenter_id], config[:network_loadbalancer_id], { depth: 1 }
|
79
|
+
config[:datacenter_id], config[:network_loadbalancer_id], { depth: 1 },
|
80
80
|
)
|
81
81
|
else
|
82
82
|
ui.error "Flow log cannot belong to #{config[:type]}. Value must be one of ['nic', 'natgateway', 'networkloadbalancer']"
|
83
83
|
exit(1)
|
84
84
|
end
|
85
85
|
|
86
|
-
flowlogs_api = Ionoscloud::FlowLogsApi.new(api_client)
|
87
|
-
|
88
86
|
flowlogs.items.each do |flowlog|
|
89
87
|
flowlog_list << flowlog.id
|
90
88
|
flowlog_list << flowlog.properties.name
|
@@ -96,7 +96,7 @@ class Chef
|
|
96
96
|
|
97
97
|
existing_group = user_management_api.um_groups_find_by_id(config[:group_id], depth: 1)
|
98
98
|
|
99
|
-
|
99
|
+
_, _, headers = user_management_api.um_groups_put_with_http_info(
|
100
100
|
config[:group_id],
|
101
101
|
Ionoscloud::Group.new(
|
102
102
|
properties: Ionoscloud::GroupProperties.new(
|
@@ -17,6 +17,11 @@ class Chef
|
|
17
17
|
long: '--version VERSION',
|
18
18
|
description: 'The version for the Kubernetes cluster.'
|
19
19
|
|
20
|
+
option :private,
|
21
|
+
long: '--private',
|
22
|
+
default: false,
|
23
|
+
description: 'The indicator if the cluster is public or private. Be aware that creating a private cluster is currently in beta phase.'
|
24
|
+
|
20
25
|
option :maintenance_day,
|
21
26
|
short: '-d MAINTENANCE_DAY',
|
22
27
|
long: '--maintenance-day MAINTENANCE_DAY',
|
@@ -59,6 +64,7 @@ class Chef
|
|
59
64
|
|
60
65
|
cluster_properties = {
|
61
66
|
name: config[:name],
|
67
|
+
public: !config[:private],
|
62
68
|
k8s_version: config[:version],
|
63
69
|
api_subnet_allow_list: config[:api_subnet_allow_list],
|
64
70
|
s3_buckets: (config[:s3_buckets].nil? ? config[:s3_buckets] : config[:s3_buckets].map { |el| Ionoscloud::S3Bucket.new(name: el) }),
|
@@ -34,7 +34,7 @@ class Chef
|
|
34
34
|
unless ['ACTIVE', 'TERMINATED'].include? cluster.metadata.state
|
35
35
|
ui.error(
|
36
36
|
"K8s Cluster #{cluster_id} state must be one of ['ACTIVE', 'TERMINATED'], "\
|
37
|
-
"actual state is '#{cluster.metadata.state}'. Skipping."
|
37
|
+
"actual state is '#{cluster.metadata.state}'. Skipping.",
|
38
38
|
)
|
39
39
|
next
|
40
40
|
end
|
@@ -49,7 +49,7 @@ class Chef
|
|
49
49
|
|
50
50
|
begin
|
51
51
|
confirm('Do you really want to delete this K8s Cluster')
|
52
|
-
rescue SystemExit
|
52
|
+
rescue SystemExit
|
53
53
|
next
|
54
54
|
end
|
55
55
|
|
@@ -23,6 +23,7 @@ class Chef
|
|
23
23
|
cluster_list = [
|
24
24
|
ui.color('ID', :bold),
|
25
25
|
ui.color('Name', :bold),
|
26
|
+
ui.color('Public', :bold),
|
26
27
|
ui.color('Version', :bold),
|
27
28
|
ui.color('Maintenance Window', :bold),
|
28
29
|
ui.color('State', :bold),
|
@@ -33,12 +34,13 @@ class Chef
|
|
33
34
|
kubernetes_api.k8s_get({ depth: 1 }).items.each do |cluster|
|
34
35
|
cluster_list << cluster.id
|
35
36
|
cluster_list << cluster.properties.name
|
37
|
+
cluster_list << cluster.properties.public
|
36
38
|
cluster_list << cluster.properties.k8s_version
|
37
39
|
cluster_list << "#{cluster.properties.maintenance_window.day_of_the_week}, #{cluster.properties.maintenance_window.time}"
|
38
40
|
cluster_list << cluster.metadata.state
|
39
41
|
end
|
40
42
|
|
41
|
-
puts ui.list(cluster_list, :uneven_columns_across,
|
43
|
+
puts ui.list(cluster_list, :uneven_columns_across, 6)
|
42
44
|
end
|
43
45
|
end
|
44
46
|
end
|
@@ -62,14 +62,10 @@ class Chef
|
|
62
62
|
if @updatable_fields.map { |el| config[el] }.any?
|
63
63
|
print "#{ui.color('Updating K8s Cluster...', :magenta)}"
|
64
64
|
|
65
|
-
if config[:api_subnet_allow_list] && config[:api_subnet_allow_list].instance_of?(String)
|
66
|
-
config[:api_subnet_allow_list] = config[:api_subnet_allow_list].split(',')
|
67
|
-
end
|
65
|
+
config[:api_subnet_allow_list] = config[:api_subnet_allow_list].split(',') if config[:api_subnet_allow_list] && config[:api_subnet_allow_list].instance_of?(String)
|
68
66
|
config[:s3_buckets] = config[:s3_buckets].split(',') if config[:s3_buckets] && config[:s3_buckets].instance_of?(String)
|
69
67
|
|
70
|
-
if config.key?(:s3_buckets)
|
71
|
-
config[:s3_buckets] = config[:s3_buckets].map { |el| Ionoscloud::S3Bucket.new(name: el) }
|
72
|
-
end
|
68
|
+
config[:s3_buckets] = config[:s3_buckets].map { |el| Ionoscloud::S3Bucket.new(name: el) } if config.key?(:s3_buckets)
|
73
69
|
|
74
70
|
cluster = kubernetes_api.k8s_find_by_cluster_id(config[:cluster_id])
|
75
71
|
|
@@ -56,9 +56,7 @@ class Chef
|
|
56
56
|
validate_required_params([:resource_id], config)
|
57
57
|
labels = label_api.snapshots_labels_get(config[:resource_id], opts)
|
58
58
|
else
|
59
|
-
if !config[:type].nil?
|
60
|
-
ui.warn("#{config[:type]} is not a valid Resource Type. Returning all available labels.")
|
61
|
-
end
|
59
|
+
ui.warn("#{config[:type]} is not a valid Resource Type. Returning all available labels.") if !config[:type].nil?
|
62
60
|
labels = label_api.labels_get(opts)
|
63
61
|
end
|
64
62
|
|
@@ -30,7 +30,7 @@ class Chef
|
|
30
30
|
option :protocol,
|
31
31
|
short: '-p PROTOCOL',
|
32
32
|
long: '--protocol PROTOCOL',
|
33
|
-
description:
|
33
|
+
description: 'Protocol of the NAT gateway rule. Defaults to ALL. If protocol is '\
|
34
34
|
"'ICMP' then target_port_range start and end cannot be set."
|
35
35
|
|
36
36
|
option :source_subnet,
|
@@ -35,7 +35,7 @@ class Chef
|
|
35
35
|
option :protocol,
|
36
36
|
short: '-p PROTOCOL',
|
37
37
|
long: '--protocol PROTOCOL',
|
38
|
-
description:
|
38
|
+
description: 'Protocol of the NAT gateway rule. Defaults to ALL. If protocol is '\
|
39
39
|
"'ICMP' then target_port_range start and end cannot be set."
|
40
40
|
|
41
41
|
option :source_subnet,
|
@@ -49,8 +49,7 @@ class Chef
|
|
49
49
|
|
50
50
|
config[:ips] = config[:ips].split(',') if config[:ips] && config[:ips].instance_of?(String)
|
51
51
|
config[:lans] = JSON[config[:lans]] if config[:lans] && config[:lans].instance_of?(String)
|
52
|
-
config[:lans] = config[:lans].map do
|
53
|
-
|lan|
|
52
|
+
config[:lans] = config[:lans].map do |lan|
|
54
53
|
Ionoscloud::NatGatewayLanProperties.new(
|
55
54
|
id: lan['id'],
|
56
55
|
gateway_ips: lan['gateway_ips'],
|
@@ -84,8 +84,7 @@ class Chef
|
|
84
84
|
config[:gateway_ips] = config[:gateway_ips].split(',') if config[:gateway_ips] && config[:gateway_ips].instance_of?(String)
|
85
85
|
config[:targets] = JSON[config[:targets]] if config[:targets] && config[:targets].instance_of?(String)
|
86
86
|
|
87
|
-
config[:targets] = config[:targets].map do
|
88
|
-
|condition|
|
87
|
+
config[:targets] = config[:targets].map do |condition|
|
89
88
|
Ionoscloud::NetworkLoadBalancerForwardingRuleTarget.new(
|
90
89
|
ip: condition['ip'],
|
91
90
|
port: condition['port'],
|
@@ -56,8 +56,7 @@ class Chef
|
|
56
56
|
|
57
57
|
initial_length = network_load_balancer_rule.properties.targets.length
|
58
58
|
|
59
|
-
network_load_balancer_rule.properties.targets = network_load_balancer_rule.properties.targets.reject do
|
60
|
-
|target|
|
59
|
+
network_load_balancer_rule.properties.targets = network_load_balancer_rule.properties.targets.reject do |target|
|
61
60
|
target.ip == config[:ip] && target.port == Integer(config[:port])
|
62
61
|
end
|
63
62
|
|
@@ -93,8 +93,7 @@ class Chef
|
|
93
93
|
config[:gateway_ips] = config[:gateway_ips].split(',') if config[:gateway_ips] && config[:gateway_ips].instance_of?(String)
|
94
94
|
config[:targets] = JSON[config[:targets]] if config[:targets] && config[:targets].instance_of?(String)
|
95
95
|
|
96
|
-
config[:targets] = config[:targets].map do
|
97
|
-
|target|
|
96
|
+
config[:targets] = config[:targets].map do |target|
|
98
97
|
Ionoscloud::NetworkLoadBalancerForwardingRuleTarget.new(
|
99
98
|
ip: target['ip'],
|
100
99
|
port: target['port'],
|
@@ -47,8 +47,8 @@ class Chef
|
|
47
47
|
def initialize(args = [])
|
48
48
|
super(args)
|
49
49
|
@description =
|
50
|
-
|
51
|
-
|
50
|
+
'Creates a NIC on the specified server. The Ionoscloud platform supports adding multiple NICs to a server. These NICs '\
|
51
|
+
'can be used to create different, segmented networks on the platform.'
|
52
52
|
@directory = 'compute-engine'
|
53
53
|
@required_options = [:datacenter_id, :server_id, :lan, :ionoscloud_username, :ionoscloud_password]
|
54
54
|
end
|
@@ -67,7 +67,7 @@ class Chef
|
|
67
67
|
ips: config[:ips],
|
68
68
|
dhcp: config[:dhcp],
|
69
69
|
lan: config[:lan],
|
70
|
-
firewall_type: config[:firewall_type]
|
70
|
+
firewall_type: config[:firewall_type],
|
71
71
|
}.compact
|
72
72
|
|
73
73
|
nic_api = Ionoscloud::NetworkInterfacesApi.new(api_client)
|
@@ -23,9 +23,9 @@ class Chef
|
|
23
23
|
@description =
|
24
24
|
"You can recreate a single Kubernetes Node.\n\n"\
|
25
25
|
"Managed Kubernetes starts a process which based on the nodepool\'s "\
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
'template creates & configures a new node, waits for status "ACTIVE", '\
|
27
|
+
'and migrates all the pods from the faulty node, deleting it once empty. '\
|
28
|
+
'While this operation occurs, the nodepool will have an extra billable "ACTIVE" node.'
|
29
29
|
@directory = 'kubernetes'
|
30
30
|
@required_options = [:cluster_id, :nodepool_id, :ionoscloud_username, :ionoscloud_password]
|
31
31
|
end
|
@@ -81,6 +81,10 @@ class Chef
|
|
81
81
|
long: '--lans LAN_ID [LAN_ID]',
|
82
82
|
description: 'An array of additional private LANs attached to worker nodes'
|
83
83
|
|
84
|
+
option :gateway_ip,
|
85
|
+
long: '--gateway GATEWAY_IP',
|
86
|
+
description: "Public IP address for the gateway performing source NAT for the node pool's nodes belonging to a private cluster. Required only if the node pool belongs to a private cluster."
|
87
|
+
|
84
88
|
option :public_ips,
|
85
89
|
long: '--ips PUBLIC_IP [PUBLIC_IP]',
|
86
90
|
description: 'Optional array of reserved public IP addresses to be used by the nodes. '\
|
@@ -99,9 +103,9 @@ class Chef
|
|
99
103
|
def initialize(args = [])
|
100
104
|
super(args)
|
101
105
|
@description =
|
102
|
-
|
106
|
+
'Creates a node pool into an existing Kubernetes cluster. '\
|
103
107
|
"The Kubernetes cluster must be in state \"ACTIVE\" before creating a node pool.\n\n"\
|
104
|
-
|
108
|
+
'The worker nodes within the node pools will be deployed into an existing data centers.'
|
105
109
|
@directory = 'kubernetes'
|
106
110
|
@required_options = [
|
107
111
|
:datacenter_id, :cluster_id, :name, :version, :node_count, :cpu_family, :cores, :ram,
|
@@ -134,6 +138,7 @@ class Chef
|
|
134
138
|
availability_zone: config[:availability_zone],
|
135
139
|
storage_type: config[:storage_type],
|
136
140
|
storage_size: config[:storage_size],
|
141
|
+
gateway_ip: config[:gateway_ip],
|
137
142
|
public_ips: config[:public_ips],
|
138
143
|
labels: config[:labels],
|
139
144
|
annotations: config[:annotations],
|
@@ -30,6 +30,7 @@ class Chef
|
|
30
30
|
ui.color('Name', :bold),
|
31
31
|
ui.color('K8s Version', :bold),
|
32
32
|
ui.color('Datacenter ID', :bold),
|
33
|
+
ui.color('Gateway IP', :bold),
|
33
34
|
ui.color('Node Count', :bold),
|
34
35
|
ui.color('Lan Count', :bold),
|
35
36
|
ui.color('State', :bold),
|
@@ -42,11 +43,12 @@ class Chef
|
|
42
43
|
nodepool_list << nodepool.properties.name
|
43
44
|
nodepool_list << nodepool.properties.k8s_version
|
44
45
|
nodepool_list << nodepool.properties.datacenter_id
|
46
|
+
nodepool_list << nodepool.properties.gateway_ip
|
45
47
|
nodepool_list << nodepool.properties.node_count.to_s
|
46
48
|
nodepool_list << nodepool.properties.lans.length
|
47
49
|
nodepool_list << nodepool.metadata.state
|
48
50
|
end
|
49
|
-
puts ui.list(nodepool_list, :uneven_columns_across,
|
51
|
+
puts ui.list(nodepool_list, :uneven_columns_across, 8)
|
50
52
|
end
|
51
53
|
end
|
52
54
|
end
|
@@ -56,18 +56,14 @@ class Chef
|
|
56
56
|
begin
|
57
57
|
config[:limit] = Integer(config[:limit])
|
58
58
|
rescue *[ArgumentError, TypeError]
|
59
|
-
if config[:limit]
|
60
|
-
ui.warn('limit should be an Integer!')
|
61
|
-
end
|
59
|
+
ui.warn('limit should be an Integer!') if config[:limit]
|
62
60
|
config[:limit] = 20
|
63
61
|
end
|
64
62
|
|
65
63
|
begin
|
66
64
|
config[:offset] = Integer(config[:offset])
|
67
65
|
rescue *[ArgumentError, TypeError]
|
68
|
-
if config[:offset]
|
69
|
-
ui.warn('offset should be an Integer!')
|
70
|
-
end
|
66
|
+
ui.warn('offset should be an Integer!') if config[:offset]
|
71
67
|
config[:offset] = 0
|
72
68
|
end
|
73
69
|
|
@@ -77,21 +73,13 @@ class Chef
|
|
77
73
|
offset: config[:offset],
|
78
74
|
}
|
79
75
|
|
80
|
-
if config[:status] && ['QUEUED', 'RUNNING', 'DONE', 'FAILED'].include?(config[:status])
|
81
|
-
opts[:filter_request_status] = config[:status]
|
82
|
-
end
|
76
|
+
opts[:filter_request_status] = config[:status] if config[:status] && ['QUEUED', 'RUNNING', 'DONE', 'FAILED'].include?(config[:status])
|
83
77
|
|
84
|
-
if config[:status] && !['QUEUED', 'RUNNING', 'DONE', 'FAILED'].include?(config[:status])
|
85
|
-
ui.warn('status should be one of [QUEUED, RUNNING, DONE, FAILED]')
|
86
|
-
end
|
78
|
+
ui.warn('status should be one of [QUEUED, RUNNING, DONE, FAILED]') if config[:status] && !['QUEUED', 'RUNNING', 'DONE', 'FAILED'].include?(config[:status])
|
87
79
|
|
88
|
-
if config[:method] && ['POST', 'PUT', 'PATCH', 'DELETE'].include?(config[:method])
|
89
|
-
opts[:filter_method] = config[:method]
|
90
|
-
end
|
80
|
+
opts[:filter_method] = config[:method] if config[:method] && ['POST', 'PUT', 'PATCH', 'DELETE'].include?(config[:method])
|
91
81
|
|
92
|
-
if config[:method] && !['POST', 'PUT', 'PATCH', 'DELETE'].include?(config[:method])
|
93
|
-
ui.warn('method should be one of [POST, PUT, PATCH, DELETE]')
|
94
|
-
end
|
82
|
+
ui.warn('method should be one of [POST, PUT, PATCH, DELETE]') if config[:method] && !['POST', 'PUT', 'PATCH', 'DELETE'].include?(config[:method])
|
95
83
|
|
96
84
|
request_api.requests_get(opts).items.each do |request|
|
97
85
|
request_list << request.id
|
@@ -20,13 +20,13 @@ class Chef
|
|
20
20
|
def initialize(args = [])
|
21
21
|
super(args)
|
22
22
|
@description =
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
'No option: Retrieves a list of all resources and optionally their group associations. '\
|
24
|
+
'Please Note: This API call can take a significant amount of time to return when there '\
|
25
|
+
'are a large number of provisioned resources. You may wish to consult the next section '\
|
26
26
|
"on how to list resources of a particular type.\n\n"
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
'resource_type specified: Lists all shareable resources of a specific type. Optionally include their '\
|
28
|
+
'association with groups, permissions that a group has for the resource, and '\
|
29
|
+
'users that are members of the group. Because you are scoping your request to '\
|
30
30
|
"a specific resource type, this API will likely return faster than querying */um/resources*.\n\n"\
|
31
31
|
"The values available for resourceType are listed in this table:\n\n"\
|
32
32
|
"| ResourceType | Description |\n"\
|
@@ -35,9 +35,9 @@ class Chef
|
|
35
35
|
"| snapshot | A snapshot of a storage volume. |\n"\
|
36
36
|
"| ipblock | An IP block that has been reserved. |\n"\
|
37
37
|
"| k8s | A Kubernetes cluster. |\n\n"\
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
'resource_type and resource_id specified: Retrieves a specific resource.'\
|
39
|
+
'**NOTE:** if you pass the *resource_id* option it is necessary to also pass the '\
|
40
|
+
'*resource_type* option or a list of all resources will be returned.'
|
41
41
|
@directory = 'user'
|
42
42
|
@required_options = [:ionoscloud_username, :ionoscloud_password]
|
43
43
|
end
|
@@ -55,9 +55,7 @@ class Chef
|
|
55
55
|
ui.color('Name', :bold),
|
56
56
|
]
|
57
57
|
|
58
|
-
if config[:resource_id] && !config[:resource_type]
|
59
|
-
ui.warn('Ignoring resource_id because no resource_type was specified.')
|
60
|
-
end
|
58
|
+
ui.warn('Ignoring resource_id because no resource_type was specified.') if config[:resource_id] && !config[:resource_type]
|
61
59
|
|
62
60
|
opts = { depth: 1 }
|
63
61
|
|