knife-ionoscloud 5.0.0 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +4 -4
- data/.rubocop.yml +0 -1
- data/docs/docs_generator.rb +1 -1
- data/docs/subcommands/backupunit_create.md +1 -2
- data/docs/subcommands/backupunit_delete.md +1 -2
- data/docs/subcommands/backupunit_list.md +1 -2
- data/docs/subcommands/backupunit_ssourl.md +1 -2
- data/docs/subcommands/composite_server_create.md +1 -2
- data/docs/subcommands/contract_list.md +1 -2
- data/docs/subcommands/datacenter_create.md +3 -3
- data/docs/subcommands/datacenter_delete.md +1 -2
- data/docs/subcommands/datacenter_list.md +1 -2
- data/docs/subcommands/firewall_create.md +1 -2
- data/docs/subcommands/firewall_delete.md +1 -2
- data/docs/subcommands/firewall_list.md +1 -2
- data/docs/subcommands/group_create.md +11 -3
- data/docs/subcommands/group_delete.md +1 -2
- data/docs/subcommands/group_get.md +1 -2
- data/docs/subcommands/group_list.md +1 -2
- data/docs/subcommands/group_user_add.md +1 -2
- data/docs/subcommands/group_user_remove.md +1 -2
- data/docs/subcommands/image_list.md +1 -2
- data/docs/subcommands/ipblock_create.md +1 -2
- data/docs/subcommands/ipblock_delete.md +1 -2
- data/docs/subcommands/ipblock_list.md +1 -2
- data/docs/subcommands/ipfailover_add.md +2 -3
- data/docs/subcommands/ipfailover_remove.md +1 -2
- data/docs/subcommands/k8s_create.md +8 -3
- data/docs/subcommands/k8s_delete.md +1 -2
- data/docs/subcommands/k8s_list.md +1 -2
- data/docs/subcommands/kubeconfig_get.md +1 -2
- data/docs/subcommands/label_add.md +1 -2
- data/docs/subcommands/label_list.md +1 -2
- data/docs/subcommands/label_remove.md +1 -2
- data/docs/subcommands/lan_create.md +5 -3
- data/docs/subcommands/lan_delete.md +1 -2
- data/docs/subcommands/lan_list.md +1 -2
- data/docs/subcommands/loadbalancer_create.md +1 -2
- data/docs/subcommands/loadbalancer_delete.md +1 -2
- data/docs/subcommands/loadbalancer_get.md +1 -2
- data/docs/subcommands/loadbalancer_list.md +1 -2
- data/docs/subcommands/loadbalancer_nic_add.md +1 -2
- data/docs/subcommands/loadbalancer_nic_remove.md +1 -2
- data/docs/subcommands/location_list.md +1 -2
- data/docs/subcommands/nic_create.md +1 -2
- data/docs/subcommands/nic_delete.md +1 -2
- data/docs/subcommands/nic_list.md +1 -2
- data/docs/subcommands/node_delete.md +1 -2
- data/docs/subcommands/node_list.md +1 -2
- data/docs/subcommands/node_replace.md +1 -2
- data/docs/subcommands/nodepool_create.md +1 -2
- data/docs/subcommands/nodepool_delete.md +1 -2
- data/docs/subcommands/nodepool_list.md +1 -2
- data/docs/subcommands/pcc_create.md +3 -7
- data/docs/subcommands/pcc_delete.md +1 -2
- data/docs/subcommands/pcc_list.md +1 -2
- data/docs/subcommands/request_list.md +9 -4
- data/docs/subcommands/request_status.md +1 -2
- data/docs/subcommands/request_wait.md +1 -2
- data/docs/subcommands/resource_list.md +3 -2
- data/docs/subcommands/s3key_create.md +1 -2
- data/docs/subcommands/s3key_delete.md +1 -2
- data/docs/subcommands/s3key_list.md +1 -2
- data/docs/subcommands/server_create.md +1 -2
- data/docs/subcommands/server_delete.md +1 -2
- data/docs/subcommands/server_list.md +1 -2
- data/docs/subcommands/server_reboot.md +1 -2
- data/docs/subcommands/server_start.md +1 -2
- data/docs/subcommands/server_stop.md +1 -2
- data/docs/subcommands/share_create.md +1 -2
- data/docs/subcommands/share_delete.md +1 -2
- data/docs/subcommands/share_list.md +1 -2
- data/docs/subcommands/snapshot_create.md +14 -3
- data/docs/subcommands/snapshot_delete.md +1 -2
- data/docs/subcommands/snapshot_list.md +1 -2
- data/docs/subcommands/snapshot_restore.md +1 -2
- data/docs/subcommands/user_create.md +3 -4
- data/docs/subcommands/user_delete.md +1 -2
- data/docs/subcommands/user_list.md +1 -2
- data/docs/subcommands/user_ssourl.md +1 -2
- data/docs/subcommands/volume_attach.md +1 -2
- data/docs/subcommands/volume_create.md +1 -2
- data/docs/subcommands/volume_delete.md +1 -2
- data/docs/subcommands/volume_detach.md +1 -2
- data/docs/subcommands/volume_list.md +1 -2
- data/docs/summary.md +0 -1
- data/docs/templates/subcommand_doc.mustache +9 -7
- data/lib/chef/knife/ionoscloud_backupunit_ssourl.rb +1 -1
- data/lib/chef/knife/ionoscloud_datacenter_create.rb +1 -1
- data/lib/chef/knife/ionoscloud_group_create.rb +18 -0
- data/lib/chef/knife/ionoscloud_image_list.rb +3 -3
- data/lib/chef/knife/ionoscloud_ipblock_create.rb +1 -1
- data/lib/chef/knife/ionoscloud_ipblock_list.rb +3 -1
- data/lib/chef/knife/ionoscloud_k8s_create.rb +18 -0
- data/lib/chef/knife/ionoscloud_lan_create.rb +6 -0
- data/lib/chef/knife/ionoscloud_lan_list.rb +3 -1
- data/lib/chef/knife/ionoscloud_nic_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_node_list.rb +3 -1
- data/lib/chef/knife/ionoscloud_pcc_create.rb +34 -7
- data/lib/chef/knife/ionoscloud_request_list.rb +24 -11
- data/lib/chef/knife/ionoscloud_server_create.rb +1 -1
- data/lib/chef/knife/ionoscloud_server_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_server_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_snapshot_create.rb +24 -0
- data/lib/chef/knife/ionoscloud_user_create.rb +4 -4
- data/lib/chef/knife/ionoscloud_user_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_list.rb +1 -1
- data/lib/knife-ionoscloud/version.rb +1 -1
- data/spec/chef/knife/ionoscloud_group_create_spec.rb +6 -0
- data/spec/chef/knife/ionoscloud_image_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_ipblock_list_spec.rb +3 -1
- data/spec/chef/knife/ionoscloud_lan_create_spec.rb +2 -0
- data/spec/chef/knife/ionoscloud_lan_list_spec.rb +3 -1
- data/spec/chef/knife/ionoscloud_node_list_spec.rb +3 -1
- data/spec/chef/knife/ionoscloud_pcc_create_spec.rb +34 -3
- data/spec/chef/knife/ionoscloud_request_list_spec.rb +120 -1
- data/spec/chef/knife/ionoscloud_server_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_snapshot_create_spec.rb +10 -0
- data/spec/spec_helper.rb +12 -7
- metadata +2 -2
@@ -18,7 +18,7 @@ class Chef
|
|
18
18
|
super(args)
|
19
19
|
@description =
|
20
20
|
'The ProfitBricks backup system features a web-based GUI. Once you have created '\
|
21
|
-
'a backup unit, you can access the GUI with a Single Sign On (SSO) URL that can be '\
|
21
|
+
'a backup unit, you can access the GUI with a Single Sign On \(SSO\) URL that can be '\
|
22
22
|
'retrieved from the Cloud API using this request.'
|
23
23
|
@required_options = [:backupunit_id, :ionoscloud_username, :ionoscloud_password]
|
24
24
|
end
|
@@ -30,7 +30,7 @@ class Chef
|
|
30
30
|
"Unless you are planning to manage an existing Ionoscloud environment, "\
|
31
31
|
"the first step will typically involve choosing the location for a new virtual data center"\
|
32
32
|
"A list of locations can be obtained with location command.\n\n\t"\
|
33
|
-
"
|
33
|
+
"```text\nknife ionoscloud location list\n```\n\n"\
|
34
34
|
"Make a note of the desired location ID and now the data center can be created.\n"
|
35
35
|
@required_options = [:location, :ionoscloud_username, :ionoscloud_password]
|
36
36
|
end
|
@@ -41,6 +41,18 @@ class Chef
|
|
41
41
|
long: '--create-backupunit',
|
42
42
|
description: 'The group will be able to manage backup units.'
|
43
43
|
|
44
|
+
option :create_k8s_cluster,
|
45
|
+
long: '--create-k8s-cluster',
|
46
|
+
description: 'The group will be able to create kubernetes clusters.'
|
47
|
+
|
48
|
+
option :create_pcc,
|
49
|
+
long: '--create-pcc',
|
50
|
+
description: 'The group will be able to manage pccs.'
|
51
|
+
|
52
|
+
option :create_internet_access,
|
53
|
+
long: '--create-internet-access',
|
54
|
+
description: 'The group will be have internet access privilege.'
|
55
|
+
|
44
56
|
attr_reader :description, :required_options
|
45
57
|
|
46
58
|
def initialize(args = [])
|
@@ -67,6 +79,9 @@ class Chef
|
|
67
79
|
accessActivityLog: config[:access_activity_log],
|
68
80
|
s3Privilege: config[:s3_privilege],
|
69
81
|
createBackupUnit: config[:create_backup_unit],
|
82
|
+
createK8sCluster: config[:create_k8s_cluster],
|
83
|
+
createPcc: config[:create_pcc],
|
84
|
+
createInternetAccess: config[:create_internet_access],
|
70
85
|
}.compact,
|
71
86
|
})
|
72
87
|
|
@@ -82,6 +97,9 @@ class Chef
|
|
82
97
|
puts "#{ui.color('Access Activity Log', :cyan)}: #{group.properties.access_activity_log.to_s}"
|
83
98
|
puts "#{ui.color('S3 Privilege', :cyan)}: #{group.properties.s3_privilege.to_s}"
|
84
99
|
puts "#{ui.color('Create Backup Unit', :cyan)}: #{group.properties.create_backup_unit.to_s}"
|
100
|
+
puts "#{ui.color('Create K8s Clusters', :cyan)}: #{group.properties.create_k8s_cluster.to_s}"
|
101
|
+
puts "#{ui.color('Create PCC', :cyan)}: #{group.properties.create_pcc.to_s}"
|
102
|
+
puts "#{ui.color('Create Internet Acess', :cyan)}: #{group.properties.create_internet_access.to_s}"
|
85
103
|
puts 'done'
|
86
104
|
end
|
87
105
|
end
|
@@ -24,20 +24,20 @@ class Chef
|
|
24
24
|
image_list = [
|
25
25
|
ui.color('ID', :bold),
|
26
26
|
ui.color('Name', :bold),
|
27
|
-
ui.color('Description', :bold),
|
28
27
|
ui.color('Location', :bold),
|
29
28
|
ui.color('Size', :bold),
|
30
|
-
ui.color('Public', :bold)
|
29
|
+
ui.color('Public', :bold),
|
30
|
+
ui.color('Aliases', :bold),
|
31
31
|
]
|
32
32
|
image_api = Ionoscloud::ImageApi.new(api_client)
|
33
33
|
|
34
34
|
image_api.images_get({ depth: 1 }).items.each do |image|
|
35
35
|
image_list << image.id
|
36
36
|
image_list << image.properties.name
|
37
|
-
image_list << image.properties.description
|
38
37
|
image_list << image.properties.location
|
39
38
|
image_list << image.properties.size.to_s
|
40
39
|
image_list << image.properties.public.to_s
|
40
|
+
image_list << image.properties.image_aliases
|
41
41
|
end
|
42
42
|
|
43
43
|
puts ui.list(image_list, :uneven_columns_across, 6)
|
@@ -29,7 +29,7 @@ class Chef
|
|
29
29
|
@description =
|
30
30
|
'Reserves an IP block at a specified location that can be used by resources '\
|
31
31
|
'within any VDCs provisioned in that same location. An IP block consists of '\
|
32
|
-
'one or more static IP addresses. The IP block size (number of IP addresses) '\
|
32
|
+
'one or more static IP addresses. The IP block size \(number of IP addresses\) '\
|
33
33
|
'and location are required to reserve an IP block.'
|
34
34
|
@required_options = [:size, :location, :ionoscloud_username, :ionoscloud_password]
|
35
35
|
end
|
@@ -25,6 +25,7 @@ class Chef
|
|
25
25
|
ui.color('Name', :bold),
|
26
26
|
ui.color('Location', :bold),
|
27
27
|
ui.color('IP Addresses', :bold),
|
28
|
+
ui.color('IP Consumers count', :bold),
|
28
29
|
]
|
29
30
|
ipblock_api = Ionoscloud::IPBlocksApi.new(api_client)
|
30
31
|
|
@@ -33,9 +34,10 @@ class Chef
|
|
33
34
|
ipblock_list << ipblock.properties.name
|
34
35
|
ipblock_list << ipblock.properties.location
|
35
36
|
ipblock_list << ipblock.properties.ips.join(', ')
|
37
|
+
ipblock_list << ipblock.properties.ip_consumers.nil? ? 0 : ipblock.properties.ip_consumers.length
|
36
38
|
end
|
37
39
|
|
38
|
-
puts ui.list(ipblock_list, :uneven_columns_across,
|
40
|
+
puts ui.list(ipblock_list, :uneven_columns_across, 5)
|
39
41
|
end
|
40
42
|
end
|
41
43
|
end
|
@@ -17,6 +17,15 @@ 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 setting it to false is currently in beta phase.'
|
24
|
+
|
25
|
+
option :gateway_ip,
|
26
|
+
long: '--gateway GATEWAY_IP',
|
27
|
+
description: 'The IP address of the gateway used by the cluster. This is mandatory when `public` is set to `false` and should not be provided otherwise.'
|
28
|
+
|
20
29
|
option :maintenance_day,
|
21
30
|
short: '-d MAINTENANCE_DAY',
|
22
31
|
long: '--maintenance-day MAINTENANCE_DAY',
|
@@ -47,8 +56,17 @@ class Chef
|
|
47
56
|
cluster_properties = {
|
48
57
|
name: config[:name],
|
49
58
|
k8sVersion: config[:version],
|
59
|
+
public: !config[:private],
|
50
60
|
}.compact
|
51
61
|
|
62
|
+
if config[:private]
|
63
|
+
if !config[:gateway_ip]
|
64
|
+
ui.error("Gateway IP must be specified for private K8s Clusters")
|
65
|
+
exit(1)
|
66
|
+
end
|
67
|
+
cluster_properties[:gatewayIp] = config[:gateway_ip]
|
68
|
+
end
|
69
|
+
|
52
70
|
if config[:maintenance_day] && config[:maintenance_time]
|
53
71
|
cluster_properties[:maintenanceWindow] = {
|
54
72
|
dayOfTheWeek: config[:maintenance_day],
|
@@ -25,6 +25,10 @@ class Chef
|
|
25
25
|
description: 'Boolean indicating if the LAN faces the public ' \
|
26
26
|
'Internet or not; defaults to false'
|
27
27
|
|
28
|
+
option :pcc,
|
29
|
+
long: '--pcc PCC_ID',
|
30
|
+
description: 'ID of the PCC to connect the LAN to'
|
31
|
+
|
28
32
|
attr_reader :description, :required_options
|
29
33
|
|
30
34
|
def initialize(args = [])
|
@@ -48,6 +52,7 @@ class Chef
|
|
48
52
|
properties: {
|
49
53
|
name: config[:name],
|
50
54
|
public: config[:public],
|
55
|
+
pcc: config[:pcc],
|
51
56
|
}
|
52
57
|
},
|
53
58
|
)
|
@@ -61,6 +66,7 @@ class Chef
|
|
61
66
|
puts "#{ui.color('ID', :cyan)}: #{lan.id}"
|
62
67
|
puts "#{ui.color('Name', :cyan)}: #{lan.properties.name}"
|
63
68
|
puts "#{ui.color('Public', :cyan)}: #{lan.properties.public}"
|
69
|
+
puts "#{ui.color('PCC', :cyan)}: #{lan.properties.pcc}"
|
64
70
|
|
65
71
|
puts 'done'
|
66
72
|
end
|
@@ -30,6 +30,7 @@ class Chef
|
|
30
30
|
ui.color('ID', :bold),
|
31
31
|
ui.color('Name', :bold),
|
32
32
|
ui.color('Public', :bold),
|
33
|
+
ui.color('PCC', :bold),
|
33
34
|
]
|
34
35
|
lan_api = Ionoscloud::LanApi.new(api_client)
|
35
36
|
|
@@ -37,9 +38,10 @@ class Chef
|
|
37
38
|
lan_list << lan.id
|
38
39
|
lan_list << lan.properties.name
|
39
40
|
lan_list << lan.properties.public.to_s
|
41
|
+
lan_list << lan.properties.pcc
|
40
42
|
end
|
41
43
|
|
42
|
-
puts ui.list(lan_list, :uneven_columns_across,
|
44
|
+
puts ui.list(lan_list, :uneven_columns_across, 4)
|
43
45
|
end
|
44
46
|
end
|
45
47
|
end
|
@@ -48,8 +48,7 @@ class Chef
|
|
48
48
|
def initialize(args = [])
|
49
49
|
super(args)
|
50
50
|
@description =
|
51
|
-
"Creates a NIC on the specified server
|
52
|
-
"The Ionoscloud platform supports adding multiple NICs to a server. These NICs "\
|
51
|
+
"Creates a NIC on the specified server. The Ionoscloud platform supports adding multiple NICs to a server. These NICs "\
|
53
52
|
"can be used to create different, segmented networks on the platform."
|
54
53
|
@required_options = [:datacenter_id, :server_id, :lan, :ionoscloud_username, :ionoscloud_password]
|
55
54
|
end
|
@@ -35,6 +35,7 @@ class Chef
|
|
35
35
|
ui.color('ID', :bold),
|
36
36
|
ui.color('Name', :bold),
|
37
37
|
ui.color('Public IP', :bold),
|
38
|
+
ui.color('Private IP', :bold),
|
38
39
|
ui.color('K8s Version', :bold),
|
39
40
|
ui.color('State', :bold),
|
40
41
|
]
|
@@ -45,10 +46,11 @@ class Chef
|
|
45
46
|
node_list << node.id
|
46
47
|
node_list << node.properties.name
|
47
48
|
node_list << node.properties.public_ip
|
49
|
+
node_list << node.properties.private_ip
|
48
50
|
node_list << node.properties.k8s_version
|
49
51
|
node_list << node.metadata.state
|
50
52
|
end
|
51
|
-
puts ui.list(node_list, :uneven_columns_across,
|
53
|
+
puts ui.list(node_list, :uneven_columns_across, 6)
|
52
54
|
end
|
53
55
|
end
|
54
56
|
end
|
@@ -18,13 +18,9 @@ class Chef
|
|
18
18
|
description: 'Description of the data center'
|
19
19
|
|
20
20
|
option :peers,
|
21
|
-
long: '--peers LAN_ID [LAN_ID]',
|
21
|
+
long: '--peers DATACENTER_ID,LAN_ID [DATACENTER_ID,LAN_ID]',
|
22
22
|
description: 'An array of LANs joined to this private cross connect'
|
23
23
|
|
24
|
-
option :datacenters,
|
25
|
-
long: '--datacenters DATACENTER_IS [DATACENTER_IS]',
|
26
|
-
description: 'An array of datacenters joined to this private cross connect'
|
27
|
-
|
28
24
|
attr_reader :description, :required_options
|
29
25
|
|
30
26
|
def initialize(args = [])
|
@@ -41,9 +37,12 @@ class Chef
|
|
41
37
|
print "#{ui.color('Creating private cross connect...', :magenta)}"
|
42
38
|
|
43
39
|
pcc_api = Ionoscloud::PrivateCrossConnectApi.new(api_client)
|
40
|
+
config[:peers] = config[:peers].split(',') unless config[:peers].nil?
|
44
41
|
|
45
|
-
config[:peers]
|
46
|
-
|
42
|
+
if config[:peers] && config[:peers].length % 2 != 0
|
43
|
+
ui.error('Each Lan ID should correspond to one Datacenter ID!')
|
44
|
+
exit(1)
|
45
|
+
end
|
47
46
|
|
48
47
|
pcc, _, headers = pcc_api.pccs_post_with_http_info({
|
49
48
|
properties: {
|
@@ -55,6 +54,34 @@ class Chef
|
|
55
54
|
dot = ui.color('.', :magenta)
|
56
55
|
api_client.wait_for { print dot; is_done? get_request_id headers }
|
57
56
|
|
57
|
+
pcc = pcc_api.pccs_find_by_id(pcc.id)
|
58
|
+
|
59
|
+
if config[:peers]
|
60
|
+
lan_api = Ionoscloud::LanApi.new(api_client)
|
61
|
+
|
62
|
+
header_list = []
|
63
|
+
allowed_datacenters_ids = pcc.properties.connectable_datacenters.map { |datacenter| datacenter.id }
|
64
|
+
config[:peers].each_slice(2) do |datacenter_id, lan_id|
|
65
|
+
if !allowed_datacenters_ids.include? datacenter_id
|
66
|
+
ui.error("Datacenter ID #{datacenter_id} is not allowed")
|
67
|
+
exit(1)
|
68
|
+
end
|
69
|
+
_, _, headers = lan_api.datacenters_lans_patch_with_http_info(
|
70
|
+
datacenter_id,
|
71
|
+
lan_id,
|
72
|
+
{ pcc: pcc.id },
|
73
|
+
)
|
74
|
+
header_list << headers
|
75
|
+
end
|
76
|
+
|
77
|
+
header_list.each do |headers|
|
78
|
+
dot = ui.color('.', :magenta)
|
79
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
pcc = pcc_api.pccs_find_by_id(pcc.id)
|
84
|
+
|
58
85
|
puts "\n"
|
59
86
|
puts "#{ui.color('ID', :cyan)}: #{pcc.id}"
|
60
87
|
puts "#{ui.color('Name', :cyan)}: #{pcc.properties.name}"
|
@@ -10,17 +10,22 @@ class Chef
|
|
10
10
|
option :limit,
|
11
11
|
short: '-l LIMIT',
|
12
12
|
long: '--limit LIMIT',
|
13
|
-
description: 'The maximum number of
|
13
|
+
description: 'The maximum number of requests to look into.'
|
14
14
|
|
15
15
|
option :offset,
|
16
16
|
short: '-o OFFSET',
|
17
17
|
long: '--offset OFFSET',
|
18
18
|
description: 'The request number from which to return results.'
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
option :status,
|
21
|
+
short: '-s STATUS',
|
22
|
+
long: '--status STATUS',
|
23
|
+
description: 'Request status filter to fetch all the request based on a particular status [QUEUED, RUNNING, DONE, FAILED]'
|
24
|
+
|
25
|
+
option :method,
|
26
|
+
short: '-m METHOD',
|
27
|
+
long: '--method METHOD',
|
28
|
+
description: 'Request method filter to fetch all the request based on a particular method [POST, PUT, PATCH, DELETE]'
|
24
29
|
|
25
30
|
attr_reader :description, :required_options
|
26
31
|
|
@@ -72,13 +77,21 @@ class Chef
|
|
72
77
|
offset: config[:offset],
|
73
78
|
}
|
74
79
|
|
75
|
-
|
76
|
-
|
77
|
-
|
80
|
+
if config[:status] && ['QUEUED', 'RUNNING', 'DONE', 'FAILED'].include?(config[:status])
|
81
|
+
opts[:filter_request_status] = config[:status]
|
82
|
+
end
|
83
|
+
|
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
87
|
|
79
|
-
|
80
|
-
|
81
|
-
|
88
|
+
if config[:method] && ['POST', 'PUT', 'PATCH', 'DELETE'].include?(config[:method])
|
89
|
+
opts[:filter_method] = config[:method]
|
90
|
+
end
|
91
|
+
|
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
95
|
|
83
96
|
request_api.requests_get(opts).items.each do |request|
|
84
97
|
request_list << request.id
|
@@ -55,7 +55,7 @@ class Chef
|
|
55
55
|
"One of the unique features of the Ionoscloud platform when compared "\
|
56
56
|
"with the other providers is that they allow you to define your own settings "\
|
57
57
|
"for cores, memory, and disk size without being tied to a particular size or flavor.\n\n"\
|
58
|
-
"Note:
|
58
|
+
"Note: _The memory parameter value must be a multiple of 256, e.g. 256, 512, 768, 1024, and so forth._"
|
59
59
|
@required_options = [:datacenter_id, :cores, :ram, :ionoscloud_username, :ionoscloud_password]
|
60
60
|
end
|
61
61
|
|
@@ -18,7 +18,7 @@ class Chef
|
|
18
18
|
super(args)
|
19
19
|
@description =
|
20
20
|
"This will remove a server from a VDC.\n\n"\
|
21
|
-
"**NOTE**: This will not automatically remove the storage volume(s) "\
|
21
|
+
"**NOTE**: This will not automatically remove the storage volume\\(s\\) "\
|
22
22
|
"attached to a server. A separate API call is required to perform that action."
|
23
23
|
@required_options = [:datacenter_id, :ionoscloud_username, :ionoscloud_password]
|
24
24
|
end
|
@@ -47,8 +47,8 @@ class Chef
|
|
47
47
|
server_list << server.properties.ram.to_s
|
48
48
|
server_list << server.properties.availability_zone
|
49
49
|
server_list << server.properties.vm_state
|
50
|
-
server_list << server.properties.boot_volume
|
51
|
-
server_list << server.properties.boot_cdrom
|
50
|
+
server_list << (server.properties.boot_volume.nil? ? '' : server.properties.boot_volume.id)
|
51
|
+
server_list << (server.properties.boot_cdrom.nil? ? '' : server.properties.boot_cdrom.id)
|
52
52
|
end
|
53
53
|
|
54
54
|
puts ui.list(server_list, :uneven_columns_across, 9)
|
@@ -17,6 +17,24 @@ class Chef
|
|
17
17
|
long: '--volume VOLUME_ID',
|
18
18
|
description: 'ID of the Volume'
|
19
19
|
|
20
|
+
option :name,
|
21
|
+
short: '-n SNAPSHOT_NAME',
|
22
|
+
long: '--name SNAPSHOT_NAME',
|
23
|
+
description: 'Name of the snapshot'
|
24
|
+
|
25
|
+
option :description,
|
26
|
+
long: '--description SNAPSHOT_DESCRIPTION',
|
27
|
+
description: 'Description of the snapshot'
|
28
|
+
|
29
|
+
option :sec_auth_protection,
|
30
|
+
long: '--sec-auth',
|
31
|
+
description: 'Flag representing if extra protection is enabled on snapshot e.g. Two Factor protection etc.'
|
32
|
+
|
33
|
+
option :licence_type,
|
34
|
+
short: '-l LICENCE_TYPE',
|
35
|
+
long: '--licence LICENCE_TYPE',
|
36
|
+
description: 'The OS type of this Snapshot'
|
37
|
+
|
20
38
|
attr_reader :description, :required_options
|
21
39
|
|
22
40
|
def initialize(args = [])
|
@@ -38,6 +56,12 @@ class Chef
|
|
38
56
|
snapshot, _, headers = volume_api.datacenters_volumes_create_snapshot_post_with_http_info(
|
39
57
|
config[:datacenter_id],
|
40
58
|
config[:volume_id],
|
59
|
+
{
|
60
|
+
name: config[:name],
|
61
|
+
description: config[:description],
|
62
|
+
sec_auth_protection: config[:sec_auth_protection],
|
63
|
+
licence_type: config[:licence_type],
|
64
|
+
}.compact,
|
41
65
|
)
|
42
66
|
|
43
67
|
dot = ui.color('.', :magenta)
|
@@ -33,7 +33,7 @@ class Chef
|
|
33
33
|
description: 'Assigns the user have administrative rights.'
|
34
34
|
|
35
35
|
option :force_sec_auth,
|
36
|
-
long: '--sec-auth
|
36
|
+
long: '--sec-auth',
|
37
37
|
description: 'Indicates if secure (two-factor) authentication should be forced for the user.'
|
38
38
|
|
39
39
|
attr_reader :description, :required_options
|
@@ -41,9 +41,9 @@ class Chef
|
|
41
41
|
def initialize(args = [])
|
42
42
|
super(args)
|
43
43
|
@description =
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
'Creates a new user under a particular contract. **Please Note**: The password set '\
|
45
|
+
'here cannot be updated through the API currently. It is recommended that a new user '\
|
46
|
+
'log into the DCD and change their password.'
|
47
47
|
@required_options = [:firstname, :lastname, :email, :password, :ionoscloud_username, :ionoscloud_password]
|
48
48
|
end
|
49
49
|
|
@@ -19,7 +19,7 @@ class Chef
|
|
19
19
|
@description =
|
20
20
|
'Retrieve a list of all the users that have been created under a contract. '\
|
21
21
|
'You can retrieve a list of users who are members of the group by passing the '\
|
22
|
-
'
|
22
|
+
'_group\_id_ option.'
|
23
23
|
@required_options = [:ionoscloud_username, :ionoscloud_password]
|
24
24
|
end
|
25
25
|
|