knife-ionoscloud 5.1.1 → 6.0.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/README.md +1 -1
- data/docs/subcommands/composite_server_create.md +9 -3
- data/docs/subcommands/cube_server_create.md +91 -0
- data/docs/subcommands/firewall_create.md +5 -2
- data/docs/subcommands/flowlog_create.md +63 -0
- data/docs/subcommands/flowlog_delete.md +51 -0
- data/docs/subcommands/flowlog_list.md +51 -0
- data/docs/subcommands/group_create.md +10 -1
- data/docs/subcommands/natgateway_create.md +41 -0
- data/docs/subcommands/natgateway_delete.md +35 -0
- data/docs/subcommands/natgateway_lan_add.md +46 -0
- data/docs/subcommands/natgateway_lan_remove.md +39 -0
- data/docs/subcommands/natgateway_list.md +35 -0
- data/docs/subcommands/natgateway_rule_add.md +66 -0
- data/docs/subcommands/natgateway_rule_list.md +38 -0
- data/docs/subcommands/natgateway_rule_remove.md +39 -0
- data/docs/subcommands/networkloadbalancer_create.md +54 -0
- data/docs/subcommands/networkloadbalancer_delete.md +35 -0
- data/docs/subcommands/networkloadbalancer_list.md +35 -0
- data/docs/subcommands/networkloadbalancer_rule_add.md +72 -0
- data/docs/subcommands/networkloadbalancer_rule_list.md +39 -0
- data/docs/subcommands/networkloadbalancer_rule_remove.md +39 -0
- data/docs/subcommands/networkloadbalancer_rule_target_add.md +64 -0
- data/docs/subcommands/networkloadbalancer_rule_target_list.md +43 -0
- data/docs/subcommands/networkloadbalancer_rule_target_remove.md +51 -0
- data/docs/subcommands/nic_create.md +3 -3
- data/docs/subcommands/nodepool_lan_add.md +49 -0
- data/docs/subcommands/nodepool_lan_remove.md +39 -0
- data/docs/subcommands/server_console.md +39 -0
- data/docs/subcommands/server_list.md +4 -1
- data/docs/subcommands/server_resume.md +35 -0
- data/docs/subcommands/server_suspend.md +35 -0
- data/docs/subcommands/server_token.md +39 -0
- data/docs/subcommands/server_upgrade.md +39 -0
- data/docs/subcommands/template_list.md +31 -0
- data/docs/subcommands/volume_create.md +2 -5
- data/docs/summary.md +29 -0
- data/knife-ionoscloud.gemspec +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_create.rb +12 -16
- data/lib/chef/knife/ionoscloud_backupunit_delete.rb +2 -5
- data/lib/chef/knife/ionoscloud_backupunit_get.rb +33 -0
- 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_backupunit_update.rb +62 -0
- data/lib/chef/knife/ionoscloud_base.rb +309 -1
- data/lib/chef/knife/ionoscloud_composite_server_create.rb +23 -5
- data/lib/chef/knife/ionoscloud_contract_list.rb +32 -23
- data/lib/chef/knife/ionoscloud_cube_server_create.rb +212 -0
- data/lib/chef/knife/ionoscloud_datacenter_create.rb +11 -14
- data/lib/chef/knife/ionoscloud_datacenter_delete.rb +2 -7
- data/lib/chef/knife/ionoscloud_datacenter_get.rb +33 -0
- data/lib/chef/knife/ionoscloud_datacenter_list.rb +4 -2
- data/lib/chef/knife/ionoscloud_datacenter_update.rb +67 -0
- data/lib/chef/knife/ionoscloud_firewall_create.rb +16 -21
- data/lib/chef/knife/ionoscloud_firewall_delete.rb +5 -13
- data/lib/chef/knife/ionoscloud_firewall_get.rb +52 -0
- data/lib/chef/knife/ionoscloud_firewall_list.rb +5 -3
- data/lib/chef/knife/ionoscloud_firewall_update.rb +133 -0
- data/lib/chef/knife/ionoscloud_flowlog_create.rb +116 -0
- data/lib/chef/knife/ionoscloud_flowlog_delete.rb +103 -0
- data/lib/chef/knife/ionoscloud_flowlog_get.rb +84 -0
- data/lib/chef/knife/ionoscloud_flowlog_list.rb +101 -0
- data/lib/chef/knife/ionoscloud_flowlog_update.rb +127 -0
- data/lib/chef/knife/ionoscloud_group_create.rb +33 -27
- data/lib/chef/knife/ionoscloud_group_delete.rb +1 -11
- data/lib/chef/knife/ionoscloud_group_get.rb +1 -13
- data/lib/chef/knife/ionoscloud_group_list.rb +19 -7
- data/lib/chef/knife/ionoscloud_group_update.rb +131 -0
- data/lib/chef/knife/ionoscloud_group_user_add.rb +1 -18
- data/lib/chef/knife/ionoscloud_group_user_remove.rb +1 -18
- data/lib/chef/knife/ionoscloud_image_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_ipblock_create.rb +10 -13
- data/lib/chef/knife/ionoscloud_ipblock_delete.rb +1 -4
- data/lib/chef/knife/ionoscloud_ipblock_get.rb +33 -0
- data/lib/chef/knife/ionoscloud_ipblock_update.rb +57 -0
- data/lib/chef/knife/ionoscloud_ipfailover_add.rb +1 -1
- data/lib/chef/knife/ionoscloud_ipfailover_remove.rb +1 -1
- data/lib/chef/knife/ionoscloud_k8s_create.rb +27 -35
- data/lib/chef/knife/ionoscloud_k8s_delete.rb +1 -9
- data/lib/chef/knife/ionoscloud_k8s_get.rb +33 -0
- data/lib/chef/knife/ionoscloud_k8s_update.rb +99 -0
- data/lib/chef/knife/ionoscloud_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 +6 -14
- data/lib/chef/knife/ionoscloud_lan_delete.rb +3 -4
- data/lib/chef/knife/ionoscloud_lan_get.rb +38 -0
- data/lib/chef/knife/ionoscloud_lan_list.rb +2 -1
- data/lib/chef/knife/ionoscloud_lan_update.rb +76 -0
- data/lib/chef/knife/ionoscloud_loadbalancer_create.rb +4 -14
- data/lib/chef/knife/ionoscloud_loadbalancer_delete.rb +2 -9
- data/lib/chef/knife/ionoscloud_loadbalancer_get.rb +3 -13
- data/lib/chef/knife/ionoscloud_loadbalancer_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_add.rb +3 -15
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_remove.rb +3 -16
- data/lib/chef/knife/ionoscloud_loadbalancer_update.rb +73 -0
- data/lib/chef/knife/ionoscloud_location_list.rb +5 -3
- data/lib/chef/knife/ionoscloud_natgateway_create.rb +60 -0
- data/lib/chef/knife/ionoscloud_natgateway_delete.rb +54 -0
- data/lib/chef/knife/ionoscloud_natgateway_get.rb +42 -0
- data/lib/chef/knife/ionoscloud_natgateway_lan_add.rb +74 -0
- data/lib/chef/knife/ionoscloud_natgateway_lan_remove.rb +52 -0
- data/lib/chef/knife/ionoscloud_natgateway_list.rb +51 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_add.rb +107 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_list.rb +65 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_remove.rb +55 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_update.rb +116 -0
- data/lib/chef/knife/ionoscloud_natgateway_update.rb +84 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_create.rb +89 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_delete.rb +62 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_get.rb +42 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_list.rb +57 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_add.rb +141 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_list.rb +65 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_remove.rb +68 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_add.rb +124 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_list.rb +70 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove.rb +88 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_update.rb +148 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_update.rb +98 -0
- data/lib/chef/knife/ionoscloud_nic_create.rb +17 -22
- data/lib/chef/knife/ionoscloud_nic_delete.rb +3 -7
- data/lib/chef/knife/ionoscloud_nic_get.rb +49 -0
- data/lib/chef/knife/ionoscloud_nic_list.rb +9 -5
- data/lib/chef/knife/ionoscloud_nic_update.rb +96 -0
- data/lib/chef/knife/ionoscloud_node_get.rb +49 -0
- data/lib/chef/knife/ionoscloud_node_list.rb +0 -1
- data/lib/chef/knife/ionoscloud_nodepool_create.rb +35 -48
- data/lib/chef/knife/ionoscloud_nodepool_delete.rb +1 -7
- data/lib/chef/knife/ionoscloud_nodepool_get.rb +43 -0
- data/lib/chef/knife/ionoscloud_nodepool_lan_add.rb +104 -0
- data/lib/chef/knife/ionoscloud_nodepool_lan_remove.rb +72 -0
- data/lib/chef/knife/ionoscloud_nodepool_list.rb +3 -1
- data/lib/chef/knife/ionoscloud_nodepool_update.rb +124 -0
- data/lib/chef/knife/ionoscloud_pcc_create.rb +12 -18
- data/lib/chef/knife/ionoscloud_pcc_delete.rb +2 -10
- data/lib/chef/knife/ionoscloud_pcc_get.rb +33 -0
- data/lib/chef/knife/ionoscloud_pcc_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_pcc_update.rb +63 -0
- data/lib/chef/knife/ionoscloud_request_get.rb +40 -0
- data/lib/chef/knife/ionoscloud_request_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_request_status.rb +1 -1
- data/lib/chef/knife/ionoscloud_s3key_create.rb +3 -7
- data/lib/chef/knife/ionoscloud_s3key_delete.rb +4 -7
- data/lib/chef/knife/ionoscloud_s3key_get.rb +38 -0
- data/lib/chef/knife/ionoscloud_s3key_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_console.rb +43 -0
- data/lib/chef/knife/ionoscloud_server_create.rb +14 -26
- data/lib/chef/knife/ionoscloud_server_delete.rb +3 -9
- data/lib/chef/knife/ionoscloud_server_get.rb +43 -0
- 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 +44 -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 +45 -0
- data/lib/chef/knife/ionoscloud_server_token.rb +43 -0
- data/lib/chef/knife/ionoscloud_server_update.rb +97 -0
- data/lib/chef/knife/ionoscloud_server_upgrade.rb +45 -0
- data/lib/chef/knife/ionoscloud_share_create.rb +7 -11
- data/lib/chef/knife/ionoscloud_share_delete.rb +2 -3
- data/lib/chef/knife/ionoscloud_share_get.rb +38 -0
- data/lib/chef/knife/ionoscloud_share_update.rb +70 -0
- data/lib/chef/knife/ionoscloud_snapshot_create.rb +2 -10
- data/lib/chef/knife/ionoscloud_snapshot_delete.rb +2 -7
- data/lib/chef/knife/ionoscloud_snapshot_get.rb +32 -0
- data/lib/chef/knife/ionoscloud_snapshot_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_snapshot_restore.rb +3 -14
- data/lib/chef/knife/ionoscloud_snapshot_update.rb +126 -0
- data/lib/chef/knife/ionoscloud_template_list.rb +47 -0
- data/lib/chef/knife/ionoscloud_user_create.rb +1 -8
- data/lib/chef/knife/ionoscloud_user_delete.rb +1 -6
- data/lib/chef/knife/ionoscloud_user_get.rb +32 -0
- data/lib/chef/knife/ionoscloud_user_ssourl.rb +1 -1
- data/lib/chef/knife/ionoscloud_user_update.rb +92 -0
- data/lib/chef/knife/ionoscloud_volume_attach.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_create.rb +18 -34
- data/lib/chef/knife/ionoscloud_volume_delete.rb +3 -9
- data/lib/chef/knife/ionoscloud_volume_detach.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_get.rb +36 -0
- data/lib/chef/knife/ionoscloud_volume_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_volume_update.rb +106 -0
- 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_get_spec.rb +65 -0
- 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_backupunit_update_spec.rb +78 -0
- 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 +6 -2
- data/spec/chef/knife/ionoscloud_datacenter_delete_spec.rb +8 -5
- data/spec/chef/knife/ionoscloud_datacenter_get_spec.rb +69 -0
- data/spec/chef/knife/ionoscloud_datacenter_list_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_datacenter_update_spec.rb +82 -0
- 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_get_spec.rb +77 -0
- data/spec/chef/knife/ionoscloud_firewall_list_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_firewall_update_spec.rb +117 -0
- 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_get_spec.rb +171 -0
- data/spec/chef/knife/ionoscloud_flowlog_list_spec.rb +264 -0
- data/spec/chef/knife/ionoscloud_flowlog_update_spec.rb +244 -0
- data/spec/chef/knife/ionoscloud_group_create_spec.rb +9 -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_group_update_spec.rb +121 -0
- data/spec/chef/knife/ionoscloud_group_user_add_spec.rb +6 -0
- data/spec/chef/knife/ionoscloud_group_user_remove_spec.rb +6 -0
- data/spec/chef/knife/ionoscloud_image_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_ipblock_get_spec.rb +66 -0
- data/spec/chef/knife/ionoscloud_ipblock_update_spec.rb +79 -0
- data/spec/chef/knife/ionoscloud_ipfailover_add_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_ipfailover_remove_spec.rb +7 -7
- data/spec/chef/knife/ionoscloud_k8s_create_spec.rb +7 -0
- data/spec/chef/knife/ionoscloud_k8s_delete_spec.rb +16 -11
- data/spec/chef/knife/ionoscloud_k8s_get_spec.rb +72 -0
- data/spec/chef/knife/ionoscloud_k8s_update_spec.rb +114 -0
- data/spec/chef/knife/ionoscloud_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 +4 -3
- data/spec/chef/knife/ionoscloud_lan_delete_spec.rb +7 -5
- data/spec/chef/knife/ionoscloud_lan_get_spec.rb +68 -0
- data/spec/chef/knife/ionoscloud_lan_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_lan_update_spec.rb +87 -0
- 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_loadbalancer_update_spec.rb +89 -0
- data/spec/chef/knife/ionoscloud_location_list_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_natgateway_create_spec.rb +92 -0
- data/spec/chef/knife/ionoscloud_natgateway_delete_spec.rb +118 -0
- data/spec/chef/knife/ionoscloud_natgateway_get_spec.rb +81 -0
- data/spec/chef/knife/ionoscloud_natgateway_lan_add_spec.rb +158 -0
- data/spec/chef/knife/ionoscloud_natgateway_lan_remove_spec.rb +209 -0
- data/spec/chef/knife/ionoscloud_natgateway_list_spec.rb +79 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_add_spec.rb +99 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_list_spec.rb +92 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_remove_spec.rb +78 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_update_spec.rb +121 -0
- data/spec/chef/knife/ionoscloud_natgateway_update_spec.rb +121 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_create_spec.rb +93 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_delete_spec.rb +120 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_get_spec.rb +82 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_list_spec.rb +88 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_add_spec.rb +105 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_list_spec.rb +89 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_remove_spec.rb +150 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_add_spec.rb +113 -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 +281 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_update_spec.rb +163 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_update_spec.rb +107 -0
- data/spec/chef/knife/ionoscloud_nic_create_spec.rb +9 -5
- data/spec/chef/knife/ionoscloud_nic_delete_spec.rb +8 -6
- data/spec/chef/knife/ionoscloud_nic_get_spec.rb +72 -0
- data/spec/chef/knife/ionoscloud_nic_list_spec.rb +12 -6
- data/spec/chef/knife/ionoscloud_nic_update_spec.rb +97 -0
- data/spec/chef/knife/ionoscloud_node_get_spec.rb +70 -0
- data/spec/chef/knife/ionoscloud_nodepool_create_spec.rb +10 -5
- data/spec/chef/knife/ionoscloud_nodepool_delete_spec.rb +14 -0
- data/spec/chef/knife/ionoscloud_nodepool_get_spec.rb +83 -0
- data/spec/chef/knife/ionoscloud_nodepool_lan_add_spec.rb +222 -0
- data/spec/chef/knife/ionoscloud_nodepool_lan_remove.rb +196 -0
- data/spec/chef/knife/ionoscloud_nodepool_list_spec.rb +3 -1
- data/spec/chef/knife/ionoscloud_nodepool_update_spec.rb +134 -0
- data/spec/chef/knife/ionoscloud_pcc_create_spec.rb +11 -8
- data/spec/chef/knife/ionoscloud_pcc_delete_spec.rb +7 -7
- data/spec/chef/knife/ionoscloud_pcc_get_spec.rb +71 -0
- data/spec/chef/knife/ionoscloud_pcc_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_pcc_update_spec.rb +83 -0
- data/spec/chef/knife/ionoscloud_request_get_spec.rb +69 -0
- data/spec/chef/knife/ionoscloud_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_get_spec.rb +66 -0
- 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 +6 -3
- data/spec/chef/knife/ionoscloud_server_delete_spec.rb +8 -5
- data/spec/chef/knife/ionoscloud_server_get_spec.rb +74 -0
- 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_update_spec.rb +105 -0
- data/spec/chef/knife/ionoscloud_server_upgrade_spec.rb +96 -0
- data/spec/chef/knife/ionoscloud_share_get_spec.rb +66 -0
- data/spec/chef/knife/ionoscloud_share_update_spec.rb +91 -0
- data/spec/chef/knife/ionoscloud_snapshot_create_spec.rb +15 -3
- data/spec/chef/knife/ionoscloud_snapshot_delete_spec.rb +17 -5
- data/spec/chef/knife/ionoscloud_snapshot_get_spec.rb +79 -0
- data/spec/chef/knife/ionoscloud_snapshot_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_snapshot_restore_spec.rb +12 -3
- data/spec/chef/knife/ionoscloud_snapshot_update_spec.rb +113 -0
- data/spec/chef/knife/ionoscloud_template_list_spec.rb +78 -0
- data/spec/chef/knife/ionoscloud_user_create_spec.rb +3 -1
- data/spec/chef/knife/ionoscloud_user_delete_spec.rb +4 -2
- data/spec/chef/knife/ionoscloud_user_get_spec.rb +70 -0
- data/spec/chef/knife/ionoscloud_user_ssourl_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_user_update_spec.rb +110 -0
- data/spec/chef/knife/ionoscloud_volume_attach_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_volume_create_spec.rb +21 -11
- data/spec/chef/knife/ionoscloud_volume_delete_spec.rb +15 -5
- data/spec/chef/knife/ionoscloud_volume_detach_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_volume_get_spec.rb +81 -0
- data/spec/chef/knife/ionoscloud_volume_list_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_volume_update_spec.rb +116 -0
- data/spec/spec_helper.rb +251 -39
- metadata +245 -6
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ionoscloud_k8s_get'
|
3
|
+
|
4
|
+
Chef::Knife::IonoscloudK8sGet.load_deps
|
5
|
+
|
6
|
+
describe Chef::Knife::IonoscloudK8sGet do
|
7
|
+
before :each do
|
8
|
+
subject { Chef::Knife::IonoscloudK8sGet.new }
|
9
|
+
|
10
|
+
allow(subject).to receive(:puts)
|
11
|
+
allow(subject).to receive(:print)
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#run' do
|
15
|
+
it 'should call KubernetesApi.k8s_find_by_cluster_id' do
|
16
|
+
cluster = k8s_cluster_mock
|
17
|
+
subject_config = {
|
18
|
+
ionoscloud_username: 'email',
|
19
|
+
ionoscloud_password: 'password',
|
20
|
+
cluster_id: cluster.id,
|
21
|
+
}
|
22
|
+
|
23
|
+
subject_config.each { |key, value| subject.config[key] = value }
|
24
|
+
|
25
|
+
maintenance_window = "#{cluster.properties.maintenance_window.day_of_the_week}, #{cluster.properties.maintenance_window.time}"
|
26
|
+
s3_buckets = (cluster.properties.s3_buckets.nil? ? [] : cluster.properties.s3_buckets.map { |el| el.name })
|
27
|
+
|
28
|
+
expect(subject).to receive(:puts).with("ID: #{cluster.id}")
|
29
|
+
expect(subject).to receive(:puts).with("Name: #{cluster.properties.name}")
|
30
|
+
expect(subject).to receive(:puts).with("k8s Version: #{cluster.properties.k8s_version}")
|
31
|
+
expect(subject).to receive(:puts).with("Maintenance Window: #{maintenance_window}")
|
32
|
+
expect(subject).to receive(:puts).with("State: #{cluster.metadata.state}")
|
33
|
+
expect(subject).to receive(:puts).with("Api Subnet Allow List: #{cluster.properties.api_subnet_allow_list}")
|
34
|
+
expect(subject).to receive(:puts).with("S3 Buckets: #{s3_buckets}")
|
35
|
+
expect(subject).to receive(:puts).with("Available Upgrade Versions: #{cluster.properties.available_upgrade_versions}")
|
36
|
+
expect(subject).to receive(:puts).with("Viable NodePool Versions: #{cluster.properties.viable_node_pool_versions}")
|
37
|
+
|
38
|
+
mock_call_api(
|
39
|
+
subject,
|
40
|
+
[
|
41
|
+
{
|
42
|
+
method: 'GET',
|
43
|
+
path: "/k8s/#{cluster.id}",
|
44
|
+
operation: :'KubernetesApi.k8s_find_by_cluster_id',
|
45
|
+
return_type: 'KubernetesCluster',
|
46
|
+
result: cluster,
|
47
|
+
},
|
48
|
+
],
|
49
|
+
)
|
50
|
+
|
51
|
+
expect { subject.run }.not_to raise_error(Exception)
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'should not make any call if any required option is missing' do
|
55
|
+
required_options = subject.instance_variable_get(:@required_options)
|
56
|
+
|
57
|
+
arrays_without_one_element(required_options).each do |test_case|
|
58
|
+
|
59
|
+
test_case[:array].each { |value| subject.config[value] = 'test' }
|
60
|
+
|
61
|
+
expect(subject).to receive(:puts).with("Missing required parameters #{test_case[:removed]}")
|
62
|
+
expect(subject.api_client).not_to receive(:call_api)
|
63
|
+
|
64
|
+
expect { subject.run }.to raise_error(SystemExit) do |error|
|
65
|
+
expect(error.status).to eq(1)
|
66
|
+
end
|
67
|
+
|
68
|
+
required_options.each { |value| subject.config[value] = nil }
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,114 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ionoscloud_k8s_update'
|
3
|
+
|
4
|
+
Chef::Knife::IonoscloudK8sUpdate.load_deps
|
5
|
+
|
6
|
+
describe Chef::Knife::IonoscloudK8sUpdate do
|
7
|
+
before :each do
|
8
|
+
subject { Chef::Knife::IonoscloudK8sUpdate.new }
|
9
|
+
|
10
|
+
allow(subject).to receive(:puts)
|
11
|
+
allow(subject).to receive(:print)
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#run' do
|
15
|
+
it 'should call NicApi.datacenters_servers_nics_clusterrules_patch' do
|
16
|
+
cluster = k8s_cluster_mock
|
17
|
+
|
18
|
+
subject_config = {
|
19
|
+
ionoscloud_username: 'email',
|
20
|
+
ionoscloud_password: 'password',
|
21
|
+
cluster_id: cluster.id,
|
22
|
+
name: cluster.properties.name + '_edited',
|
23
|
+
version: '19.9.9',
|
24
|
+
maintenance_day: 'Monday',
|
25
|
+
maintenance_time: '13:03:19Z',
|
26
|
+
api_subnet_allow_list: (cluster.properties.api_subnet_allow_list + ['1.1.1.1']).join(','),
|
27
|
+
s3_buckets: (cluster.properties.s3_buckets.map { |el| el.name } + ['new_bucket']).join(','),
|
28
|
+
yes: true,
|
29
|
+
}
|
30
|
+
|
31
|
+
subject_config.each { |key, value| subject.config[key] = value }
|
32
|
+
|
33
|
+
maintenance_window = "#{subject_config[:maintenance_day]}, #{subject_config[:maintenance_time]}"
|
34
|
+
s3_buckets = (cluster.properties.s3_buckets.map { |el| el.name } + ['new_bucket'])
|
35
|
+
|
36
|
+
expect(subject).to receive(:puts).with("ID: #{cluster.id}")
|
37
|
+
expect(subject).to receive(:puts).with("Name: #{subject_config[:name]}")
|
38
|
+
expect(subject).to receive(:puts).with("k8s Version: #{subject_config[:version]}")
|
39
|
+
expect(subject).to receive(:puts).with("Maintenance Window: #{maintenance_window}")
|
40
|
+
expect(subject).to receive(:puts).with("State: #{cluster.metadata.state}")
|
41
|
+
expect(subject).to receive(:puts).with("Api Subnet Allow List: #{cluster.properties.api_subnet_allow_list + ['1.1.1.1']}")
|
42
|
+
expect(subject).to receive(:puts).with("S3 Buckets: #{s3_buckets}")
|
43
|
+
expect(subject).to receive(:puts).with("Available Upgrade Versions: #{cluster.properties.available_upgrade_versions}")
|
44
|
+
expect(subject).to receive(:puts).with("Viable NodePool Versions: #{cluster.properties.viable_node_pool_versions}")
|
45
|
+
|
46
|
+
cluster.properties.name = subject_config[:name]
|
47
|
+
cluster.properties.k8s_version = subject_config[:version]
|
48
|
+
cluster.properties.maintenance_window.day_of_the_week = subject_config[:maintenance_day]
|
49
|
+
cluster.properties.maintenance_window.time = subject_config[:maintenance_time]
|
50
|
+
cluster.properties.api_subnet_allow_list = subject_config[:api_subnet_allow_list].split(',')
|
51
|
+
cluster.properties.s3_buckets = subject_config[:s3_buckets].split(',').map { |el| Ionoscloud::S3Bucket.new(name: el) }
|
52
|
+
|
53
|
+
expected_body = {
|
54
|
+
name: subject_config[:name],
|
55
|
+
k8sVersion: subject_config[:version],
|
56
|
+
maintenanceWindow: {
|
57
|
+
dayOfTheWeek: subject_config[:maintenance_day],
|
58
|
+
time: subject_config[:maintenance_time],
|
59
|
+
},
|
60
|
+
apiSubnetAllowList: subject_config[:api_subnet_allow_list].split(','),
|
61
|
+
s3Buckets: subject_config[:s3_buckets].split(',').map { |el| { name: el } },
|
62
|
+
}
|
63
|
+
|
64
|
+
expect(subject.api_client).not_to receive(:wait_for)
|
65
|
+
mock_call_api(
|
66
|
+
subject,
|
67
|
+
[
|
68
|
+
{
|
69
|
+
method: 'GET',
|
70
|
+
path: "/k8s/#{cluster.id}",
|
71
|
+
operation: :'KubernetesApi.k8s_find_by_cluster_id',
|
72
|
+
return_type: 'KubernetesCluster',
|
73
|
+
result: cluster,
|
74
|
+
},
|
75
|
+
{
|
76
|
+
method: 'PUT',
|
77
|
+
path: "/k8s/#{cluster.id}",
|
78
|
+
operation: :'KubernetesApi.k8s_put',
|
79
|
+
return_type: 'KubernetesCluster',
|
80
|
+
body: { properties: expected_body },
|
81
|
+
result: cluster,
|
82
|
+
},
|
83
|
+
{
|
84
|
+
method: 'GET',
|
85
|
+
path: "/k8s/#{cluster.id}",
|
86
|
+
operation: :'KubernetesApi.k8s_find_by_cluster_id',
|
87
|
+
return_type: 'KubernetesCluster',
|
88
|
+
result: cluster,
|
89
|
+
},
|
90
|
+
],
|
91
|
+
)
|
92
|
+
|
93
|
+
expect { subject.run }.not_to raise_error(Exception)
|
94
|
+
end
|
95
|
+
|
96
|
+
it 'should not make any call if any required option is missing' do
|
97
|
+
required_options = subject.instance_variable_get(:@required_options)
|
98
|
+
|
99
|
+
arrays_without_one_element(required_options).each do |test_case|
|
100
|
+
|
101
|
+
test_case[:array].each { |value| subject.config[value] = 'test' }
|
102
|
+
|
103
|
+
expect(subject).to receive(:puts).with("Missing required parameters #{test_case[:removed]}")
|
104
|
+
expect(subject.api_client).not_to receive(:call_api)
|
105
|
+
|
106
|
+
expect { subject.run }.to raise_error(SystemExit) do |error|
|
107
|
+
expect(error.status).to eq(1)
|
108
|
+
end
|
109
|
+
|
110
|
+
required_options.each { |value| subject.config[value] = nil }
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
@@ -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',
|
@@ -29,6 +29,7 @@ describe Chef::Knife::IonoscloudLanCreate do
|
|
29
29
|
expect(subject).to receive(:puts).with("Name: #{lan.properties.name}")
|
30
30
|
expect(subject).to receive(:puts).with("Public: #{lan.properties.public.to_s}")
|
31
31
|
expect(subject).to receive(:puts).with("PCC: #{lan.properties.pcc}")
|
32
|
+
expect(subject).to receive(:puts).with("IP Failover: #{[]}")
|
32
33
|
|
33
34
|
expected_body = lan.properties.to_hash
|
34
35
|
expected_body.delete(:ipFailover)
|
@@ -40,7 +41,7 @@ describe Chef::Knife::IonoscloudLanCreate do
|
|
40
41
|
{
|
41
42
|
method: 'POST',
|
42
43
|
path: "/datacenters/#{subject_config[:datacenter_id]}/lans",
|
43
|
-
operation: :'
|
44
|
+
operation: :'LansApi.datacenters_lans_post',
|
44
45
|
return_type: 'LanPost',
|
45
46
|
body: { properties: expected_body },
|
46
47
|
result: lan,
|
@@ -48,7 +49,7 @@ describe Chef::Knife::IonoscloudLanCreate do
|
|
48
49
|
{
|
49
50
|
method: 'GET',
|
50
51
|
path: "/datacenters/#{subject_config[:datacenter_id]}/lans/#{lan.id}",
|
51
|
-
operation: :'
|
52
|
+
operation: :'LansApi.datacenters_lans_find_by_id',
|
52
53
|
return_type: 'Lan',
|
53
54
|
result: lan,
|
54
55
|
},
|