knife-ionoscloud 5.1.0 → 6.0.0.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/knife-ionoscloud.gemspec +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_create.rb +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_ssourl.rb +1 -1
- data/lib/chef/knife/ionoscloud_base.rb +1 -1
- data/lib/chef/knife/ionoscloud_composite_server_create.rb +25 -23
- data/lib/chef/knife/ionoscloud_contract_list.rb +32 -23
- data/lib/chef/knife/ionoscloud_cube_server_create.rb +215 -0
- data/lib/chef/knife/ionoscloud_datacenter_create.rb +1 -1
- data/lib/chef/knife/ionoscloud_datacenter_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_datacenter_list.rb +4 -2
- data/lib/chef/knife/ionoscloud_firewall_create.rb +11 -4
- data/lib/chef/knife/ionoscloud_firewall_delete.rb +4 -3
- data/lib/chef/knife/ionoscloud_firewall_list.rb +5 -3
- data/lib/chef/knife/ionoscloud_flowlog_create.rb +121 -0
- data/lib/chef/knife/ionoscloud_flowlog_delete.rb +106 -0
- data/lib/chef/knife/ionoscloud_flowlog_list.rb +100 -0
- data/lib/chef/knife/ionoscloud_group_create.rb +35 -14
- data/lib/chef/knife/ionoscloud_group_delete.rb +7 -0
- data/lib/chef/knife/ionoscloud_group_get.rb +6 -0
- data/lib/chef/knife/ionoscloud_group_list.rb +19 -7
- data/lib/chef/knife/ionoscloud_image_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_ipfailover_add.rb +1 -1
- data/lib/chef/knife/ionoscloud_ipfailover_remove.rb +1 -1
- data/lib/chef/knife/ionoscloud_k8s_delete.rb +5 -2
- data/lib/chef/knife/ionoscloud_label_add.rb +1 -1
- data/lib/chef/knife/ionoscloud_label_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_label_remove.rb +1 -1
- data/lib/chef/knife/ionoscloud_lan_create.rb +1 -1
- data/lib/chef/knife/ionoscloud_lan_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_lan_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_loadbalancer_create.rb +1 -1
- data/lib/chef/knife/ionoscloud_loadbalancer_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_loadbalancer_get.rb +1 -1
- data/lib/chef/knife/ionoscloud_loadbalancer_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_add.rb +1 -1
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_remove.rb +1 -1
- data/lib/chef/knife/ionoscloud_location_list.rb +5 -3
- data/lib/chef/knife/ionoscloud_natgateway_create.rb +71 -0
- data/lib/chef/knife/ionoscloud_natgateway_delete.rb +69 -0
- data/lib/chef/knife/ionoscloud_natgateway_lan_add.rb +82 -0
- data/lib/chef/knife/ionoscloud_natgateway_lan_remove.rb +58 -0
- data/lib/chef/knife/ionoscloud_natgateway_list.rb +49 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_add.rb +124 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_list.rb +63 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_remove.rb +72 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_create.rb +95 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_delete.rb +81 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_list.rb +56 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_add.rb +150 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_list.rb +63 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_remove.rb +78 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_add.rb +141 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_list.rb +68 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove.rb +105 -0
- data/lib/chef/knife/ionoscloud_nic_create.rb +14 -9
- data/lib/chef/knife/ionoscloud_nic_delete.rb +4 -2
- data/lib/chef/knife/ionoscloud_nic_list.rb +9 -5
- data/lib/chef/knife/ionoscloud_node_list.rb +0 -1
- data/lib/chef/knife/ionoscloud_nodepool_create.rb +42 -16
- data/lib/chef/knife/ionoscloud_nodepool_delete.rb +25 -0
- data/lib/chef/knife/ionoscloud_nodepool_lan_add.rb +130 -0
- data/lib/chef/knife/ionoscloud_nodepool_lan_remove.rb +96 -0
- data/lib/chef/knife/ionoscloud_nodepool_list.rb +3 -1
- data/lib/chef/knife/ionoscloud_pcc_create.rb +2 -2
- data/lib/chef/knife/ionoscloud_pcc_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_pcc_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_request_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_request_status.rb +1 -1
- data/lib/chef/knife/ionoscloud_s3key_create.rb +2 -2
- data/lib/chef/knife/ionoscloud_s3key_delete.rb +3 -3
- data/lib/chef/knife/ionoscloud_s3key_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_console.rb +42 -0
- data/lib/chef/knife/ionoscloud_server_create.rb +8 -8
- data/lib/chef/knife/ionoscloud_server_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_server_list.rb +16 -5
- data/lib/chef/knife/ionoscloud_server_reboot.rb +1 -1
- data/lib/chef/knife/ionoscloud_server_resume.rb +43 -0
- data/lib/chef/knife/ionoscloud_server_start.rb +1 -1
- data/lib/chef/knife/ionoscloud_server_stop.rb +1 -1
- data/lib/chef/knife/ionoscloud_server_suspend.rb +44 -0
- data/lib/chef/knife/ionoscloud_server_token.rb +42 -0
- data/lib/chef/knife/ionoscloud_server_upgrade.rb +44 -0
- data/lib/chef/knife/ionoscloud_snapshot_create.rb +2 -2
- 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_snapshot_restore.rb +2 -2
- data/lib/chef/knife/ionoscloud_template_list.rb +46 -0
- data/lib/chef/knife/ionoscloud_user_ssourl.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_attach.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_create.rb +33 -35
- data/lib/chef/knife/ionoscloud_volume_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_detach.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_list.rb +2 -2
- data/lib/knife-ionoscloud/version.rb +1 -1
- data/spec/chef/knife/ionoscloud_backupunit_create_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_backupunit_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_backupunit_list_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_backupunit_ssourl_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_base_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_composite_server_create_spec.rb +11 -8
- data/spec/chef/knife/ionoscloud_contract_list_spec.rb +32 -27
- data/spec/chef/knife/ionoscloud_cube_server_create_spec.rb +249 -0
- data/spec/chef/knife/ionoscloud_datacenter_create_spec.rb +3 -2
- data/spec/chef/knife/ionoscloud_datacenter_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_datacenter_list_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_firewall_create_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_firewall_delete_spec.rb +6 -5
- data/spec/chef/knife/ionoscloud_firewall_list_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_flowlog_create_spec.rb +254 -0
- data/spec/chef/knife/ionoscloud_flowlog_delete_spec.rb +360 -0
- data/spec/chef/knife/ionoscloud_flowlog_list_spec.rb +264 -0
- data/spec/chef/knife/ionoscloud_group_create_spec.rb +6 -0
- data/spec/chef/knife/ionoscloud_group_delete_spec.rb +6 -0
- data/spec/chef/knife/ionoscloud_group_get_spec.rb +6 -0
- data/spec/chef/knife/ionoscloud_group_list_spec.rb +26 -8
- data/spec/chef/knife/ionoscloud_image_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_ipfailover_add_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_ipfailover_remove_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_k8s_delete_spec.rb +5 -2
- data/spec/chef/knife/ionoscloud_kubeconfig_get_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_label_add_spec.rb +10 -10
- data/spec/chef/knife/ionoscloud_label_list_spec.rb +14 -14
- data/spec/chef/knife/ionoscloud_label_remove_spec.rb +20 -20
- data/spec/chef/knife/ionoscloud_lan_create_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_lan_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_lan_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_loadbalancer_create_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_loadbalancer_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_loadbalancer_get_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_loadbalancer_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_loadbalancer_nic_add_spec.rb +6 -6
- data/spec/chef/knife/ionoscloud_loadbalancer_nic_remove_spec.rb +6 -6
- data/spec/chef/knife/ionoscloud_location_list_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_natgateway_create_spec.rb +77 -0
- data/spec/chef/knife/ionoscloud_natgateway_delete_spec.rb +118 -0
- data/spec/chef/knife/ionoscloud_natgateway_lan_add_spec.rb +143 -0
- data/spec/chef/knife/ionoscloud_natgateway_lan_remove_spec.rb +194 -0
- data/spec/chef/knife/ionoscloud_natgateway_list_spec.rb +79 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_add_spec.rb +98 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_list_spec.rb +92 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_remove_spec.rb +77 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_create_spec.rb +80 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_delete_spec.rb +119 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_list_spec.rb +88 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_add_spec.rb +104 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_list_spec.rb +89 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_remove_spec.rb +124 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_add_spec.rb +109 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_list_spec.rb +85 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove_spec.rb +263 -0
- data/spec/chef/knife/ionoscloud_nic_create_spec.rb +9 -5
- data/spec/chef/knife/ionoscloud_nic_delete_spec.rb +8 -6
- data/spec/chef/knife/ionoscloud_nic_list_spec.rb +12 -6
- data/spec/chef/knife/ionoscloud_nodepool_create_spec.rb +15 -1
- data/spec/chef/knife/ionoscloud_nodepool_lan_add_spec.rb +226 -0
- data/spec/chef/knife/ionoscloud_nodepool_lan_remove.rb +199 -0
- data/spec/chef/knife/ionoscloud_nodepool_list_spec.rb +3 -1
- data/spec/chef/knife/ionoscloud_pcc_create_spec.rb +6 -6
- data/spec/chef/knife/ionoscloud_pcc_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_pcc_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_request_list_spec.rb +16 -16
- data/spec/chef/knife/ionoscloud_request_status_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_s3key_create_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_s3key_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_s3key_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_server_console_spec.rb +97 -0
- data/spec/chef/knife/ionoscloud_server_create_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_server_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_server_list_spec.rb +63 -5
- data/spec/chef/knife/ionoscloud_server_reboot_spec.rb +3 -5
- data/spec/chef/knife/ionoscloud_server_resume_spec.rb +93 -0
- data/spec/chef/knife/ionoscloud_server_start_spec.rb +3 -5
- data/spec/chef/knife/ionoscloud_server_stop_spec.rb +3 -5
- data/spec/chef/knife/ionoscloud_server_suspend_spec.rb +93 -0
- data/spec/chef/knife/ionoscloud_server_token_spec.rb +97 -0
- data/spec/chef/knife/ionoscloud_server_upgrade_spec.rb +96 -0
- data/spec/chef/knife/ionoscloud_snapshot_create_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_snapshot_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_snapshot_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_snapshot_restore_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_template_list_spec.rb +78 -0
- data/spec/chef/knife/ionoscloud_user_ssourl_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_volume_attach_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_volume_create_spec.rb +6 -58
- data/spec/chef/knife/ionoscloud_volume_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_volume_detach_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_volume_list_spec.rb +4 -4
- data/spec/spec_helper.rb +223 -29
- metadata +93 -6
@@ -86,7 +86,7 @@ describe Chef::Knife::IonoscloudK8sDelete do
|
|
86
86
|
expect { subject.run }.not_to raise_error(Exception)
|
87
87
|
end
|
88
88
|
|
89
|
-
it 'should not call KubernetesApi.k8s_delete when the cluster is not
|
89
|
+
it 'should not call KubernetesApi.k8s_delete when the cluster is not one of ["ACTIVE", "TERMINATED"]' do
|
90
90
|
k8s_cluster = k8s_cluster_mock(
|
91
91
|
{
|
92
92
|
state: 'DEPLOYING',
|
@@ -103,7 +103,10 @@ describe Chef::Knife::IonoscloudK8sDelete do
|
|
103
103
|
subject_config.each { |key, value| subject.config[key] = value }
|
104
104
|
subject.name_args = [k8s_cluster.id]
|
105
105
|
|
106
|
-
expect(subject.ui).to receive(:error).with(
|
106
|
+
expect(subject.ui).to receive(:error).with(
|
107
|
+
"K8s Cluster #{k8s_cluster.id} state must be one of ['ACTIVE', 'TERMINATED'], "\
|
108
|
+
"actual state is '#{k8s_cluster.metadata.state}'. Skipping."
|
109
|
+
)
|
107
110
|
|
108
111
|
expect(subject.api_client).not_to receive(:wait_for)
|
109
112
|
mock_call_api(
|
@@ -27,7 +27,7 @@ describe Chef::Knife::IonoscloudKubeconfigGet do
|
|
27
27
|
method: 'GET',
|
28
28
|
path: "/k8s/#{subject_config[:cluster_id]}/kubeconfig",
|
29
29
|
operation: :'KubernetesApi.k8s_kubeconfig_get',
|
30
|
-
return_type: '
|
30
|
+
return_type: 'String',
|
31
31
|
result: kubeconfig,
|
32
32
|
},
|
33
33
|
],
|
@@ -58,7 +58,7 @@ describe Chef::Knife::IonoscloudKubeconfigGet do
|
|
58
58
|
method: 'GET',
|
59
59
|
path: "/k8s/#{subject_config[:cluster_id]}/kubeconfig",
|
60
60
|
operation: :'KubernetesApi.k8s_kubeconfig_get',
|
61
|
-
return_type: '
|
61
|
+
return_type: 'String',
|
62
62
|
exception: Ionoscloud::ApiError.new(code: 404),
|
63
63
|
},
|
64
64
|
],
|
@@ -12,7 +12,7 @@ describe Chef::Knife::IonoscloudLabelAdd do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
describe '#run' do
|
15
|
-
it 'should call
|
15
|
+
it 'should call LabelsApi.datacenters_labels_post when the type is datacenter and output based on what it receives' do
|
16
16
|
label = label_resource_mock
|
17
17
|
subject_config = {
|
18
18
|
ionoscloud_username: 'email',
|
@@ -42,7 +42,7 @@ describe Chef::Knife::IonoscloudLabelAdd do
|
|
42
42
|
{
|
43
43
|
method: 'POST',
|
44
44
|
path: "/datacenters/#{subject_config[:resource_id]}/labels",
|
45
|
-
operation: :'
|
45
|
+
operation: :'LabelsApi.datacenters_labels_post',
|
46
46
|
return_type: 'LabelResource',
|
47
47
|
body: { properties: expected_body },
|
48
48
|
result: label,
|
@@ -53,7 +53,7 @@ describe Chef::Knife::IonoscloudLabelAdd do
|
|
53
53
|
expect { subject.run }.not_to raise_error(Exception)
|
54
54
|
end
|
55
55
|
|
56
|
-
it 'should call
|
56
|
+
it 'should call LabelsApi.datacenters_servers_labels_post when the type is server and output based on what it receives' do
|
57
57
|
label = label_resource_mock
|
58
58
|
subject_config = {
|
59
59
|
ionoscloud_username: 'email',
|
@@ -84,7 +84,7 @@ describe Chef::Knife::IonoscloudLabelAdd do
|
|
84
84
|
{
|
85
85
|
method: 'POST',
|
86
86
|
path: "/datacenters/#{subject_config[:datacenter_id]}/servers/#{subject_config[:resource_id]}/labels",
|
87
|
-
operation: :'
|
87
|
+
operation: :'LabelsApi.datacenters_servers_labels_post',
|
88
88
|
return_type: 'LabelResource',
|
89
89
|
body: { properties: expected_body },
|
90
90
|
result: label,
|
@@ -95,7 +95,7 @@ describe Chef::Knife::IonoscloudLabelAdd do
|
|
95
95
|
expect { subject.run }.not_to raise_error(Exception)
|
96
96
|
end
|
97
97
|
|
98
|
-
it 'should call
|
98
|
+
it 'should call LabelsApi.datacenters_volumes_labels_post when the type is volume and output based on what it receives' do
|
99
99
|
label = label_resource_mock
|
100
100
|
subject_config = {
|
101
101
|
ionoscloud_username: 'email',
|
@@ -126,7 +126,7 @@ describe Chef::Knife::IonoscloudLabelAdd do
|
|
126
126
|
{
|
127
127
|
method: 'POST',
|
128
128
|
path: "/datacenters/#{subject_config[:datacenter_id]}/volumes/#{subject_config[:resource_id]}/labels",
|
129
|
-
operation: :'
|
129
|
+
operation: :'LabelsApi.datacenters_volumes_labels_post',
|
130
130
|
return_type: 'LabelResource',
|
131
131
|
body: { properties: expected_body },
|
132
132
|
result: label,
|
@@ -137,7 +137,7 @@ describe Chef::Knife::IonoscloudLabelAdd do
|
|
137
137
|
expect { subject.run }.not_to raise_error(Exception)
|
138
138
|
end
|
139
139
|
|
140
|
-
it 'should call
|
140
|
+
it 'should call LabelsApi.ipblocks_labels_post when the type is ipblock and output based on what it receives' do
|
141
141
|
label = label_resource_mock
|
142
142
|
subject_config = {
|
143
143
|
ionoscloud_username: 'email',
|
@@ -167,7 +167,7 @@ describe Chef::Knife::IonoscloudLabelAdd do
|
|
167
167
|
{
|
168
168
|
method: 'POST',
|
169
169
|
path: "/ipblocks/#{subject_config[:resource_id]}/labels",
|
170
|
-
operation: :'
|
170
|
+
operation: :'LabelsApi.ipblocks_labels_post',
|
171
171
|
return_type: 'LabelResource',
|
172
172
|
body: { properties: expected_body },
|
173
173
|
result: label,
|
@@ -178,7 +178,7 @@ describe Chef::Knife::IonoscloudLabelAdd do
|
|
178
178
|
expect { subject.run }.not_to raise_error(Exception)
|
179
179
|
end
|
180
180
|
|
181
|
-
it 'should call
|
181
|
+
it 'should call LabelsApi.snapshots_labels_post when the type is snapshot and output based on what it receives' do
|
182
182
|
label = label_resource_mock
|
183
183
|
subject_config = {
|
184
184
|
ionoscloud_username: 'email',
|
@@ -208,7 +208,7 @@ describe Chef::Knife::IonoscloudLabelAdd do
|
|
208
208
|
{
|
209
209
|
method: 'POST',
|
210
210
|
path: "/snapshots/#{subject_config[:resource_id]}/labels",
|
211
|
-
operation: :'
|
211
|
+
operation: :'LabelsApi.snapshots_labels_post',
|
212
212
|
return_type: 'LabelResource',
|
213
213
|
body: { properties: expected_body },
|
214
214
|
result: label,
|
@@ -44,7 +44,7 @@ describe Chef::Knife::IonoscloudLabelList do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
describe '#run' do
|
47
|
-
it 'should call
|
47
|
+
it 'should call LabelsApi.datacenters_labels_get when the type is datacenter and output based on what it receives' do
|
48
48
|
subject_config = {
|
49
49
|
ionoscloud_username: 'email',
|
50
50
|
ionoscloud_password: 'password',
|
@@ -65,7 +65,7 @@ describe Chef::Knife::IonoscloudLabelList do
|
|
65
65
|
{
|
66
66
|
method: 'GET',
|
67
67
|
path: "/datacenters/#{subject_config[:resource_id]}/labels",
|
68
|
-
operation: :'
|
68
|
+
operation: :'LabelsApi.datacenters_labels_get',
|
69
69
|
return_type: 'LabelResources',
|
70
70
|
result: @label_resources,
|
71
71
|
},
|
@@ -75,7 +75,7 @@ describe Chef::Knife::IonoscloudLabelList do
|
|
75
75
|
expect { subject.run }.not_to raise_error(Exception)
|
76
76
|
end
|
77
77
|
|
78
|
-
it 'should call
|
78
|
+
it 'should call LabelsApi.datacenters_servers_labels_get when the type is server and output based on what it receives' do
|
79
79
|
subject_config = {
|
80
80
|
ionoscloud_username: 'email',
|
81
81
|
ionoscloud_password: 'password',
|
@@ -97,7 +97,7 @@ describe Chef::Knife::IonoscloudLabelList do
|
|
97
97
|
{
|
98
98
|
method: 'GET',
|
99
99
|
path: "/datacenters/#{subject_config[:datacenter_id]}/servers/#{subject_config[:resource_id]}/labels",
|
100
|
-
operation: :'
|
100
|
+
operation: :'LabelsApi.datacenters_servers_labels_get',
|
101
101
|
return_type: 'LabelResources',
|
102
102
|
result: @label_resources,
|
103
103
|
},
|
@@ -107,7 +107,7 @@ describe Chef::Knife::IonoscloudLabelList do
|
|
107
107
|
expect { subject.run }.not_to raise_error(Exception)
|
108
108
|
end
|
109
109
|
|
110
|
-
it 'should call
|
110
|
+
it 'should call LabelsApi.datacenters_volumes_labels_get when the type is volume and output based on what it receives' do
|
111
111
|
subject_config = {
|
112
112
|
ionoscloud_username: 'email',
|
113
113
|
ionoscloud_password: 'password',
|
@@ -129,7 +129,7 @@ describe Chef::Knife::IonoscloudLabelList do
|
|
129
129
|
{
|
130
130
|
method: 'GET',
|
131
131
|
path: "/datacenters/#{subject_config[:datacenter_id]}/volumes/#{subject_config[:resource_id]}/labels",
|
132
|
-
operation: :'
|
132
|
+
operation: :'LabelsApi.datacenters_volumes_labels_get',
|
133
133
|
return_type: 'LabelResources',
|
134
134
|
result: @label_resources,
|
135
135
|
},
|
@@ -139,7 +139,7 @@ describe Chef::Knife::IonoscloudLabelList do
|
|
139
139
|
expect { subject.run }.not_to raise_error(Exception)
|
140
140
|
end
|
141
141
|
|
142
|
-
it 'should call
|
142
|
+
it 'should call LabelsApi.ipblocks_labels_get when the type is ipblock and output based on what it receives' do
|
143
143
|
subject_config = {
|
144
144
|
ionoscloud_username: 'email',
|
145
145
|
ionoscloud_password: 'password',
|
@@ -160,7 +160,7 @@ describe Chef::Knife::IonoscloudLabelList do
|
|
160
160
|
{
|
161
161
|
method: 'GET',
|
162
162
|
path: "/ipblocks/#{subject_config[:resource_id]}/labels",
|
163
|
-
operation: :'
|
163
|
+
operation: :'LabelsApi.ipblocks_labels_get',
|
164
164
|
return_type: 'LabelResources',
|
165
165
|
result: @label_resources,
|
166
166
|
},
|
@@ -170,7 +170,7 @@ describe Chef::Knife::IonoscloudLabelList do
|
|
170
170
|
expect { subject.run }.not_to raise_error(Exception)
|
171
171
|
end
|
172
172
|
|
173
|
-
it 'should call
|
173
|
+
it 'should call LabelsApi.snapshots_labels_get when the type is snapshot and output based on what it receives' do
|
174
174
|
subject_config = {
|
175
175
|
ionoscloud_username: 'email',
|
176
176
|
ionoscloud_password: 'password',
|
@@ -191,7 +191,7 @@ describe Chef::Knife::IonoscloudLabelList do
|
|
191
191
|
{
|
192
192
|
method: 'GET',
|
193
193
|
path: "/snapshots/#{subject_config[:resource_id]}/labels",
|
194
|
-
operation: :'
|
194
|
+
operation: :'LabelsApi.snapshots_labels_get',
|
195
195
|
return_type: 'LabelResources',
|
196
196
|
result: @label_resources,
|
197
197
|
},
|
@@ -201,7 +201,7 @@ describe Chef::Knife::IonoscloudLabelList do
|
|
201
201
|
expect { subject.run }.not_to raise_error(Exception)
|
202
202
|
end
|
203
203
|
|
204
|
-
it 'should call
|
204
|
+
it 'should call LabelsApi.labels_get when the type is not one of [datacenter, server, volume, ipblock, snapshot]' do
|
205
205
|
subject_config = {
|
206
206
|
ionoscloud_username: 'email',
|
207
207
|
ionoscloud_password: 'password',
|
@@ -221,7 +221,7 @@ describe Chef::Knife::IonoscloudLabelList do
|
|
221
221
|
{
|
222
222
|
method: 'GET',
|
223
223
|
path: '/labels',
|
224
|
-
operation: :'
|
224
|
+
operation: :'LabelsApi.labels_get',
|
225
225
|
return_type: 'Labels',
|
226
226
|
result: @labels,
|
227
227
|
},
|
@@ -231,7 +231,7 @@ describe Chef::Knife::IonoscloudLabelList do
|
|
231
231
|
expect { subject.run }.not_to raise_error(Exception)
|
232
232
|
end
|
233
233
|
|
234
|
-
it 'should call
|
234
|
+
it 'should call LabelsApi.labels_get when the type is missing' do
|
235
235
|
subject_config = {
|
236
236
|
ionoscloud_username: 'email',
|
237
237
|
ionoscloud_password: 'password',
|
@@ -249,7 +249,7 @@ describe Chef::Knife::IonoscloudLabelList do
|
|
249
249
|
{
|
250
250
|
method: 'GET',
|
251
251
|
path: '/labels',
|
252
|
-
operation: :'
|
252
|
+
operation: :'LabelsApi.labels_get',
|
253
253
|
return_type: 'Labels',
|
254
254
|
result: @labels,
|
255
255
|
},
|
@@ -12,7 +12,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
describe '#run' do
|
15
|
-
it 'should call
|
15
|
+
it 'should call LabelsApi.datacenters_labels_delete when the type is datacenter and output based on what it receives' do
|
16
16
|
label = label_mock
|
17
17
|
subject_config = {
|
18
18
|
ionoscloud_username: 'email',
|
@@ -34,7 +34,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
34
34
|
{
|
35
35
|
method: 'DELETE',
|
36
36
|
path: "/datacenters/#{subject_config[:resource_id]}/labels/#{label.id}",
|
37
|
-
operation: :'
|
37
|
+
operation: :'LabelsApi.datacenters_labels_delete',
|
38
38
|
result: label,
|
39
39
|
},
|
40
40
|
],
|
@@ -43,7 +43,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
43
43
|
expect { subject.run }.not_to raise_error(Exception)
|
44
44
|
end
|
45
45
|
|
46
|
-
it 'should print when
|
46
|
+
it 'should print when LabelsApi.datacenters_labels_delete returns 404' do
|
47
47
|
label = label_mock
|
48
48
|
subject_config = {
|
49
49
|
ionoscloud_username: 'email',
|
@@ -65,7 +65,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
65
65
|
{
|
66
66
|
method: 'DELETE',
|
67
67
|
path: "/datacenters/#{subject_config[:resource_id]}/labels/#{label.id}",
|
68
|
-
operation: :'
|
68
|
+
operation: :'LabelsApi.datacenters_labels_delete',
|
69
69
|
exception: Ionoscloud::ApiError.new(code: 404),
|
70
70
|
},
|
71
71
|
],
|
@@ -74,7 +74,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
74
74
|
expect { subject.run }.not_to raise_error(Exception)
|
75
75
|
end
|
76
76
|
|
77
|
-
it 'should call
|
77
|
+
it 'should call LabelsApi.datacenters_servers_labels_delete when the type is datacenter and output based on what it receives' do
|
78
78
|
label = label_mock
|
79
79
|
subject_config = {
|
80
80
|
ionoscloud_username: 'email',
|
@@ -97,7 +97,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
97
97
|
{
|
98
98
|
method: 'DELETE',
|
99
99
|
path: "/datacenters/#{subject_config[:datacenter_id]}/servers/#{subject_config[:resource_id]}/labels/#{label.id}",
|
100
|
-
operation: :'
|
100
|
+
operation: :'LabelsApi.datacenters_servers_labels_delete',
|
101
101
|
result: label,
|
102
102
|
},
|
103
103
|
],
|
@@ -106,7 +106,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
106
106
|
expect { subject.run }.not_to raise_error(Exception)
|
107
107
|
end
|
108
108
|
|
109
|
-
it 'should print when
|
109
|
+
it 'should print when LabelsApi.datacenters_servers_labels_delete returns 404' do
|
110
110
|
label = label_mock
|
111
111
|
subject_config = {
|
112
112
|
ionoscloud_username: 'email',
|
@@ -129,7 +129,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
129
129
|
{
|
130
130
|
method: 'DELETE',
|
131
131
|
path: "/datacenters/#{subject_config[:datacenter_id]}/servers/#{subject_config[:resource_id]}/labels/#{label.id}",
|
132
|
-
operation: :'
|
132
|
+
operation: :'LabelsApi.datacenters_servers_labels_delete',
|
133
133
|
exception: Ionoscloud::ApiError.new(code: 404),
|
134
134
|
},
|
135
135
|
],
|
@@ -138,7 +138,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
138
138
|
expect { subject.run }.not_to raise_error(Exception)
|
139
139
|
end
|
140
140
|
|
141
|
-
it 'should call
|
141
|
+
it 'should call LabelsApi.datacenters_volumes_labels_delete when the type is datacenter and output based on what it receives' do
|
142
142
|
label = label_mock
|
143
143
|
subject_config = {
|
144
144
|
ionoscloud_username: 'email',
|
@@ -161,7 +161,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
161
161
|
{
|
162
162
|
method: 'DELETE',
|
163
163
|
path: "/datacenters/#{subject_config[:datacenter_id]}/volumes/#{subject_config[:resource_id]}/labels/#{label.id}",
|
164
|
-
operation: :'
|
164
|
+
operation: :'LabelsApi.datacenters_volumes_labels_delete',
|
165
165
|
result: label,
|
166
166
|
},
|
167
167
|
],
|
@@ -170,7 +170,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
170
170
|
expect { subject.run }.not_to raise_error(Exception)
|
171
171
|
end
|
172
172
|
|
173
|
-
it 'should print when
|
173
|
+
it 'should print when LabelsApi.datacenters_volumes_labels_delete returns 404' do
|
174
174
|
label = label_mock
|
175
175
|
subject_config = {
|
176
176
|
ionoscloud_username: 'email',
|
@@ -193,7 +193,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
193
193
|
{
|
194
194
|
method: 'DELETE',
|
195
195
|
path: "/datacenters/#{subject_config[:datacenter_id]}/volumes/#{subject_config[:resource_id]}/labels/#{label.id}",
|
196
|
-
operation: :'
|
196
|
+
operation: :'LabelsApi.datacenters_volumes_labels_delete',
|
197
197
|
exception: Ionoscloud::ApiError.new(code: 404),
|
198
198
|
},
|
199
199
|
],
|
@@ -201,7 +201,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
201
201
|
|
202
202
|
expect { subject.run }.not_to raise_error(Exception)
|
203
203
|
end
|
204
|
-
it 'should call
|
204
|
+
it 'should call LabelsApi.ipblocks_labels_delete when the type is ipblock and output based on what it receives' do
|
205
205
|
label = label_mock
|
206
206
|
subject_config = {
|
207
207
|
ionoscloud_username: 'email',
|
@@ -223,7 +223,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
223
223
|
{
|
224
224
|
method: 'DELETE',
|
225
225
|
path: "/ipblocks/#{subject_config[:resource_id]}/labels/#{label.id}",
|
226
|
-
operation: :'
|
226
|
+
operation: :'LabelsApi.ipblocks_labels_delete',
|
227
227
|
result: label,
|
228
228
|
},
|
229
229
|
],
|
@@ -232,7 +232,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
232
232
|
expect { subject.run }.not_to raise_error(Exception)
|
233
233
|
end
|
234
234
|
|
235
|
-
it 'should print when
|
235
|
+
it 'should print when LabelsApi.ipblocks_labels_delete returns 404' do
|
236
236
|
label = label_mock
|
237
237
|
subject_config = {
|
238
238
|
ionoscloud_username: 'email',
|
@@ -254,7 +254,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
254
254
|
{
|
255
255
|
method: 'DELETE',
|
256
256
|
path: "/ipblocks/#{subject_config[:resource_id]}/labels/#{label.id}",
|
257
|
-
operation: :'
|
257
|
+
operation: :'LabelsApi.ipblocks_labels_delete',
|
258
258
|
exception: Ionoscloud::ApiError.new(code: 404),
|
259
259
|
},
|
260
260
|
],
|
@@ -263,7 +263,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
263
263
|
expect { subject.run }.not_to raise_error(Exception)
|
264
264
|
end
|
265
265
|
|
266
|
-
it 'should call
|
266
|
+
it 'should call LabelsApi.snapshots_labels_delete when the type is snapshot and output based on what it receives' do
|
267
267
|
label = label_mock
|
268
268
|
subject_config = {
|
269
269
|
ionoscloud_username: 'email',
|
@@ -285,7 +285,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
285
285
|
{
|
286
286
|
method: 'DELETE',
|
287
287
|
path: "/snapshots/#{subject_config[:resource_id]}/labels/#{label.id}",
|
288
|
-
operation: :'
|
288
|
+
operation: :'LabelsApi.snapshots_labels_delete',
|
289
289
|
result: label,
|
290
290
|
},
|
291
291
|
],
|
@@ -294,7 +294,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
294
294
|
expect { subject.run }.not_to raise_error(Exception)
|
295
295
|
end
|
296
296
|
|
297
|
-
it 'should print when
|
297
|
+
it 'should print when LabelsApi.snapshots_labels_delete returns 404' do
|
298
298
|
label = label_mock
|
299
299
|
subject_config = {
|
300
300
|
ionoscloud_username: 'email',
|
@@ -316,7 +316,7 @@ describe Chef::Knife::IonoscloudLabelRemove do
|
|
316
316
|
{
|
317
317
|
method: 'DELETE',
|
318
318
|
path: "/snapshots/#{subject_config[:resource_id]}/labels/#{label.id}",
|
319
|
-
operation: :'
|
319
|
+
operation: :'LabelsApi.snapshots_labels_delete',
|
320
320
|
exception: Ionoscloud::ApiError.new(code: 404),
|
321
321
|
},
|
322
322
|
],
|
@@ -12,7 +12,7 @@ describe Chef::Knife::IonoscloudLanCreate do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
describe '#run' do
|
15
|
-
it 'should call
|
15
|
+
it 'should call LansApi.datacenters_lans_post with the expected arguments and output based on what it receives' do
|
16
16
|
lan = lan_mock
|
17
17
|
subject_config = {
|
18
18
|
ionoscloud_username: 'email',
|
@@ -40,7 +40,7 @@ describe Chef::Knife::IonoscloudLanCreate do
|
|
40
40
|
{
|
41
41
|
method: 'POST',
|
42
42
|
path: "/datacenters/#{subject_config[:datacenter_id]}/lans",
|
43
|
-
operation: :'
|
43
|
+
operation: :'LansApi.datacenters_lans_post',
|
44
44
|
return_type: 'LanPost',
|
45
45
|
body: { properties: expected_body },
|
46
46
|
result: lan,
|
@@ -48,7 +48,7 @@ describe Chef::Knife::IonoscloudLanCreate do
|
|
48
48
|
{
|
49
49
|
method: 'GET',
|
50
50
|
path: "/datacenters/#{subject_config[:datacenter_id]}/lans/#{lan.id}",
|
51
|
-
operation: :'
|
51
|
+
operation: :'LansApi.datacenters_lans_find_by_id',
|
52
52
|
return_type: 'Lan',
|
53
53
|
result: lan,
|
54
54
|
},
|
@@ -12,7 +12,7 @@ describe Chef::Knife::IonoscloudLanDelete do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
describe '#run' do
|
15
|
-
it 'should call
|
15
|
+
it 'should call LansApi.datacenters_lans_delete when the ID is valid' do
|
16
16
|
lan = lan_mock
|
17
17
|
subject_config = {
|
18
18
|
ionoscloud_username: 'email',
|
@@ -37,14 +37,14 @@ describe Chef::Knife::IonoscloudLanDelete do
|
|
37
37
|
{
|
38
38
|
method: 'GET',
|
39
39
|
path: "/datacenters/#{subject_config[:datacenter_id]}/lans/#{lan.id}",
|
40
|
-
operation: :'
|
40
|
+
operation: :'LansApi.datacenters_lans_find_by_id',
|
41
41
|
return_type: 'Lan',
|
42
42
|
result: lan,
|
43
43
|
},
|
44
44
|
{
|
45
45
|
method: 'DELETE',
|
46
46
|
path: "/datacenters/#{subject_config[:datacenter_id]}/lans/#{lan.id}",
|
47
|
-
operation: :'
|
47
|
+
operation: :'LansApi.datacenters_lans_delete',
|
48
48
|
},
|
49
49
|
],
|
50
50
|
)
|
@@ -52,7 +52,7 @@ describe Chef::Knife::IonoscloudLanDelete do
|
|
52
52
|
expect { subject.run }.not_to raise_error(Exception)
|
53
53
|
end
|
54
54
|
|
55
|
-
it 'should not call
|
55
|
+
it 'should not call LansApi.datacenters_lans_delete when the user ID is not valid' do
|
56
56
|
lan_id = 'invalid_id'
|
57
57
|
subject_config = {
|
58
58
|
ionoscloud_username: 'email',
|
@@ -72,7 +72,7 @@ describe Chef::Knife::IonoscloudLanDelete do
|
|
72
72
|
{
|
73
73
|
method: 'GET',
|
74
74
|
path: "/datacenters/#{subject_config[:datacenter_id]}/lans/#{lan_id}",
|
75
|
-
operation: :'
|
75
|
+
operation: :'LansApi.datacenters_lans_find_by_id',
|
76
76
|
return_type: 'Lan',
|
77
77
|
exception: Ionoscloud::ApiError.new(code: 404),
|
78
78
|
},
|