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.
Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/knife-ionoscloud.gemspec +1 -1
  3. data/lib/chef/knife/ionoscloud_backupunit_create.rb +1 -1
  4. data/lib/chef/knife/ionoscloud_backupunit_delete.rb +1 -1
  5. data/lib/chef/knife/ionoscloud_backupunit_list.rb +1 -1
  6. data/lib/chef/knife/ionoscloud_backupunit_ssourl.rb +1 -1
  7. data/lib/chef/knife/ionoscloud_base.rb +1 -1
  8. data/lib/chef/knife/ionoscloud_composite_server_create.rb +25 -23
  9. data/lib/chef/knife/ionoscloud_contract_list.rb +32 -23
  10. data/lib/chef/knife/ionoscloud_cube_server_create.rb +215 -0
  11. data/lib/chef/knife/ionoscloud_datacenter_create.rb +1 -1
  12. data/lib/chef/knife/ionoscloud_datacenter_delete.rb +1 -1
  13. data/lib/chef/knife/ionoscloud_datacenter_list.rb +4 -2
  14. data/lib/chef/knife/ionoscloud_firewall_create.rb +11 -4
  15. data/lib/chef/knife/ionoscloud_firewall_delete.rb +4 -3
  16. data/lib/chef/knife/ionoscloud_firewall_list.rb +5 -3
  17. data/lib/chef/knife/ionoscloud_flowlog_create.rb +121 -0
  18. data/lib/chef/knife/ionoscloud_flowlog_delete.rb +106 -0
  19. data/lib/chef/knife/ionoscloud_flowlog_list.rb +100 -0
  20. data/lib/chef/knife/ionoscloud_group_create.rb +35 -14
  21. data/lib/chef/knife/ionoscloud_group_delete.rb +7 -0
  22. data/lib/chef/knife/ionoscloud_group_get.rb +6 -0
  23. data/lib/chef/knife/ionoscloud_group_list.rb +19 -7
  24. data/lib/chef/knife/ionoscloud_image_list.rb +1 -1
  25. data/lib/chef/knife/ionoscloud_ipfailover_add.rb +1 -1
  26. data/lib/chef/knife/ionoscloud_ipfailover_remove.rb +1 -1
  27. data/lib/chef/knife/ionoscloud_k8s_delete.rb +5 -2
  28. data/lib/chef/knife/ionoscloud_label_add.rb +1 -1
  29. data/lib/chef/knife/ionoscloud_label_list.rb +1 -1
  30. data/lib/chef/knife/ionoscloud_label_remove.rb +1 -1
  31. data/lib/chef/knife/ionoscloud_lan_create.rb +1 -1
  32. data/lib/chef/knife/ionoscloud_lan_delete.rb +1 -1
  33. data/lib/chef/knife/ionoscloud_lan_list.rb +1 -1
  34. data/lib/chef/knife/ionoscloud_loadbalancer_create.rb +1 -1
  35. data/lib/chef/knife/ionoscloud_loadbalancer_delete.rb +1 -1
  36. data/lib/chef/knife/ionoscloud_loadbalancer_get.rb +1 -1
  37. data/lib/chef/knife/ionoscloud_loadbalancer_list.rb +1 -1
  38. data/lib/chef/knife/ionoscloud_loadbalancer_nic_add.rb +1 -1
  39. data/lib/chef/knife/ionoscloud_loadbalancer_nic_remove.rb +1 -1
  40. data/lib/chef/knife/ionoscloud_location_list.rb +5 -3
  41. data/lib/chef/knife/ionoscloud_natgateway_create.rb +71 -0
  42. data/lib/chef/knife/ionoscloud_natgateway_delete.rb +69 -0
  43. data/lib/chef/knife/ionoscloud_natgateway_lan_add.rb +82 -0
  44. data/lib/chef/knife/ionoscloud_natgateway_lan_remove.rb +58 -0
  45. data/lib/chef/knife/ionoscloud_natgateway_list.rb +49 -0
  46. data/lib/chef/knife/ionoscloud_natgateway_rule_add.rb +124 -0
  47. data/lib/chef/knife/ionoscloud_natgateway_rule_list.rb +63 -0
  48. data/lib/chef/knife/ionoscloud_natgateway_rule_remove.rb +72 -0
  49. data/lib/chef/knife/ionoscloud_networkloadbalancer_create.rb +95 -0
  50. data/lib/chef/knife/ionoscloud_networkloadbalancer_delete.rb +81 -0
  51. data/lib/chef/knife/ionoscloud_networkloadbalancer_list.rb +56 -0
  52. data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_add.rb +150 -0
  53. data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_list.rb +63 -0
  54. data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_remove.rb +78 -0
  55. data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_add.rb +141 -0
  56. data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_list.rb +68 -0
  57. data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove.rb +105 -0
  58. data/lib/chef/knife/ionoscloud_nic_create.rb +14 -9
  59. data/lib/chef/knife/ionoscloud_nic_delete.rb +4 -2
  60. data/lib/chef/knife/ionoscloud_nic_list.rb +9 -5
  61. data/lib/chef/knife/ionoscloud_node_list.rb +0 -1
  62. data/lib/chef/knife/ionoscloud_nodepool_create.rb +42 -16
  63. data/lib/chef/knife/ionoscloud_nodepool_delete.rb +25 -0
  64. data/lib/chef/knife/ionoscloud_nodepool_lan_add.rb +130 -0
  65. data/lib/chef/knife/ionoscloud_nodepool_lan_remove.rb +96 -0
  66. data/lib/chef/knife/ionoscloud_nodepool_list.rb +3 -1
  67. data/lib/chef/knife/ionoscloud_pcc_create.rb +2 -2
  68. data/lib/chef/knife/ionoscloud_pcc_delete.rb +1 -1
  69. data/lib/chef/knife/ionoscloud_pcc_list.rb +1 -1
  70. data/lib/chef/knife/ionoscloud_request_list.rb +1 -1
  71. data/lib/chef/knife/ionoscloud_request_status.rb +1 -1
  72. data/lib/chef/knife/ionoscloud_s3key_create.rb +2 -2
  73. data/lib/chef/knife/ionoscloud_s3key_delete.rb +3 -3
  74. data/lib/chef/knife/ionoscloud_s3key_list.rb +2 -2
  75. data/lib/chef/knife/ionoscloud_server_console.rb +42 -0
  76. data/lib/chef/knife/ionoscloud_server_create.rb +8 -8
  77. data/lib/chef/knife/ionoscloud_server_delete.rb +1 -1
  78. data/lib/chef/knife/ionoscloud_server_list.rb +16 -5
  79. data/lib/chef/knife/ionoscloud_server_reboot.rb +1 -1
  80. data/lib/chef/knife/ionoscloud_server_resume.rb +43 -0
  81. data/lib/chef/knife/ionoscloud_server_start.rb +1 -1
  82. data/lib/chef/knife/ionoscloud_server_stop.rb +1 -1
  83. data/lib/chef/knife/ionoscloud_server_suspend.rb +44 -0
  84. data/lib/chef/knife/ionoscloud_server_token.rb +42 -0
  85. data/lib/chef/knife/ionoscloud_server_upgrade.rb +44 -0
  86. data/lib/chef/knife/ionoscloud_snapshot_create.rb +2 -2
  87. data/lib/chef/knife/ionoscloud_snapshot_delete.rb +1 -1
  88. data/lib/chef/knife/ionoscloud_snapshot_list.rb +1 -1
  89. data/lib/chef/knife/ionoscloud_snapshot_restore.rb +2 -2
  90. data/lib/chef/knife/ionoscloud_template_list.rb +46 -0
  91. data/lib/chef/knife/ionoscloud_user_ssourl.rb +1 -1
  92. data/lib/chef/knife/ionoscloud_volume_attach.rb +1 -1
  93. data/lib/chef/knife/ionoscloud_volume_create.rb +33 -35
  94. data/lib/chef/knife/ionoscloud_volume_delete.rb +1 -1
  95. data/lib/chef/knife/ionoscloud_volume_detach.rb +1 -1
  96. data/lib/chef/knife/ionoscloud_volume_list.rb +2 -2
  97. data/lib/knife-ionoscloud/version.rb +1 -1
  98. data/spec/chef/knife/ionoscloud_backupunit_create_spec.rb +2 -2
  99. data/spec/chef/knife/ionoscloud_backupunit_delete_spec.rb +5 -5
  100. data/spec/chef/knife/ionoscloud_backupunit_list_spec.rb +1 -1
  101. data/spec/chef/knife/ionoscloud_backupunit_ssourl_spec.rb +3 -3
  102. data/spec/chef/knife/ionoscloud_base_spec.rb +4 -4
  103. data/spec/chef/knife/ionoscloud_composite_server_create_spec.rb +11 -8
  104. data/spec/chef/knife/ionoscloud_contract_list_spec.rb +32 -27
  105. data/spec/chef/knife/ionoscloud_cube_server_create_spec.rb +249 -0
  106. data/spec/chef/knife/ionoscloud_datacenter_create_spec.rb +3 -2
  107. data/spec/chef/knife/ionoscloud_datacenter_delete_spec.rb +5 -5
  108. data/spec/chef/knife/ionoscloud_datacenter_list_spec.rb +5 -3
  109. data/spec/chef/knife/ionoscloud_firewall_create_spec.rb +5 -3
  110. data/spec/chef/knife/ionoscloud_firewall_delete_spec.rb +6 -5
  111. data/spec/chef/knife/ionoscloud_firewall_list_spec.rb +5 -3
  112. data/spec/chef/knife/ionoscloud_flowlog_create_spec.rb +254 -0
  113. data/spec/chef/knife/ionoscloud_flowlog_delete_spec.rb +360 -0
  114. data/spec/chef/knife/ionoscloud_flowlog_list_spec.rb +264 -0
  115. data/spec/chef/knife/ionoscloud_group_create_spec.rb +6 -0
  116. data/spec/chef/knife/ionoscloud_group_delete_spec.rb +6 -0
  117. data/spec/chef/knife/ionoscloud_group_get_spec.rb +6 -0
  118. data/spec/chef/knife/ionoscloud_group_list_spec.rb +26 -8
  119. data/spec/chef/knife/ionoscloud_image_list_spec.rb +2 -2
  120. data/spec/chef/knife/ionoscloud_ipfailover_add_spec.rb +3 -3
  121. data/spec/chef/knife/ionoscloud_ipfailover_remove_spec.rb +4 -4
  122. data/spec/chef/knife/ionoscloud_k8s_delete_spec.rb +5 -2
  123. data/spec/chef/knife/ionoscloud_kubeconfig_get_spec.rb +2 -2
  124. data/spec/chef/knife/ionoscloud_label_add_spec.rb +10 -10
  125. data/spec/chef/knife/ionoscloud_label_list_spec.rb +14 -14
  126. data/spec/chef/knife/ionoscloud_label_remove_spec.rb +20 -20
  127. data/spec/chef/knife/ionoscloud_lan_create_spec.rb +3 -3
  128. data/spec/chef/knife/ionoscloud_lan_delete_spec.rb +5 -5
  129. data/spec/chef/knife/ionoscloud_lan_list_spec.rb +2 -2
  130. data/spec/chef/knife/ionoscloud_loadbalancer_create_spec.rb +3 -3
  131. data/spec/chef/knife/ionoscloud_loadbalancer_delete_spec.rb +5 -5
  132. data/spec/chef/knife/ionoscloud_loadbalancer_get_spec.rb +2 -2
  133. data/spec/chef/knife/ionoscloud_loadbalancer_list_spec.rb +2 -2
  134. data/spec/chef/knife/ionoscloud_loadbalancer_nic_add_spec.rb +6 -6
  135. data/spec/chef/knife/ionoscloud_loadbalancer_nic_remove_spec.rb +6 -6
  136. data/spec/chef/knife/ionoscloud_location_list_spec.rb +5 -3
  137. data/spec/chef/knife/ionoscloud_natgateway_create_spec.rb +77 -0
  138. data/spec/chef/knife/ionoscloud_natgateway_delete_spec.rb +118 -0
  139. data/spec/chef/knife/ionoscloud_natgateway_lan_add_spec.rb +143 -0
  140. data/spec/chef/knife/ionoscloud_natgateway_lan_remove_spec.rb +194 -0
  141. data/spec/chef/knife/ionoscloud_natgateway_list_spec.rb +79 -0
  142. data/spec/chef/knife/ionoscloud_natgateway_rule_add_spec.rb +98 -0
  143. data/spec/chef/knife/ionoscloud_natgateway_rule_list_spec.rb +92 -0
  144. data/spec/chef/knife/ionoscloud_natgateway_rule_remove_spec.rb +77 -0
  145. data/spec/chef/knife/ionoscloud_networkloadbalancer_create_spec.rb +80 -0
  146. data/spec/chef/knife/ionoscloud_networkloadbalancer_delete_spec.rb +119 -0
  147. data/spec/chef/knife/ionoscloud_networkloadbalancer_list_spec.rb +88 -0
  148. data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_add_spec.rb +104 -0
  149. data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_list_spec.rb +89 -0
  150. data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_remove_spec.rb +124 -0
  151. data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_add_spec.rb +109 -0
  152. data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_list_spec.rb +85 -0
  153. data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove_spec.rb +263 -0
  154. data/spec/chef/knife/ionoscloud_nic_create_spec.rb +9 -5
  155. data/spec/chef/knife/ionoscloud_nic_delete_spec.rb +8 -6
  156. data/spec/chef/knife/ionoscloud_nic_list_spec.rb +12 -6
  157. data/spec/chef/knife/ionoscloud_nodepool_create_spec.rb +15 -1
  158. data/spec/chef/knife/ionoscloud_nodepool_lan_add_spec.rb +226 -0
  159. data/spec/chef/knife/ionoscloud_nodepool_lan_remove.rb +199 -0
  160. data/spec/chef/knife/ionoscloud_nodepool_list_spec.rb +3 -1
  161. data/spec/chef/knife/ionoscloud_pcc_create_spec.rb +6 -6
  162. data/spec/chef/knife/ionoscloud_pcc_delete_spec.rb +5 -5
  163. data/spec/chef/knife/ionoscloud_pcc_list_spec.rb +2 -2
  164. data/spec/chef/knife/ionoscloud_request_list_spec.rb +16 -16
  165. data/spec/chef/knife/ionoscloud_request_status_spec.rb +3 -3
  166. data/spec/chef/knife/ionoscloud_s3key_create_spec.rb +2 -2
  167. data/spec/chef/knife/ionoscloud_s3key_delete_spec.rb +5 -5
  168. data/spec/chef/knife/ionoscloud_s3key_list_spec.rb +2 -2
  169. data/spec/chef/knife/ionoscloud_server_console_spec.rb +97 -0
  170. data/spec/chef/knife/ionoscloud_server_create_spec.rb +3 -3
  171. data/spec/chef/knife/ionoscloud_server_delete_spec.rb +5 -5
  172. data/spec/chef/knife/ionoscloud_server_list_spec.rb +63 -5
  173. data/spec/chef/knife/ionoscloud_server_reboot_spec.rb +3 -5
  174. data/spec/chef/knife/ionoscloud_server_resume_spec.rb +93 -0
  175. data/spec/chef/knife/ionoscloud_server_start_spec.rb +3 -5
  176. data/spec/chef/knife/ionoscloud_server_stop_spec.rb +3 -5
  177. data/spec/chef/knife/ionoscloud_server_suspend_spec.rb +93 -0
  178. data/spec/chef/knife/ionoscloud_server_token_spec.rb +97 -0
  179. data/spec/chef/knife/ionoscloud_server_upgrade_spec.rb +96 -0
  180. data/spec/chef/knife/ionoscloud_snapshot_create_spec.rb +3 -3
  181. data/spec/chef/knife/ionoscloud_snapshot_delete_spec.rb +5 -5
  182. data/spec/chef/knife/ionoscloud_snapshot_list_spec.rb +2 -2
  183. data/spec/chef/knife/ionoscloud_snapshot_restore_spec.rb +3 -3
  184. data/spec/chef/knife/ionoscloud_template_list_spec.rb +78 -0
  185. data/spec/chef/knife/ionoscloud_user_ssourl_spec.rb +3 -3
  186. data/spec/chef/knife/ionoscloud_volume_attach_spec.rb +4 -4
  187. data/spec/chef/knife/ionoscloud_volume_create_spec.rb +6 -58
  188. data/spec/chef/knife/ionoscloud_volume_delete_spec.rb +5 -5
  189. data/spec/chef/knife/ionoscloud_volume_detach_spec.rb +5 -5
  190. data/spec/chef/knife/ionoscloud_volume_list_spec.rb +4 -4
  191. data/spec/spec_helper.rb +223 -29
  192. 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 active' do
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("K8s Cluster ID #{k8s_cluster.id} is not active. Skipping.")
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: 'KubernetesConfig',
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: 'KubernetesConfig',
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 LabelApi.datacenters_labels_post when the type is datacenter and output based on what it receives' do
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: :'LabelApi.datacenters_labels_post',
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 LabelApi.datacenters_servers_labels_post when the type is server and output based on what it receives' do
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: :'LabelApi.datacenters_servers_labels_post',
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 LabelApi.datacenters_volumes_labels_post when the type is volume and output based on what it receives' do
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: :'LabelApi.datacenters_volumes_labels_post',
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 LabelApi.ipblocks_labels_post when the type is ipblock and output based on what it receives' do
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: :'LabelApi.ipblocks_labels_post',
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 LabelApi.snapshots_labels_post when the type is snapshot and output based on what it receives' do
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: :'LabelApi.snapshots_labels_post',
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 LabelApi.datacenters_labels_get when the type is datacenter and output based on what it receives' do
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: :'LabelApi.datacenters_labels_get',
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 LabelApi.datacenters_servers_labels_get when the type is server and output based on what it receives' do
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: :'LabelApi.datacenters_servers_labels_get',
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 LabelApi.datacenters_volumes_labels_get when the type is volume and output based on what it receives' do
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: :'LabelApi.datacenters_volumes_labels_get',
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 LabelApi.ipblocks_labels_get when the type is ipblock and output based on what it receives' do
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: :'LabelApi.ipblocks_labels_get',
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 LabelApi.snapshots_labels_get when the type is snapshot and output based on what it receives' do
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: :'LabelApi.snapshots_labels_get',
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 LabelApi.labels_get when the type is not one of [datacenter, server, volume, ipblock, snapshot]' do
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: :'LabelApi.labels_get',
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 LabelApi.labels_get when the type is missing' do
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: :'LabelApi.labels_get',
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 LabelApi.datacenters_labels_delete when the type is datacenter and output based on what it receives' do
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: :'LabelApi.datacenters_labels_delete',
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 LabelApi.datacenters_labels_delete returns 404' do
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: :'LabelApi.datacenters_labels_delete',
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 LabelApi.datacenters_servers_labels_delete when the type is datacenter and output based on what it receives' do
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: :'LabelApi.datacenters_servers_labels_delete',
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 LabelApi.datacenters_servers_labels_delete returns 404' do
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: :'LabelApi.datacenters_servers_labels_delete',
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 LabelApi.datacenters_volumes_labels_delete when the type is datacenter and output based on what it receives' do
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: :'LabelApi.datacenters_volumes_labels_delete',
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 LabelApi.datacenters_volumes_labels_delete returns 404' do
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: :'LabelApi.datacenters_volumes_labels_delete',
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 LabelApi.ipblocks_labels_delete when the type is ipblock and output based on what it receives' do
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: :'LabelApi.ipblocks_labels_delete',
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 LabelApi.ipblocks_labels_delete returns 404' do
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: :'LabelApi.ipblocks_labels_delete',
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 LabelApi.snapshots_labels_delete when the type is snapshot and output based on what it receives' do
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: :'LabelApi.snapshots_labels_delete',
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 LabelApi.snapshots_labels_delete returns 404' do
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: :'LabelApi.snapshots_labels_delete',
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 LanApi.datacenters_lans_post with the expected arguments and output based on what it receives' do
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: :'LanApi.datacenters_lans_post',
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: :'LanApi.datacenters_lans_find_by_id',
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 LanApi.datacenters_lans_delete when the ID is valid' do
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: :'LanApi.datacenters_lans_find_by_id',
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: :'LanApi.datacenters_lans_delete',
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 LanApi.datacenters_lans_delete when the user ID is not valid' do
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: :'LanApi.datacenters_lans_find_by_id',
75
+ operation: :'LansApi.datacenters_lans_find_by_id',
76
76
  return_type: 'Lan',
77
77
  exception: Ionoscloud::ApiError.new(code: 404),
78
78
  },