knife-ionoscloud 6.0.0.beta.1 → 6.0.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef/knife/ionoscloud_backupunit_create.rb +10 -14
- data/lib/chef/knife/ionoscloud_backupunit_delete.rb +1 -4
- data/lib/chef/knife/ionoscloud_backupunit_get.rb +33 -0
- data/lib/chef/knife/ionoscloud_backupunit_update.rb +62 -0
- data/lib/chef/knife/ionoscloud_base.rb +308 -0
- data/lib/chef/knife/ionoscloud_cube_server_create.rb +3 -7
- data/lib/chef/knife/ionoscloud_datacenter_create.rb +10 -13
- data/lib/chef/knife/ionoscloud_datacenter_delete.rb +1 -6
- data/lib/chef/knife/ionoscloud_datacenter_get.rb +33 -0
- data/lib/chef/knife/ionoscloud_datacenter_update.rb +67 -0
- data/lib/chef/knife/ionoscloud_firewall_create.rb +7 -19
- data/lib/chef/knife/ionoscloud_firewall_delete.rb +2 -11
- data/lib/chef/knife/ionoscloud_firewall_get.rb +52 -0
- data/lib/chef/knife/ionoscloud_firewall_update.rb +133 -0
- data/lib/chef/knife/ionoscloud_flowlog_create.rb +4 -10
- data/lib/chef/knife/ionoscloud_flowlog_delete.rb +8 -12
- data/lib/chef/knife/ionoscloud_flowlog_get.rb +84 -0
- data/lib/chef/knife/ionoscloud_flowlog_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_flowlog_update.rb +127 -0
- data/lib/chef/knife/ionoscloud_group_create.rb +1 -16
- data/lib/chef/knife/ionoscloud_group_delete.rb +1 -18
- data/lib/chef/knife/ionoscloud_group_get.rb +1 -19
- data/lib/chef/knife/ionoscloud_group_update.rb +131 -0
- data/lib/chef/knife/ionoscloud_group_user_add.rb +1 -18
- data/lib/chef/knife/ionoscloud_group_user_remove.rb +1 -18
- data/lib/chef/knife/ionoscloud_ipblock_create.rb +10 -13
- data/lib/chef/knife/ionoscloud_ipblock_delete.rb +1 -4
- data/lib/chef/knife/ionoscloud_ipblock_get.rb +33 -0
- data/lib/chef/knife/ionoscloud_ipblock_update.rb +57 -0
- data/lib/chef/knife/ionoscloud_k8s_create.rb +27 -35
- data/lib/chef/knife/ionoscloud_k8s_delete.rb +1 -9
- data/lib/chef/knife/ionoscloud_k8s_get.rb +33 -0
- data/lib/chef/knife/ionoscloud_k8s_update.rb +99 -0
- data/lib/chef/knife/ionoscloud_lan_create.rb +5 -13
- data/lib/chef/knife/ionoscloud_lan_delete.rb +2 -3
- data/lib/chef/knife/ionoscloud_lan_get.rb +38 -0
- data/lib/chef/knife/ionoscloud_lan_list.rb +1 -0
- data/lib/chef/knife/ionoscloud_lan_update.rb +76 -0
- data/lib/chef/knife/ionoscloud_loadbalancer_create.rb +3 -13
- data/lib/chef/knife/ionoscloud_loadbalancer_delete.rb +1 -8
- data/lib/chef/knife/ionoscloud_loadbalancer_get.rb +2 -12
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_add.rb +2 -14
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_remove.rb +2 -15
- data/lib/chef/knife/ionoscloud_loadbalancer_update.rb +73 -0
- data/lib/chef/knife/ionoscloud_natgateway_create.rb +4 -14
- data/lib/chef/knife/ionoscloud_natgateway_delete.rb +2 -18
- data/lib/chef/knife/ionoscloud_natgateway_get.rb +42 -0
- data/lib/chef/knife/ionoscloud_natgateway_lan_add.rb +1 -8
- data/lib/chef/knife/ionoscloud_natgateway_lan_remove.rb +1 -8
- data/lib/chef/knife/ionoscloud_natgateway_list.rb +1 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_add.rb +4 -22
- data/lib/chef/knife/ionoscloud_natgateway_rule_list.rb +1 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_remove.rb +3 -21
- data/lib/chef/knife/ionoscloud_natgateway_rule_update.rb +116 -0
- data/lib/chef/knife/ionoscloud_natgateway_update.rb +84 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_create.rb +4 -11
- data/lib/chef/knife/ionoscloud_networkloadbalancer_delete.rb +2 -22
- data/lib/chef/knife/ionoscloud_networkloadbalancer_get.rb +42 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_add.rb +25 -35
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_list.rb +1 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_remove.rb +19 -30
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_add.rb +4 -22
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_list.rb +1 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove.rb +4 -22
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_update.rb +148 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_update.rb +98 -0
- data/lib/chef/knife/ionoscloud_nic_create.rb +6 -16
- data/lib/chef/knife/ionoscloud_nic_delete.rb +2 -8
- data/lib/chef/knife/ionoscloud_nic_get.rb +49 -0
- data/lib/chef/knife/ionoscloud_nic_update.rb +96 -0
- data/lib/chef/knife/ionoscloud_node_get.rb +49 -0
- data/lib/chef/knife/ionoscloud_nodepool_create.rb +22 -51
- data/lib/chef/knife/ionoscloud_nodepool_delete.rb +1 -32
- data/lib/chef/knife/ionoscloud_nodepool_get.rb +43 -0
- data/lib/chef/knife/ionoscloud_nodepool_lan_add.rb +1 -26
- data/lib/chef/knife/ionoscloud_nodepool_lan_remove.rb +1 -26
- data/lib/chef/knife/ionoscloud_nodepool_update.rb +124 -0
- data/lib/chef/knife/ionoscloud_pcc_create.rb +9 -15
- data/lib/chef/knife/ionoscloud_pcc_delete.rb +1 -9
- data/lib/chef/knife/ionoscloud_pcc_get.rb +33 -0
- data/lib/chef/knife/ionoscloud_pcc_update.rb +63 -0
- data/lib/chef/knife/ionoscloud_request_get.rb +40 -0
- data/lib/chef/knife/ionoscloud_s3key_create.rb +1 -5
- data/lib/chef/knife/ionoscloud_s3key_delete.rb +1 -4
- data/lib/chef/knife/ionoscloud_s3key_get.rb +38 -0
- data/lib/chef/knife/ionoscloud_server_create.rb +12 -24
- data/lib/chef/knife/ionoscloud_server_delete.rb +2 -8
- data/lib/chef/knife/ionoscloud_server_get.rb +43 -0
- data/lib/chef/knife/ionoscloud_server_update.rb +97 -0
- data/lib/chef/knife/ionoscloud_share_create.rb +7 -11
- data/lib/chef/knife/ionoscloud_share_delete.rb +2 -3
- data/lib/chef/knife/ionoscloud_share_get.rb +38 -0
- data/lib/chef/knife/ionoscloud_share_update.rb +70 -0
- data/lib/chef/knife/ionoscloud_snapshot_create.rb +1 -9
- data/lib/chef/knife/ionoscloud_snapshot_delete.rb +1 -6
- data/lib/chef/knife/ionoscloud_snapshot_get.rb +32 -0
- data/lib/chef/knife/ionoscloud_snapshot_restore.rb +1 -12
- data/lib/chef/knife/ionoscloud_snapshot_update.rb +126 -0
- data/lib/chef/knife/ionoscloud_user_create.rb +1 -8
- data/lib/chef/knife/ionoscloud_user_delete.rb +1 -6
- data/lib/chef/knife/ionoscloud_user_get.rb +32 -0
- data/lib/chef/knife/ionoscloud_user_update.rb +92 -0
- data/lib/chef/knife/ionoscloud_volume_create.rb +1 -12
- data/lib/chef/knife/ionoscloud_volume_delete.rb +2 -8
- data/lib/chef/knife/ionoscloud_volume_get.rb +36 -0
- data/lib/chef/knife/ionoscloud_volume_update.rb +106 -0
- data/lib/knife-ionoscloud/version.rb +1 -1
- data/spec/chef/knife/ionoscloud_backupunit_get_spec.rb +65 -0
- data/spec/chef/knife/ionoscloud_backupunit_update_spec.rb +78 -0
- data/spec/chef/knife/ionoscloud_datacenter_create_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_datacenter_delete_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_datacenter_get_spec.rb +69 -0
- data/spec/chef/knife/ionoscloud_datacenter_update_spec.rb +82 -0
- data/spec/chef/knife/ionoscloud_firewall_create_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_firewall_delete_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_firewall_get_spec.rb +77 -0
- data/spec/chef/knife/ionoscloud_firewall_update_spec.rb +117 -0
- data/spec/chef/knife/ionoscloud_flowlog_create_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_flowlog_delete_spec.rb +10 -10
- data/spec/chef/knife/ionoscloud_flowlog_get_spec.rb +171 -0
- data/spec/chef/knife/ionoscloud_flowlog_list_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_flowlog_update_spec.rb +244 -0
- data/spec/chef/knife/ionoscloud_group_create_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_group_update_spec.rb +121 -0
- data/spec/chef/knife/ionoscloud_group_user_add_spec.rb +6 -0
- data/spec/chef/knife/ionoscloud_group_user_remove_spec.rb +6 -0
- data/spec/chef/knife/ionoscloud_ipblock_get_spec.rb +66 -0
- data/spec/chef/knife/ionoscloud_ipblock_update_spec.rb +79 -0
- data/spec/chef/knife/ionoscloud_ipfailover_add_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_ipfailover_remove_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_k8s_create_spec.rb +7 -0
- data/spec/chef/knife/ionoscloud_k8s_delete_spec.rb +16 -11
- data/spec/chef/knife/ionoscloud_k8s_get_spec.rb +72 -0
- data/spec/chef/knife/ionoscloud_k8s_update_spec.rb +114 -0
- data/spec/chef/knife/ionoscloud_lan_create_spec.rb +1 -0
- data/spec/chef/knife/ionoscloud_lan_delete_spec.rb +2 -0
- data/spec/chef/knife/ionoscloud_lan_get_spec.rb +68 -0
- data/spec/chef/knife/ionoscloud_lan_update_spec.rb +87 -0
- data/spec/chef/knife/ionoscloud_loadbalancer_update_spec.rb +89 -0
- data/spec/chef/knife/ionoscloud_natgateway_create_spec.rb +15 -0
- data/spec/chef/knife/ionoscloud_natgateway_get_spec.rb +81 -0
- data/spec/chef/knife/ionoscloud_natgateway_lan_add_spec.rb +15 -0
- data/spec/chef/knife/ionoscloud_natgateway_lan_remove_spec.rb +15 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_add_spec.rb +1 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_remove_spec.rb +1 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_update_spec.rb +121 -0
- data/spec/chef/knife/ionoscloud_natgateway_update_spec.rb +121 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_create_spec.rb +13 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_delete_spec.rb +3 -2
- data/spec/chef/knife/ionoscloud_networkloadbalancer_get_spec.rb +82 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_add_spec.rb +4 -3
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_remove_spec.rb +70 -44
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_add_spec.rb +26 -22
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove_spec.rb +79 -61
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_update_spec.rb +163 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_update_spec.rb +107 -0
- data/spec/chef/knife/ionoscloud_nic_get_spec.rb +72 -0
- data/spec/chef/knife/ionoscloud_nic_update_spec.rb +97 -0
- data/spec/chef/knife/ionoscloud_node_get_spec.rb +70 -0
- data/spec/chef/knife/ionoscloud_nodepool_create_spec.rb +8 -17
- data/spec/chef/knife/ionoscloud_nodepool_delete_spec.rb +14 -0
- data/spec/chef/knife/ionoscloud_nodepool_get_spec.rb +83 -0
- data/spec/chef/knife/ionoscloud_nodepool_lan_add_spec.rb +29 -33
- data/spec/chef/knife/ionoscloud_nodepool_lan_remove.rb +14 -17
- data/spec/chef/knife/ionoscloud_nodepool_update_spec.rb +134 -0
- data/spec/chef/knife/ionoscloud_pcc_create_spec.rb +5 -2
- data/spec/chef/knife/ionoscloud_pcc_delete_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_pcc_get_spec.rb +71 -0
- data/spec/chef/knife/ionoscloud_pcc_update_spec.rb +83 -0
- data/spec/chef/knife/ionoscloud_request_get_spec.rb +69 -0
- data/spec/chef/knife/ionoscloud_s3key_get_spec.rb +66 -0
- data/spec/chef/knife/ionoscloud_server_create_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_server_delete_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_server_get_spec.rb +74 -0
- data/spec/chef/knife/ionoscloud_server_update_spec.rb +105 -0
- data/spec/chef/knife/ionoscloud_share_get_spec.rb +66 -0
- data/spec/chef/knife/ionoscloud_share_update_spec.rb +91 -0
- data/spec/chef/knife/ionoscloud_snapshot_create_spec.rb +12 -0
- data/spec/chef/knife/ionoscloud_snapshot_delete_spec.rb +12 -0
- data/spec/chef/knife/ionoscloud_snapshot_get_spec.rb +79 -0
- data/spec/chef/knife/ionoscloud_snapshot_restore_spec.rb +9 -0
- data/spec/chef/knife/ionoscloud_snapshot_update_spec.rb +113 -0
- data/spec/chef/knife/ionoscloud_user_create_spec.rb +3 -1
- data/spec/chef/knife/ionoscloud_user_delete_spec.rb +4 -2
- data/spec/chef/knife/ionoscloud_user_get_spec.rb +70 -0
- data/spec/chef/knife/ionoscloud_user_update_spec.rb +110 -0
- data/spec/chef/knife/ionoscloud_volume_create_spec.rb +15 -5
- data/spec/chef/knife/ionoscloud_volume_delete_spec.rb +10 -0
- data/spec/chef/knife/ionoscloud_volume_get_spec.rb +81 -0
- data/spec/chef/knife/ionoscloud_volume_update_spec.rb +116 -0
- data/spec/spec_helper.rb +41 -23
- metadata +125 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7eb585be2cb294b884a7a37fa48edfc54998716ffcbce169898372eb9e24f143
|
4
|
+
data.tar.gz: 95ea0e6e4ab11d865c63537b6dd63bef204197e1a32610a3c7208018c8c7f8a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd0ee5ff7332cfb3004000b7d8f422bf370d4e0d06c0c4185144fb83d790b123d3479f3cf1886cbd2f5eb4a9c78d3baed152f6941db3687c47e3825400bdbed0
|
7
|
+
data.tar.gz: d1b0da891bea8cf664277a8d298cefbc1d42c08b698d9c7810011346b92f437526104049c0926535c083c0883836af6c18989bf2472b30f36ceb3e4a5d9aafc8
|
@@ -40,24 +40,20 @@ class Chef
|
|
40
40
|
|
41
41
|
backupunit_api = Ionoscloud::BackupUnitsApi.new(api_client)
|
42
42
|
|
43
|
-
backupunit, _, headers = backupunit_api.backupunits_post_with_http_info(
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
backupunit, _, headers = backupunit_api.backupunits_post_with_http_info(
|
44
|
+
Ionoscloud::BackupUnit.new(
|
45
|
+
properties: Ionoscloud::BackupUnitProperties.new(
|
46
|
+
name: config[:name],
|
47
|
+
password: config[:password],
|
48
|
+
email: config[:email],
|
49
|
+
),
|
50
|
+
),
|
51
|
+
)
|
50
52
|
|
51
53
|
dot = ui.color('.', :magenta)
|
52
54
|
api_client.wait_for { print dot; is_done? get_request_id headers }
|
53
55
|
|
54
|
-
|
55
|
-
|
56
|
-
puts "\n"
|
57
|
-
puts "#{ui.color('ID', :cyan)}: #{backupunit.id}"
|
58
|
-
puts "#{ui.color('Name', :cyan)}: #{backupunit.properties.name}"
|
59
|
-
puts "#{ui.color('Email', :cyan)}: #{backupunit.properties.email}"
|
60
|
-
puts 'done'
|
56
|
+
print_backupunit(backupunit)
|
61
57
|
end
|
62
58
|
end
|
63
59
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudBackupunitGet < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud backupunit get (options)'
|
9
|
+
|
10
|
+
option :backupunit_id,
|
11
|
+
short: '-B BACKUPUNIT_ID',
|
12
|
+
long: '--backupunit-id BACKUPUNIT_ID',
|
13
|
+
description: 'The ID of the Backup unit.'
|
14
|
+
|
15
|
+
attr_reader :description, :required_options
|
16
|
+
|
17
|
+
def initialize(args = [])
|
18
|
+
super(args)
|
19
|
+
@description =
|
20
|
+
'Retrieves information about a backup unit.'
|
21
|
+
@required_options = [:backupunit_id, :ionoscloud_username, :ionoscloud_password]
|
22
|
+
end
|
23
|
+
|
24
|
+
def run
|
25
|
+
$stdout.sync = true
|
26
|
+
handle_extra_config
|
27
|
+
validate_required_params(@required_options, config)
|
28
|
+
|
29
|
+
print_backupunit(Ionoscloud::BackupUnitsApi.new(api_client).backupunits_find_by_id(config[:backupunit_id]))
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudBackupunitUpdate < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud backupunit update (options)'
|
9
|
+
|
10
|
+
option :backupunit_id,
|
11
|
+
short: '-B BACKUPUNIT_ID',
|
12
|
+
long: '--backupunit-id BACKUPUNIT_ID',
|
13
|
+
description: 'The ID of the Backup unit.'
|
14
|
+
|
15
|
+
option :password,
|
16
|
+
short: '-p PASSWORD',
|
17
|
+
long: '--password PASSWORD',
|
18
|
+
description: 'Alphanumeric password you want assigned to the backup unit'
|
19
|
+
|
20
|
+
option :email,
|
21
|
+
long: '--email EMAIL',
|
22
|
+
description: 'The e-mail address you want assigned to the backup unit.'
|
23
|
+
|
24
|
+
attr_reader :description, :required_options
|
25
|
+
|
26
|
+
def initialize(args = [])
|
27
|
+
super(args)
|
28
|
+
@description =
|
29
|
+
'Retrieves information about a backup unit.'
|
30
|
+
@required_options = [:backupunit_id, :ionoscloud_username, :ionoscloud_password]
|
31
|
+
@updatable_fields = [:email, :password]
|
32
|
+
end
|
33
|
+
|
34
|
+
def run
|
35
|
+
$stdout.sync = true
|
36
|
+
handle_extra_config
|
37
|
+
validate_required_params(@required_options, config)
|
38
|
+
|
39
|
+
backupunit_api = Ionoscloud::BackupUnitsApi.new(api_client)
|
40
|
+
|
41
|
+
if @updatable_fields.map { |el| config[el] }.any?
|
42
|
+
print "#{ui.color('Updating Backup unit...', :magenta)}"
|
43
|
+
|
44
|
+
backupunit, _, headers = backupunit_api.backupunits_patch_with_http_info(
|
45
|
+
config[:backupunit_id],
|
46
|
+
Ionoscloud::BackupUnitProperties.new(
|
47
|
+
password: config[:password],
|
48
|
+
email: config[:email],
|
49
|
+
),
|
50
|
+
)
|
51
|
+
|
52
|
+
dot = ui.color('.', :magenta)
|
53
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
54
|
+
else
|
55
|
+
ui.warn("Nothing to update, please set one of the attributes #{@updatable_fields}.")
|
56
|
+
end
|
57
|
+
|
58
|
+
print_backupunit(Ionoscloud::BackupUnitsApi.new(api_client).backupunits_find_by_id(config[:backupunit_id]))
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -3,6 +3,12 @@ require 'chef/knife'
|
|
3
3
|
class Chef
|
4
4
|
class Knife
|
5
5
|
module IonoscloudBase
|
6
|
+
def initialize(args = [])
|
7
|
+
super(args)
|
8
|
+
@description = ''
|
9
|
+
@required_options = []
|
10
|
+
end
|
11
|
+
|
6
12
|
def self.included(includer)
|
7
13
|
includer.class_eval do
|
8
14
|
deps do
|
@@ -87,6 +93,308 @@ class Chef
|
|
87
93
|
end
|
88
94
|
response.metadata.status == 'DONE'
|
89
95
|
end
|
96
|
+
|
97
|
+
def print_datacenter(datacenter)
|
98
|
+
print "\n"
|
99
|
+
cpu_architecture = datacenter.properties.cpu_architecture.nil? ? [] : datacenter.properties.cpu_architecture.map { |arch| arch.to_hash }
|
100
|
+
puts "#{ui.color('ID', :cyan)}: #{datacenter.id}"
|
101
|
+
puts "#{ui.color('Name', :cyan)}: #{datacenter.properties.name}"
|
102
|
+
puts "#{ui.color('Description', :cyan)}: #{datacenter.properties.description}"
|
103
|
+
puts "#{ui.color('Location', :cyan)}: #{datacenter.properties.location}"
|
104
|
+
puts "#{ui.color('Version', :cyan)}: #{datacenter.properties.version}"
|
105
|
+
puts "#{ui.color('Features', :cyan)}: #{datacenter.properties.features}"
|
106
|
+
puts "#{ui.color('CPU Architecture', :cyan)}: #{cpu_architecture}"
|
107
|
+
puts "#{ui.color('Sec Auth Protection', :cyan)}: #{datacenter.properties.sec_auth_protection}"
|
108
|
+
end
|
109
|
+
|
110
|
+
def print_backupunit(backupunit)
|
111
|
+
print "\n"
|
112
|
+
puts "#{ui.color('ID', :cyan)}: #{backupunit.id}"
|
113
|
+
puts "#{ui.color('Name', :cyan)}: #{backupunit.properties.name}"
|
114
|
+
puts "#{ui.color('Email', :cyan)}: #{backupunit.properties.email}"
|
115
|
+
end
|
116
|
+
|
117
|
+
def print_firewall_rule(firewall)
|
118
|
+
print "\n"
|
119
|
+
puts "#{ui.color('ID', :cyan)}: #{firewall.id}"
|
120
|
+
puts "#{ui.color('Name', :cyan)}: #{firewall.properties.name}"
|
121
|
+
puts "#{ui.color('Type', :cyan)}: #{firewall.properties.type}"
|
122
|
+
puts "#{ui.color('Protocol', :cyan)}: #{firewall.properties.protocol}"
|
123
|
+
puts "#{ui.color('Source MAC', :cyan)}: #{firewall.properties.source_mac}"
|
124
|
+
puts "#{ui.color('Source IP', :cyan)}: #{firewall.properties.source_ip}"
|
125
|
+
puts "#{ui.color('Target IP', :cyan)}: #{firewall.properties.target_ip}"
|
126
|
+
puts "#{ui.color('Port Range Start', :cyan)}: #{firewall.properties.port_range_start}"
|
127
|
+
puts "#{ui.color('Port Range End', :cyan)}: #{firewall.properties.port_range_end}"
|
128
|
+
puts "#{ui.color('ICMP Type', :cyan)}: #{firewall.properties.icmp_type}"
|
129
|
+
puts "#{ui.color('ICMP Code', :cyan)}: #{firewall.properties.icmp_code}"
|
130
|
+
end
|
131
|
+
|
132
|
+
def print_group(group)
|
133
|
+
print "\n"
|
134
|
+
puts "#{ui.color('ID', :cyan)}: #{group.id}"
|
135
|
+
puts "#{ui.color('Name', :cyan)}: #{group.properties.name}"
|
136
|
+
puts "#{ui.color('Create Datacenter', :cyan)}: #{group.properties.create_data_center.to_s}"
|
137
|
+
puts "#{ui.color('Create Snapshot', :cyan)}: #{group.properties.create_snapshot.to_s}"
|
138
|
+
puts "#{ui.color('Reserve IP', :cyan)}: #{group.properties.reserve_ip.to_s}"
|
139
|
+
puts "#{ui.color('Access Activity Log', :cyan)}: #{group.properties.access_activity_log.to_s}"
|
140
|
+
puts "#{ui.color('S3 Privilege', :cyan)}: #{group.properties.s3_privilege.to_s}"
|
141
|
+
puts "#{ui.color('Create Backup Unit', :cyan)}: #{group.properties.create_backup_unit.to_s}"
|
142
|
+
puts "#{ui.color('Create K8s Clusters', :cyan)}: #{group.properties.create_k8s_cluster.to_s}"
|
143
|
+
puts "#{ui.color('Create PCC', :cyan)}: #{group.properties.create_pcc.to_s}"
|
144
|
+
puts "#{ui.color('Create Internet Acess', :cyan)}: #{group.properties.create_internet_access.to_s}"
|
145
|
+
puts "#{ui.color('Create Flow Logs', :cyan)}: #{group.properties.create_flow_log.to_s}"
|
146
|
+
puts "#{ui.color('Access and Manage Monitoring', :cyan)}: #{group.properties.access_and_manage_monitoring.to_s}"
|
147
|
+
puts "#{ui.color('Access and Manage Certificates', :cyan)}: #{group.properties.access_and_manage_certificates.to_s}"
|
148
|
+
|
149
|
+
puts "#{ui.color('Users', :cyan)}: #{(group.entities.users.items.map { |el| el.id }).to_s}" unless group.entities.users.items.nil?
|
150
|
+
end
|
151
|
+
|
152
|
+
def print_ipblock(ipblock)
|
153
|
+
print "\n"
|
154
|
+
ip_consumers = (ipblock.properties.ip_consumers.nil? ? [] : ipblock.properties.ip_consumers.map { |el| el.to_hash })
|
155
|
+
puts "#{ui.color('ID', :cyan)}: #{ipblock.id}"
|
156
|
+
puts "#{ui.color('Name', :cyan)}: #{ipblock.properties.name}"
|
157
|
+
puts "#{ui.color('Location', :cyan)}: #{ipblock.properties.location}"
|
158
|
+
puts "#{ui.color('IP Addresses', :cyan)}: #{ipblock.properties.ips}"
|
159
|
+
puts "#{ui.color('IP Consumers', :cyan)}: #{ip_consumers}"
|
160
|
+
end
|
161
|
+
|
162
|
+
def print_k8s_cluster(cluster)
|
163
|
+
print "\n"
|
164
|
+
maintenance_window = "#{cluster.properties.maintenance_window.day_of_the_week}, #{cluster.properties.maintenance_window.time}"
|
165
|
+
s3_buckets = (cluster.properties.s3_buckets.nil? ? [] : cluster.properties.s3_buckets.map { |el| el.name })
|
166
|
+
puts "#{ui.color('ID', :cyan)}: #{cluster.id}"
|
167
|
+
puts "#{ui.color('Name', :cyan)}: #{cluster.properties.name}"
|
168
|
+
puts "#{ui.color('k8s Version', :cyan)}: #{cluster.properties.k8s_version}"
|
169
|
+
puts "#{ui.color('Maintenance Window', :cyan)}: #{maintenance_window}"
|
170
|
+
puts "#{ui.color('State', :cyan)}: #{cluster.metadata.state}"
|
171
|
+
puts "#{ui.color('Api Subnet Allow List', :cyan)}: #{cluster.properties.api_subnet_allow_list}"
|
172
|
+
puts "#{ui.color('S3 Buckets', :cyan)}: #{s3_buckets}"
|
173
|
+
puts "#{ui.color('Available Upgrade Versions', :cyan)}: #{cluster.properties.available_upgrade_versions}"
|
174
|
+
puts "#{ui.color('Viable NodePool Versions', :cyan)}: #{cluster.properties.viable_node_pool_versions}"
|
175
|
+
end
|
176
|
+
|
177
|
+
def print_lan(lan)
|
178
|
+
print "\n"
|
179
|
+
ip_failovers = (lan.properties.ip_failover.nil? ? [] : lan.properties.ip_failover.map { |el| el.to_hash })
|
180
|
+
puts "#{ui.color('ID', :cyan)}: #{lan.id}"
|
181
|
+
puts "#{ui.color('Name', :cyan)}: #{lan.properties.name}"
|
182
|
+
puts "#{ui.color('Public', :cyan)}: #{lan.properties.public}"
|
183
|
+
puts "#{ui.color('PCC', :cyan)}: #{lan.properties.pcc}"
|
184
|
+
puts "#{ui.color('IP Failover', :cyan)}: #{ip_failovers}"
|
185
|
+
end
|
186
|
+
|
187
|
+
def print_load_balancer(load_balancer)
|
188
|
+
print "\n"
|
189
|
+
nics = load_balancer.entities.balancednics.items.map! { |el| el.id }
|
190
|
+
puts "#{ui.color('ID', :cyan)}: #{load_balancer.id}"
|
191
|
+
puts "#{ui.color('Name', :cyan)}: #{load_balancer.properties.name}"
|
192
|
+
puts "#{ui.color('IP address', :cyan)}: #{load_balancer.properties.ip}"
|
193
|
+
puts "#{ui.color('DHCP', :cyan)}: #{load_balancer.properties.dhcp}"
|
194
|
+
puts "#{ui.color('Balanced Nics', :cyan)}: #{nics.to_s}"
|
195
|
+
end
|
196
|
+
|
197
|
+
def print_nic(nic)
|
198
|
+
print "\n"
|
199
|
+
puts "#{ui.color('ID', :cyan)}: #{nic.id}"
|
200
|
+
puts "#{ui.color('Name', :cyan)}: #{nic.properties.name}"
|
201
|
+
puts "#{ui.color('IPs', :cyan)}: #{nic.properties.ips.to_s}"
|
202
|
+
puts "#{ui.color('DHCP', :cyan)}: #{nic.properties.dhcp}"
|
203
|
+
puts "#{ui.color('LAN', :cyan)}: #{nic.properties.lan}"
|
204
|
+
puts "#{ui.color('Firewall Type', :cyan)}: #{nic.properties.firewall_type}"
|
205
|
+
puts "#{ui.color('Device Number', :cyan)}: #{nic.properties.device_number}"
|
206
|
+
puts "#{ui.color('PCI Slot', :cyan)}: #{nic.properties.pci_slot}"
|
207
|
+
end
|
208
|
+
|
209
|
+
def print_k8s_node(node)
|
210
|
+
print "\n"
|
211
|
+
puts "#{ui.color('ID', :cyan)}: #{node.id}"
|
212
|
+
puts "#{ui.color('Name', :cyan)}: #{node.properties.name}"
|
213
|
+
puts "#{ui.color('Public IP', :cyan)}: #{node.properties.public_ip}"
|
214
|
+
puts "#{ui.color('Private IP', :cyan)}: #{node.properties.private_ip}"
|
215
|
+
puts "#{ui.color('K8s Version', :cyan)}: #{node.properties.k8s_version}"
|
216
|
+
puts "#{ui.color('State', :cyan)}: #{node.metadata.state}"
|
217
|
+
end
|
218
|
+
|
219
|
+
def print_k8s_nodepool(nodepool)
|
220
|
+
print "\n"
|
221
|
+
auto_scaling = "Min node count: #{nodepool.properties.auto_scaling.min_node_count}, Max node count:#{nodepool.properties.auto_scaling.max_node_count}"
|
222
|
+
maintenance_window = "#{nodepool.properties.maintenance_window.day_of_the_week}, #{nodepool.properties.maintenance_window.time}"
|
223
|
+
lans = nodepool.properties.lans.map { |lan| lan.to_hash }
|
224
|
+
puts "#{ui.color('ID', :cyan)}: #{nodepool.id}"
|
225
|
+
puts "#{ui.color('Name', :cyan)}: #{nodepool.properties.name}"
|
226
|
+
puts "#{ui.color('K8s Version', :cyan)}: #{nodepool.properties.k8s_version}"
|
227
|
+
puts "#{ui.color('Datacenter ID', :cyan)}: #{nodepool.properties.datacenter_id}"
|
228
|
+
puts "#{ui.color('Node Count', :cyan)}: #{nodepool.properties.node_count}"
|
229
|
+
puts "#{ui.color('CPU Family', :cyan)}: #{nodepool.properties.cpu_family}"
|
230
|
+
puts "#{ui.color('Cores Count', :cyan)}: #{nodepool.properties.cores_count}"
|
231
|
+
puts "#{ui.color('RAM', :cyan)}: #{nodepool.properties.ram_size}"
|
232
|
+
puts "#{ui.color('Storage Type', :cyan)}: #{nodepool.properties.storage_type}"
|
233
|
+
puts "#{ui.color('Storage Size', :cyan)}: #{nodepool.properties.storage_size}"
|
234
|
+
puts "#{ui.color('Public IPs', :cyan)}: #{nodepool.properties.public_ips}"
|
235
|
+
puts "#{ui.color('Labels', :cyan)}: #{nodepool.properties.labels}"
|
236
|
+
puts "#{ui.color('Annotations', :cyan)}: #{nodepool.properties.annotations}"
|
237
|
+
puts "#{ui.color('LANs', :cyan)}: #{lans}"
|
238
|
+
puts "#{ui.color('Availability Zone', :cyan)}: #{nodepool.properties.availability_zone}"
|
239
|
+
puts "#{ui.color('Auto Scaling', :cyan)}: #{auto_scaling}"
|
240
|
+
puts "#{ui.color('Maintenance Window', :cyan)}: #{maintenance_window}"
|
241
|
+
puts "#{ui.color('State', :cyan)}: #{nodepool.metadata.state}"
|
242
|
+
end
|
243
|
+
|
244
|
+
def print_pcc(pcc)
|
245
|
+
peers = pcc.properties.peers.map { |peer| peer.id }
|
246
|
+
datacenters = pcc.properties.connectable_datacenters.map { |datacenter| datacenter.id }
|
247
|
+
print "\n"
|
248
|
+
puts "#{ui.color('ID', :cyan)}: #{pcc.id}"
|
249
|
+
puts "#{ui.color('Name', :cyan)}: #{pcc.properties.name}"
|
250
|
+
puts "#{ui.color('Description', :cyan)}: #{pcc.properties.description}"
|
251
|
+
puts "#{ui.color('Peers', :cyan)}: #{peers}"
|
252
|
+
puts "#{ui.color('Connectable Datacenters', :cyan)}: #{datacenters}"
|
253
|
+
end
|
254
|
+
|
255
|
+
def print_s3key(s3_key)
|
256
|
+
print "\n"
|
257
|
+
puts "#{ui.color('ID', :cyan)}: #{s3_key.id}"
|
258
|
+
puts "#{ui.color('Secret Key', :cyan)}: #{s3_key.properties.secret_key}"
|
259
|
+
puts "#{ui.color('Active', :cyan)}: #{s3_key.properties.active}"
|
260
|
+
end
|
261
|
+
|
262
|
+
def print_server(server)
|
263
|
+
print "\n"
|
264
|
+
puts "#{ui.color('ID', :cyan)}: #{server.id}"
|
265
|
+
puts "#{ui.color('Name', :cyan)}: #{server.properties.name}"
|
266
|
+
puts "#{ui.color('Type', :cyan)}: #{server.properties.type}"
|
267
|
+
puts "#{ui.color('Template', :cyan)}: #{server.properties.template_uuid}"
|
268
|
+
puts "#{ui.color('Cores', :cyan)}: #{server.properties.cores}"
|
269
|
+
puts "#{ui.color('CPU Family', :cyan)}: #{server.properties.cpu_family}"
|
270
|
+
puts "#{ui.color('Ram', :cyan)}: #{server.properties.ram}"
|
271
|
+
puts "#{ui.color('Availability Zone', :cyan)}: #{server.properties.availability_zone}"
|
272
|
+
puts "#{ui.color('VM State', :cyan)}: #{server.properties.vm_state}"
|
273
|
+
puts "#{ui.color('Boot Volume', :cyan)}: #{server.properties.boot_volume ? server.properties.boot_volume.id : ''}"
|
274
|
+
puts "#{ui.color('Boot CDROM', :cyan)}: #{server.properties.boot_cdrom ? server.properties.boot_cdrom.id : ''}"
|
275
|
+
end
|
276
|
+
|
277
|
+
def print_share(share)
|
278
|
+
print "\n"
|
279
|
+
puts "#{ui.color('ID', :cyan)}: #{share.id}"
|
280
|
+
puts "#{ui.color('Edit Privilege', :cyan)}: #{share.properties.edit_privilege.to_s}"
|
281
|
+
puts "#{ui.color('Share Privilege', :cyan)}: #{share.properties.share_privilege.to_s}"
|
282
|
+
end
|
283
|
+
|
284
|
+
def print_snapshot(snapshot)
|
285
|
+
print "\n"
|
286
|
+
puts "#{ui.color('ID', :cyan)}: #{snapshot.id}"
|
287
|
+
puts "#{ui.color('Name', :cyan)}: #{snapshot.properties.name}"
|
288
|
+
puts "#{ui.color('Description', :cyan)}: #{snapshot.properties.description}"
|
289
|
+
puts "#{ui.color('Location', :cyan)}: #{snapshot.properties.location}"
|
290
|
+
puts "#{ui.color('Size', :cyan)}: #{snapshot.properties.size.to_s}"
|
291
|
+
puts "#{ui.color('Sec Auth Protection', :cyan)}: #{snapshot.properties.sec_auth_protection}"
|
292
|
+
puts "#{ui.color('License Type', :cyan)}: #{snapshot.properties.licence_type}"
|
293
|
+
|
294
|
+
puts "#{ui.color('CPU Hot Plug', :cyan)}: #{snapshot.properties.cpu_hot_plug}"
|
295
|
+
puts "#{ui.color('CPU Hot Unplug', :cyan)}: #{snapshot.properties.cpu_hot_unplug}"
|
296
|
+
|
297
|
+
puts "#{ui.color('RAM Hot Plug', :cyan)}: #{snapshot.properties.ram_hot_plug}"
|
298
|
+
puts "#{ui.color('RAM Hot Unplug', :cyan)}: #{snapshot.properties.ram_hot_unplug}"
|
299
|
+
|
300
|
+
puts "#{ui.color('NIC Hot Plug', :cyan)}: #{snapshot.properties.nic_hot_plug}"
|
301
|
+
puts "#{ui.color('NIC Hot Unplug', :cyan)}: #{snapshot.properties.nic_hot_unplug}"
|
302
|
+
|
303
|
+
puts "#{ui.color('Disc Virtio Hot Plug', :cyan)}: #{snapshot.properties.disc_virtio_hot_plug}"
|
304
|
+
puts "#{ui.color('Disc Virtio Hot Unplug', :cyan)}: #{snapshot.properties.disc_virtio_hot_unplug}"
|
305
|
+
|
306
|
+
puts "#{ui.color('Disc Scsi Hot Plug', :cyan)}: #{snapshot.properties.disc_scsi_hot_plug}"
|
307
|
+
puts "#{ui.color('Disc Scsi Hot Unplug', :cyan)}: #{snapshot.properties.disc_scsi_hot_unplug}"
|
308
|
+
end
|
309
|
+
|
310
|
+
def print_user(user)
|
311
|
+
print "\n"
|
312
|
+
puts "#{ui.color('ID', :cyan)}: #{user.id}"
|
313
|
+
puts "#{ui.color('Firstname', :cyan)}: #{user.properties.firstname}"
|
314
|
+
puts "#{ui.color('Lastname', :cyan)}: #{user.properties.lastname}"
|
315
|
+
puts "#{ui.color('Email', :cyan)}: #{user.properties.email}"
|
316
|
+
puts "#{ui.color('Administrator', :cyan)}: #{user.properties.administrator.to_s}"
|
317
|
+
puts "#{ui.color('Force 2-Factor Auth', :cyan)}: #{user.properties.force_sec_auth.to_s}"
|
318
|
+
puts "#{ui.color('2-Factor Auth Active', :cyan)}: #{user.properties.sec_auth_active.to_s}"
|
319
|
+
puts "#{ui.color('Active', :cyan)}: #{user.properties.active.to_s}"
|
320
|
+
puts "#{ui.color('Groups', :cyan)}: #{(user.entities.groups.items.map { |el| el.id }).to_s}" unless user.entities.groups.items.nil?
|
321
|
+
end
|
322
|
+
|
323
|
+
def print_volume(volume)
|
324
|
+
print "\n"
|
325
|
+
puts "#{ui.color('ID', :cyan)}: #{volume.id}"
|
326
|
+
puts "#{ui.color('Name', :cyan)}: #{volume.properties.name}"
|
327
|
+
puts "#{ui.color('Size', :cyan)}: #{volume.properties.size}"
|
328
|
+
puts "#{ui.color('Bus', :cyan)}: #{volume.properties.bus}"
|
329
|
+
puts "#{ui.color('Image', :cyan)}: #{volume.properties.image}"
|
330
|
+
puts "#{ui.color('Type', :cyan)}: #{volume.properties.type}"
|
331
|
+
puts "#{ui.color('Licence Type', :cyan)}: #{volume.properties.licence_type}"
|
332
|
+
puts "#{ui.color('Backupunit ID', :cyan)}: #{volume.properties.backupunit_id}"
|
333
|
+
puts "#{ui.color('User Data', :cyan)}: #{volume.properties.user_data}"
|
334
|
+
puts "#{ui.color('Zone', :cyan)}: #{volume.properties.availability_zone}"
|
335
|
+
puts "#{ui.color('CPU Hot Plug', :cyan)}: #{volume.properties.cpu_hot_plug}"
|
336
|
+
puts "#{ui.color('RAM Hot Plug', :cyan)}: #{volume.properties.ram_hot_plug}"
|
337
|
+
puts "#{ui.color('NIC Hot Plug', :cyan)}: #{volume.properties.nic_hot_plug}"
|
338
|
+
puts "#{ui.color('NIC Hot Unplug', :cyan)}: #{volume.properties.nic_hot_unplug}"
|
339
|
+
puts "#{ui.color('Disc Virtio Hot Plug', :cyan)}: #{volume.properties.disc_virtio_hot_plug}"
|
340
|
+
puts "#{ui.color('Disc Virtio Hot Unplug', :cyan)}: #{volume.properties.disc_virtio_hot_unplug}"
|
341
|
+
puts "#{ui.color('Device number', :cyan)}: #{volume.properties.device_number}"
|
342
|
+
puts "#{ui.color('PCI Slot', :cyan)}: #{volume.properties.pci_slot}"
|
343
|
+
end
|
344
|
+
|
345
|
+
def print_flowlog(flowlog)
|
346
|
+
print "\n"
|
347
|
+
puts "#{ui.color('ID', :cyan)}: #{flowlog.id}"
|
348
|
+
puts "#{ui.color('Name', :cyan)}: #{flowlog.properties.name}"
|
349
|
+
puts "#{ui.color('Action', :cyan)}: #{flowlog.properties.action}"
|
350
|
+
puts "#{ui.color('Direction', :cyan)}: #{flowlog.properties.direction}"
|
351
|
+
puts "#{ui.color('Bucket', :cyan)}: #{flowlog.properties.bucket}"
|
352
|
+
end
|
353
|
+
|
354
|
+
def print_network_load_balancer(network_load_balancer)
|
355
|
+
print "\n"
|
356
|
+
puts "#{ui.color('ID', :cyan)}: #{network_load_balancer.id}"
|
357
|
+
puts "#{ui.color('Name', :cyan)}: #{network_load_balancer.properties.name}"
|
358
|
+
puts "#{ui.color('Listener LAN', :cyan)}: #{network_load_balancer.properties.listener_lan}"
|
359
|
+
puts "#{ui.color('IPS', :cyan)}: #{network_load_balancer.properties.ips}"
|
360
|
+
puts "#{ui.color('Target LAN', :cyan)}: #{network_load_balancer.properties.target_lan}"
|
361
|
+
puts "#{ui.color('Private IPS', :cyan)}: #{network_load_balancer.properties.lb_private_ips}"
|
362
|
+
puts "#{ui.color('Forwarding Rules', :cyan)}: #{network_load_balancer.entities.forwardingrules.items.map do |rule|
|
363
|
+
{
|
364
|
+
id: rule.id,
|
365
|
+
name: rule.properties.name,
|
366
|
+
algorithm: rule.properties.algorithm,
|
367
|
+
protocol: rule.properties.protocol,
|
368
|
+
listener_ip: rule.properties.listener_ip,
|
369
|
+
listener_port: rule.properties.listener_port,
|
370
|
+
health_check: rule.properties.health_check.nil? ? nil : rule.properties.health_check.to_hash,
|
371
|
+
targets: (rule.properties.targets.nil? ? [] : rule.properties.targets.map { |target| target.to_hash }),
|
372
|
+
}
|
373
|
+
end}"
|
374
|
+
puts "#{ui.color('Flowlogs', :cyan)}: #{network_load_balancer.entities.flowlogs.items.map { |flowlog| flowlog.id }}"
|
375
|
+
end
|
376
|
+
|
377
|
+
def print_natgateway(natgateway)
|
378
|
+
print "\n"
|
379
|
+
puts "#{ui.color('ID', :cyan)}: #{natgateway.id}"
|
380
|
+
puts "#{ui.color('Name', :cyan)}: #{natgateway.properties.name}"
|
381
|
+
puts "#{ui.color('IPS', :cyan)}: #{natgateway.properties.public_ips}"
|
382
|
+
puts "#{ui.color('LANS', :cyan)}: #{natgateway.properties.lans.map { |el| { id: el.id, gateway_ips: el.gateway_ips } }}"
|
383
|
+
puts "#{ui.color('Rules', :cyan)}: #{natgateway.entities.rules.items.map do |rule|
|
384
|
+
{
|
385
|
+
id: rule.id,
|
386
|
+
name: rule.properties.name,
|
387
|
+
type: rule.properties.type,
|
388
|
+
protocol: rule.properties.protocol,
|
389
|
+
public_ip: rule.properties.public_ip,
|
390
|
+
source_subnet: rule.properties.source_subnet,
|
391
|
+
target_subnet: rule.properties.target_subnet,
|
392
|
+
target_port_range_start: rule.properties.target_port_range ? rule.properties.target_port_range.start : '',
|
393
|
+
target_port_range_end: rule.properties.target_port_range ? rule.properties.target_port_range._end : '',
|
394
|
+
}
|
395
|
+
end}"
|
396
|
+
puts "#{ui.color('Flowlogs', :cyan)}: #{natgateway.entities.flowlogs.items.map { |flowlog| flowlog.id }}"
|
397
|
+
end
|
90
398
|
end
|
91
399
|
end
|
92
400
|
end
|
@@ -24,14 +24,12 @@ class Chef
|
|
24
24
|
option :cpu_family,
|
25
25
|
short: '-f CPU_FAMILY',
|
26
26
|
long: '--cpu-family CPU_FAMILY',
|
27
|
-
description: 'The family of processor cores (INTEL_XEON or AMD_OPTERON)'
|
28
|
-
default: 'INTEL_SKYLAKE'
|
27
|
+
description: 'The family of processor cores (INTEL_XEON or AMD_OPTERON)'
|
29
28
|
|
30
29
|
option :availability_zone,
|
31
30
|
short: '-a AVAILABILITY_ZONE',
|
32
31
|
long: '--availability-zone AVAILABILITY_ZONE',
|
33
|
-
description: 'The availability zone of the server'
|
34
|
-
default: 'AUTO'
|
32
|
+
description: 'The availability zone of the server'
|
35
33
|
|
36
34
|
option :volume_name,
|
37
35
|
long: '--volume-name NAME',
|
@@ -93,7 +91,6 @@ class Chef
|
|
93
91
|
short: '-h',
|
94
92
|
long: '--dhcp',
|
95
93
|
boolean: true | false,
|
96
|
-
default: true,
|
97
94
|
description: 'Set to false if you wish to disable DHCP'
|
98
95
|
|
99
96
|
option :lan,
|
@@ -105,8 +102,7 @@ class Chef
|
|
105
102
|
short: '-t FIREWALL_TYPE',
|
106
103
|
long: '--firewall-type FIREWALL_TYPE',
|
107
104
|
description: 'The type of firewall rules that will be allowed on the NIC. If it is not specified it will take the '\
|
108
|
-
'default value INGRESS'
|
109
|
-
default: 'INGRESS'
|
105
|
+
'default value INGRESS'
|
110
106
|
|
111
107
|
attr_reader :description, :required_options
|
112
108
|
|
@@ -44,23 +44,20 @@ class Chef
|
|
44
44
|
|
45
45
|
datacenter_api = Ionoscloud::DataCentersApi.new(api_client)
|
46
46
|
|
47
|
-
datacenter, _, headers = datacenter_api.datacenters_post_with_http_info(
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
47
|
+
datacenter, _, headers = datacenter_api.datacenters_post_with_http_info(
|
48
|
+
Ionoscloud::Datacenter.new(
|
49
|
+
properties: Ionoscloud::DatacenterProperties.new(
|
50
|
+
name: config[:name],
|
51
|
+
description: config[:description],
|
52
|
+
location: config[:location],
|
53
|
+
),
|
54
|
+
),
|
55
|
+
)
|
54
56
|
|
55
57
|
dot = ui.color('.', :magenta)
|
56
58
|
api_client.wait_for { print dot; is_done? get_request_id headers }
|
57
59
|
|
58
|
-
|
59
|
-
puts "#{ui.color('ID', :cyan)}: #{datacenter.id}"
|
60
|
-
puts "#{ui.color('Name', :cyan)}: #{datacenter.properties.name}"
|
61
|
-
puts "#{ui.color('Description', :cyan)}: #{datacenter.properties.description}"
|
62
|
-
puts "#{ui.color('Location', :cyan)}: #{datacenter.properties.location}"
|
63
|
-
puts 'done'
|
60
|
+
print_datacenter(datacenter)
|
64
61
|
end
|
65
62
|
end
|
66
63
|
end
|
@@ -34,12 +34,7 @@ class Chef
|
|
34
34
|
next
|
35
35
|
end
|
36
36
|
|
37
|
-
|
38
|
-
msg_pair('Name', datacenter.properties.name)
|
39
|
-
msg_pair('Description', datacenter.properties.description)
|
40
|
-
msg_pair('Location', datacenter.properties.location)
|
41
|
-
msg_pair('Version', datacenter.properties.version)
|
42
|
-
|
37
|
+
print_datacenter(datacenter)
|
43
38
|
puts "\n"
|
44
39
|
|
45
40
|
begin
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudDatacenterGet < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud datacenter get (options)'
|
9
|
+
|
10
|
+
option :datacenter_id,
|
11
|
+
short: '-D DATACENTER_ID',
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
13
|
+
description: 'ID of the data center'
|
14
|
+
|
15
|
+
attr_reader :description, :required_options
|
16
|
+
|
17
|
+
def initialize(args = [])
|
18
|
+
super(args)
|
19
|
+
@description =
|
20
|
+
'Retrieves information about a Ionoscloud Datacenter.'
|
21
|
+
@required_options = [:datacenter_id, :ionoscloud_username, :ionoscloud_password]
|
22
|
+
end
|
23
|
+
|
24
|
+
def run
|
25
|
+
$stdout.sync = true
|
26
|
+
handle_extra_config
|
27
|
+
validate_required_params(@required_options, config)
|
28
|
+
|
29
|
+
print_datacenter(Ionoscloud::DataCentersApi.new(api_client).datacenters_find_by_id(config[:datacenter_id]))
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|