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,47 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudTemplateList < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud template list'
|
9
|
+
|
10
|
+
attr_reader :description, :required_options
|
11
|
+
|
12
|
+
def initialize(args = [])
|
13
|
+
super(args)
|
14
|
+
@description =
|
15
|
+
'Retrieve a list of available templates. Templates can be used on specific server types only (CUBE at the moment)'
|
16
|
+
@required_options = [:ionoscloud_username, :ionoscloud_password]
|
17
|
+
end
|
18
|
+
|
19
|
+
def run
|
20
|
+
$stdout.sync = true
|
21
|
+
handle_extra_config
|
22
|
+
validate_required_params(@required_options, config)
|
23
|
+
|
24
|
+
template_list = [
|
25
|
+
ui.color('ID', :bold),
|
26
|
+
ui.color('Name', :bold),
|
27
|
+
ui.color('Cores', :bold),
|
28
|
+
ui.color('RAM', :bold),
|
29
|
+
ui.color('Storage Size', :bold),
|
30
|
+
]
|
31
|
+
templates_api = Ionoscloud::TemplatesApi.new(api_client)
|
32
|
+
|
33
|
+
templates_api.templates_get({ depth: 1 }).items.sort do |a, b|
|
34
|
+
a.properties.cores != b.properties.cores ? a.properties.cores <=> b.properties.cores : a.properties.ram <=> b.properties.ram
|
35
|
+
end.each do |template|
|
36
|
+
template_list << template.id
|
37
|
+
template_list << template.properties.name
|
38
|
+
template_list << Integer(template.properties.cores)
|
39
|
+
template_list << Integer(template.properties.ram)
|
40
|
+
template_list << Integer(template.properties.storage_size)
|
41
|
+
end
|
42
|
+
|
43
|
+
puts ui.list(template_list, :uneven_columns_across, 5)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -70,14 +70,7 @@ class Chef
|
|
70
70
|
dot = ui.color('.', :magenta)
|
71
71
|
api_client.wait_for { print dot; is_done? get_request_id headers }
|
72
72
|
|
73
|
-
|
74
|
-
puts "#{ui.color('ID', :cyan)}: #{user.id}"
|
75
|
-
puts "#{ui.color('Firstname', :cyan)}: #{user.properties.firstname}"
|
76
|
-
puts "#{ui.color('Lastname', :cyan)}: #{user.properties.lastname}"
|
77
|
-
puts "#{ui.color('Email', :cyan)}: #{user.properties.email}"
|
78
|
-
puts "#{ui.color('Administrator', :cyan)}: #{user.properties.administrator.to_s}"
|
79
|
-
puts "#{ui.color('2-Factor Auth', :cyan)}: #{user.properties.force_sec_auth.to_s}"
|
80
|
-
puts 'done'
|
73
|
+
print_user(user)
|
81
74
|
end
|
82
75
|
end
|
83
76
|
end
|
@@ -34,12 +34,7 @@ class Chef
|
|
34
34
|
next
|
35
35
|
end
|
36
36
|
|
37
|
-
|
38
|
-
msg_pair('Firstname', user.properties.firstname)
|
39
|
-
msg_pair('Lastname', user.properties.lastname)
|
40
|
-
msg_pair('Email', user.properties.email)
|
41
|
-
msg_pair('Administrator', user.properties.administrator.to_s)
|
42
|
-
msg_pair('2-Factor Auth', user.properties.force_sec_auth.to_s)
|
37
|
+
print_user(user)
|
43
38
|
puts "\n"
|
44
39
|
|
45
40
|
begin
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudUserGet < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud user get (options)'
|
9
|
+
|
10
|
+
option :user_id,
|
11
|
+
short: '-U USER_ID',
|
12
|
+
long: '--user-id USER_ID',
|
13
|
+
description: 'ID of the group.'
|
14
|
+
|
15
|
+
attr_reader :description, :required_options
|
16
|
+
|
17
|
+
def initialize(args = [])
|
18
|
+
super(args)
|
19
|
+
@description =
|
20
|
+
'Retrieves the attributes of a given Ionoscloud User.'
|
21
|
+
@required_options = [:user_id, :ionoscloud_username, :ionoscloud_password]
|
22
|
+
end
|
23
|
+
|
24
|
+
def run
|
25
|
+
$stdout.sync = true
|
26
|
+
handle_extra_config
|
27
|
+
validate_required_params(@required_options, config)
|
28
|
+
print_user(Ionoscloud::UserManagementApi.new(api_client).um_users_find_by_id(config[:user_id]))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -27,7 +27,7 @@ class Chef
|
|
27
27
|
validate_required_params(@required_options, config)
|
28
28
|
|
29
29
|
begin
|
30
|
-
puts Ionoscloud::
|
30
|
+
puts Ionoscloud::UserS3KeysApi.new(api_client).um_users_s3ssourl_get(config[:user_id]).sso_url
|
31
31
|
rescue Ionoscloud::ApiError => err
|
32
32
|
raise err unless err.code == 404
|
33
33
|
ui.error("User ID #{config[:user_id]} not found.")
|
@@ -0,0 +1,92 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudUserUpdate < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud user update (options)'
|
9
|
+
|
10
|
+
option :user_id,
|
11
|
+
short: '-U USER_ID',
|
12
|
+
long: '--user-id USER_ID',
|
13
|
+
description: 'ID of the User.'
|
14
|
+
|
15
|
+
option :firstname,
|
16
|
+
short: '-f FIRSTNAME',
|
17
|
+
long: '--firstname FIRSTNAME',
|
18
|
+
description: 'Firstname of the user.'
|
19
|
+
|
20
|
+
option :lastname,
|
21
|
+
short: '-l LASTNAME',
|
22
|
+
long: '--lastname LASTNAME',
|
23
|
+
description: 'Lastname of the user.'
|
24
|
+
|
25
|
+
option :email,
|
26
|
+
long: '--email EMAIL',
|
27
|
+
description: 'An e-mail address for the user.'
|
28
|
+
|
29
|
+
option :administrator,
|
30
|
+
short: '-a ADMIN',
|
31
|
+
long: '--admin ADMIN',
|
32
|
+
description: 'Assigns the user have administrative rights.'
|
33
|
+
|
34
|
+
option :force_sec_auth,
|
35
|
+
long: '--sec-auth FORCE_SEC_AUTH',
|
36
|
+
description: 'Indicates if secure (two-factor) authentication should be forced for the user.'
|
37
|
+
|
38
|
+
option :sec_auth_active,
|
39
|
+
long: '--sec-auth SEC_AUTH_ACTIVE',
|
40
|
+
description: 'Indicates if secure authentication is active for the user or not.'
|
41
|
+
|
42
|
+
option :active,
|
43
|
+
long: '--active ACTIVE',
|
44
|
+
description: 'Indicates if the user is active.'
|
45
|
+
|
46
|
+
attr_reader :description, :required_options
|
47
|
+
|
48
|
+
def initialize(args = [])
|
49
|
+
super(args)
|
50
|
+
@description =
|
51
|
+
'Updates information about a Ionoscloud User.'
|
52
|
+
@required_options = [:user_id, :ionoscloud_username, :ionoscloud_password]
|
53
|
+
@updatable_fields = [:firstname, :lastname, :email, :administrator, :force_sec_auth, :sec_auth_active, :active]
|
54
|
+
end
|
55
|
+
|
56
|
+
def run
|
57
|
+
$stdout.sync = true
|
58
|
+
handle_extra_config
|
59
|
+
validate_required_params(@required_options, config)
|
60
|
+
|
61
|
+
user_management_api = Ionoscloud::UserManagementApi.new(api_client)
|
62
|
+
|
63
|
+
if @updatable_fields.map { |el| config[el] }.any?
|
64
|
+
print "#{ui.color('Updating User...', :magenta)}"
|
65
|
+
|
66
|
+
user = user_management_api.um_users_find_by_id(config[:user_id])
|
67
|
+
|
68
|
+
new_user = Ionoscloud::UserPut.new(
|
69
|
+
properties: Ionoscloud::UserPropertiesPut.new(
|
70
|
+
firstname: config[:firstname] || user.properties.firstname,
|
71
|
+
lastname: config[:lastname] || user.properties.lastname,
|
72
|
+
email: config[:email] || user.properties.email,
|
73
|
+
administrator: (config.key?(:administrator) ? config[:administrator].to_s.downcase == 'true' : user.properties.administrator),
|
74
|
+
force_sec_auth: (config.key?(:force_sec_auth) ? config[:force_sec_auth].to_s.downcase == 'true' : user.properties.force_sec_auth),
|
75
|
+
sec_auth_active: (config.key?(:sec_auth_active) ? config[:sec_auth_active].to_s.downcase == 'true' : user.properties.sec_auth_active),
|
76
|
+
active: (config.key?(:active) ? config[:active].to_s.downcase == 'true' : user.properties.active),
|
77
|
+
),
|
78
|
+
)
|
79
|
+
|
80
|
+
_, _, headers = user_management_api.um_users_put_with_http_info(config[:user_id], new_user)
|
81
|
+
|
82
|
+
dot = ui.color('.', :magenta)
|
83
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
84
|
+
else
|
85
|
+
ui.warn("Nothing to update, please set one of the attributes #{@updatable_fields}.")
|
86
|
+
end
|
87
|
+
|
88
|
+
print_user(user_management_api.um_users_find_by_id(config[:user_id]))
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -32,10 +32,6 @@ class Chef
|
|
32
32
|
long: '--image ID',
|
33
33
|
description: 'The image or snapshot ID'
|
34
34
|
|
35
|
-
option :image_alias,
|
36
|
-
long: '--image-alias IMAGE_ALIAS',
|
37
|
-
description: '(required) The image alias'
|
38
|
-
|
39
35
|
option :image_password,
|
40
36
|
short: '-P PASSWORD',
|
41
37
|
long: '--image-password PASSWORD',
|
@@ -44,7 +40,7 @@ class Chef
|
|
44
40
|
option :type,
|
45
41
|
short: '-t TYPE',
|
46
42
|
long: '--type TYPE',
|
47
|
-
description: 'The disk type (HDD
|
43
|
+
description: 'The disk type (HDD, SSD, SSD Standard, SSD Premium, DAS)'
|
48
44
|
|
49
45
|
option :licence_type,
|
50
46
|
short: '-l LICENCE',
|
@@ -94,43 +90,31 @@ class Chef
|
|
94
90
|
|
95
91
|
print "#{ui.color('Creating volume...', :magenta)}"
|
96
92
|
|
97
|
-
volume_api = Ionoscloud::
|
93
|
+
volume_api = Ionoscloud::VolumesApi.new(api_client)
|
94
|
+
|
95
|
+
volume_properties = {
|
96
|
+
name: config[:name],
|
97
|
+
size: config[:size],
|
98
|
+
bus: config[:bus] || 'VIRTIO',
|
99
|
+
type: config[:type],
|
100
|
+
licence_type: config[:licence_type],
|
101
|
+
image: config[:image],
|
102
|
+
ssh_keys: config[:ssh_keys],
|
103
|
+
image_password: config[:image_password],
|
104
|
+
availability_zone: config[:availability_zone],
|
105
|
+
backupunit_id: config[:backupunit_id],
|
106
|
+
user_data: config[:user_data],
|
107
|
+
}.compact
|
98
108
|
|
99
109
|
volume, _, headers = volume_api.datacenters_volumes_post_with_http_info(
|
100
110
|
config[:datacenter_id],
|
101
|
-
|
102
|
-
properties: {
|
103
|
-
name: config[:name],
|
104
|
-
size: config[:size],
|
105
|
-
bus: config[:bus] || 'VIRTIO',
|
106
|
-
type: config[:type],
|
107
|
-
licenceType: config[:licence_type],
|
108
|
-
image: config[:image],
|
109
|
-
imageAlias: config[:image_alias],
|
110
|
-
sshKeys: config[:sshKeys],
|
111
|
-
imagePassword: config[:image_password],
|
112
|
-
availabilityZone: config[:availability_zone],
|
113
|
-
backupunit_id: config[:backupunit_id],
|
114
|
-
user_data: config[:user_data],
|
115
|
-
}.compact
|
116
|
-
},
|
111
|
+
Ionoscloud::Volume.new(properties: Ionoscloud::VolumeProperties.new(**volume_properties)),
|
117
112
|
)
|
118
113
|
|
119
114
|
dot = ui.color('.', :magenta)
|
120
115
|
api_client.wait_for(300) { print dot; is_done? get_request_id headers }
|
121
116
|
|
122
|
-
|
123
|
-
|
124
|
-
puts "\n"
|
125
|
-
puts "#{ui.color('ID', :cyan)}: #{volume.id}"
|
126
|
-
puts "#{ui.color('Name', :cyan)}: #{volume.properties.name}"
|
127
|
-
puts "#{ui.color('Size', :cyan)}: #{volume.properties.size}"
|
128
|
-
puts "#{ui.color('Bus', :cyan)}: #{volume.properties.bus}"
|
129
|
-
puts "#{ui.color('Image', :cyan)}: #{volume.properties.image}"
|
130
|
-
puts "#{ui.color('Type', :cyan)}: #{volume.properties.type}"
|
131
|
-
puts "#{ui.color('Licence Type', :cyan)}: #{volume.properties.licence_type}"
|
132
|
-
puts "#{ui.color('Zone', :cyan)}: #{volume.properties.availability_zone}"
|
133
|
-
puts 'done'
|
117
|
+
print_volume(volume_api.datacenters_volumes_find_by_id(config[:datacenter_id], volume.id))
|
134
118
|
end
|
135
119
|
end
|
136
120
|
end
|
@@ -27,7 +27,7 @@ class Chef
|
|
27
27
|
handle_extra_config
|
28
28
|
validate_required_params(@required_options, config)
|
29
29
|
|
30
|
-
volume_api = Ionoscloud::
|
30
|
+
volume_api = Ionoscloud::VolumesApi.new(api_client)
|
31
31
|
|
32
32
|
@name_args.each do |volume_id|
|
33
33
|
begin
|
@@ -41,14 +41,8 @@ class Chef
|
|
41
41
|
next
|
42
42
|
end
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
msg_pair('Size', volume.properties.size)
|
47
|
-
msg_pair('Bus', volume.properties.bus)
|
48
|
-
msg_pair('Image', volume.properties.image)
|
49
|
-
msg_pair('Type', volume.properties.type)
|
50
|
-
msg_pair('Licence Type', volume.properties.licence_type)
|
51
|
-
msg_pair('Zone', volume.properties.availability_zone)
|
44
|
+
print_volume(volume)
|
45
|
+
puts "\n"
|
52
46
|
|
53
47
|
begin
|
54
48
|
confirm('Do you really want to delete this volume')
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudVolumeGet < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud volume get (options)'
|
9
|
+
|
10
|
+
option :datacenter_id,
|
11
|
+
short: '-D DATACENTER_ID',
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
13
|
+
description: 'ID of the data center'
|
14
|
+
|
15
|
+
option :volume_id,
|
16
|
+
long: '--volume VOLUME_ID',
|
17
|
+
description: 'ID of the volume.'
|
18
|
+
|
19
|
+
attr_reader :description, :required_options
|
20
|
+
|
21
|
+
def initialize(args = [])
|
22
|
+
super(args)
|
23
|
+
@description =
|
24
|
+
'Retrieves the attributes of a given Volume.'
|
25
|
+
@required_options = [:datacenter_id, :volume_id, :ionoscloud_username, :ionoscloud_password]
|
26
|
+
end
|
27
|
+
|
28
|
+
def run
|
29
|
+
$stdout.sync = true
|
30
|
+
handle_extra_config
|
31
|
+
validate_required_params(@required_options, config)
|
32
|
+
print_volume(Ionoscloud::VolumesApi.new(api_client).datacenters_volumes_find_by_id(config[:datacenter_id], config[:volume_id]))
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -46,10 +46,10 @@ class Chef
|
|
46
46
|
opts = { depth: 1 }
|
47
47
|
|
48
48
|
if config[:server_id]
|
49
|
-
server_api = Ionoscloud::
|
49
|
+
server_api = Ionoscloud::ServersApi.new(api_client)
|
50
50
|
volumes = server_api.datacenters_servers_volumes_get(config[:datacenter_id], config[:server_id], opts)
|
51
51
|
else
|
52
|
-
volume_api = Ionoscloud::
|
52
|
+
volume_api = Ionoscloud::VolumesApi.new(api_client)
|
53
53
|
volumes = volume_api.datacenters_volumes_get(config[:datacenter_id], opts)
|
54
54
|
end
|
55
55
|
|
@@ -0,0 +1,106 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudVolumeUpdate < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud volume update (options)'
|
9
|
+
|
10
|
+
option :datacenter_id,
|
11
|
+
short: '-D DATACENTER_ID',
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
13
|
+
description: 'Name of the data center'
|
14
|
+
|
15
|
+
option :volume_id,
|
16
|
+
long: '--volume VOLUME_ID',
|
17
|
+
description: 'ID of the Volume.'
|
18
|
+
|
19
|
+
option :name,
|
20
|
+
short: '-n NAME',
|
21
|
+
long: '--name NAME',
|
22
|
+
description: 'Name of the volume'
|
23
|
+
|
24
|
+
option :size,
|
25
|
+
short: '-S SIZE',
|
26
|
+
long: '--size SIZE',
|
27
|
+
description: 'The size of the volume in GB'
|
28
|
+
|
29
|
+
option :bus,
|
30
|
+
short: '-b BUS',
|
31
|
+
long: '--bus BUS',
|
32
|
+
description: 'The bus type of the volume (VIRTIO or IDE)'
|
33
|
+
|
34
|
+
option :cpu_hot_plug,
|
35
|
+
long: '--cpu-hot-plug CPU_HOT_PLUG',
|
36
|
+
description: 'The licence type of the volume (LINUX, WINDOWS, UNKNOWN, OTHER)'
|
37
|
+
|
38
|
+
option :ram_hot_plug,
|
39
|
+
long: '--ram-hot-plug RAM_HOT_PLUG',
|
40
|
+
description: 'The licence type of the volume (LINUX, WINDOWS, UNKNOWN, OTHER)'
|
41
|
+
|
42
|
+
option :nic_hot_plug,
|
43
|
+
long: '--nic-hot-plug NIC_HOT_PLUG',
|
44
|
+
description: 'The licence type of the volume (LINUX, WINDOWS, UNKNOWN, OTHER)'
|
45
|
+
|
46
|
+
option :nic_hot_unplug,
|
47
|
+
long: '--nic-hot-unplug NIC_HOT_UNPLUG',
|
48
|
+
description: 'The licence type of the volume (LINUX, WINDOWS, UNKNOWN, OTHER)'
|
49
|
+
|
50
|
+
option :disc_virtio_hot_plug,
|
51
|
+
long: '--disc-virtio-hot_plug DISC_VIRTIO_HOT_PLUG',
|
52
|
+
description: 'The licence type of the volume (LINUX, WINDOWS, UNKNOWN, OTHER)'
|
53
|
+
|
54
|
+
option :disc_virtio_hot_unplug,
|
55
|
+
long: '--disc-virtio-hot_unplug DISC_VIRTIO_HOT_UNPLUG',
|
56
|
+
description: 'The licence type of the volume (LINUX, WINDOWS, UNKNOWN, OTHER)'
|
57
|
+
|
58
|
+
attr_reader :description, :required_options
|
59
|
+
|
60
|
+
def initialize(args = [])
|
61
|
+
super(args)
|
62
|
+
@description =
|
63
|
+
'Updates information about a Ionoscloud Volume.'
|
64
|
+
@required_options = [:datacenter_id, :volume_id, :ionoscloud_username, :ionoscloud_password]
|
65
|
+
@updatable_fields = [
|
66
|
+
:name, :size, :bus, :cpu_hot_plug, :ram_hot_plug, :nic_hot_plug, :nic_hot_unplug, :disc_virtio_hot_plug, :disc_virtio_hot_unplug,
|
67
|
+
]
|
68
|
+
end
|
69
|
+
|
70
|
+
def run
|
71
|
+
$stdout.sync = true
|
72
|
+
handle_extra_config
|
73
|
+
validate_required_params(@required_options, config)
|
74
|
+
|
75
|
+
volume_api = Ionoscloud::VolumesApi.new(api_client)
|
76
|
+
|
77
|
+
if @updatable_fields.map { |el| config[el] }.any?
|
78
|
+
print "#{ui.color('Updating Volume...', :magenta)}"
|
79
|
+
|
80
|
+
_, _, headers = volume_api.datacenters_volumes_patch_with_http_info(
|
81
|
+
config[:datacenter_id],
|
82
|
+
config[:volume_id],
|
83
|
+
Ionoscloud::VolumeProperties.new(
|
84
|
+
name: config[:name],
|
85
|
+
size: config[:size],
|
86
|
+
bus: config[:bus],
|
87
|
+
cpu_hot_plug: (config.key?(:cpu_hot_plug) ? config[:cpu_hot_plug].to_s.downcase == 'true' : nil),
|
88
|
+
ram_hot_plug: (config.key?(:ram_hot_plug) ? config[:ram_hot_plug].to_s.downcase == 'true' : nil),
|
89
|
+
nic_hot_plug: (config.key?(:nic_hot_plug) ? config[:nic_hot_plug].to_s.downcase == 'true' : nil),
|
90
|
+
nic_hot_unplug: (config.key?(:nic_hot_unplug) ? config[:nic_hot_unplug].to_s.downcase == 'true' : nil),
|
91
|
+
disc_virtio_hot_plug: (config.key?(:disc_virtio_hot_plug) ? config[:disc_virtio_hot_plug].to_s.downcase == 'true' : nil),
|
92
|
+
disc_virtio_hot_unplug: (config.key?(:disc_virtio_hot_unplug) ? config[:disc_virtio_hot_unplug].to_s.downcase == 'true' : nil),
|
93
|
+
),
|
94
|
+
)
|
95
|
+
|
96
|
+
dot = ui.color('.', :magenta)
|
97
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
98
|
+
else
|
99
|
+
ui.warn("Nothing to update, please set one of the attributes #{@updatable_fields}.")
|
100
|
+
end
|
101
|
+
|
102
|
+
print_volume(volume_api.datacenters_volumes_find_by_id(config[:datacenter_id], config[:volume_id]))
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
@@ -12,7 +12,7 @@ describe Chef::Knife::IonoscloudBackupunitCreate do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
describe '#run' do
|
15
|
-
it 'should call
|
15
|
+
it 'should call BackupUnitsApi.backupunits_post with the expected arguments and output based on what it receives' do
|
16
16
|
backupunit = backupunit_mock
|
17
17
|
subject_config = {
|
18
18
|
ionoscloud_username: 'email',
|
@@ -33,7 +33,7 @@ describe Chef::Knife::IonoscloudBackupunitCreate do
|
|
33
33
|
{
|
34
34
|
method: 'POST',
|
35
35
|
path: '/backupunits',
|
36
|
-
operation: :'
|
36
|
+
operation: :'BackupUnitsApi.backupunits_post',
|
37
37
|
return_type: 'BackupUnit',
|
38
38
|
body: { properties: backupunit.properties.to_hash },
|
39
39
|
result: backupunit,
|
@@ -12,7 +12,7 @@ describe Chef::Knife::IonoscloudBackupunitDelete do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
describe '#run' do
|
15
|
-
it 'should call
|
15
|
+
it 'should call BackupUnitsApi.backupunits_delete when the ID is valid' do
|
16
16
|
backupunit = backupunit_mock
|
17
17
|
subject_config = {
|
18
18
|
ionoscloud_username: 'email',
|
@@ -36,14 +36,14 @@ describe Chef::Knife::IonoscloudBackupunitDelete do
|
|
36
36
|
{
|
37
37
|
method: 'GET',
|
38
38
|
path: "/backupunits/#{backupunit.id}",
|
39
|
-
operation: :'
|
39
|
+
operation: :'BackupUnitsApi.backupunits_find_by_id',
|
40
40
|
return_type: 'BackupUnit',
|
41
41
|
result: backupunit,
|
42
42
|
},
|
43
43
|
{
|
44
44
|
method: 'DELETE',
|
45
45
|
path: "/backupunits/#{backupunit.id}",
|
46
|
-
operation: :'
|
46
|
+
operation: :'BackupUnitsApi.backupunits_delete',
|
47
47
|
},
|
48
48
|
],
|
49
49
|
)
|
@@ -51,7 +51,7 @@ describe Chef::Knife::IonoscloudBackupunitDelete do
|
|
51
51
|
expect { subject.run }.not_to raise_error(Exception)
|
52
52
|
end
|
53
53
|
|
54
|
-
it 'should not call
|
54
|
+
it 'should not call BackupUnitsApi.backupunits_delete when the ID is not valid' do
|
55
55
|
backup_unit = 'invalid_id'
|
56
56
|
subject_config = {
|
57
57
|
ionoscloud_username: 'email',
|
@@ -70,7 +70,7 @@ describe Chef::Knife::IonoscloudBackupunitDelete do
|
|
70
70
|
{
|
71
71
|
method: 'GET',
|
72
72
|
path: "/backupunits/#{backup_unit}",
|
73
|
-
operation: :'
|
73
|
+
operation: :'BackupUnitsApi.backupunits_find_by_id',
|
74
74
|
return_type: 'BackupUnit',
|
75
75
|
exception: Ionoscloud::ApiError.new(code: 404),
|
76
76
|
},
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ionoscloud_backupunit_get'
|
3
|
+
|
4
|
+
Chef::Knife::IonoscloudBackupunitGet.load_deps
|
5
|
+
|
6
|
+
describe Chef::Knife::IonoscloudBackupunitGet do
|
7
|
+
before :each do
|
8
|
+
subject { Chef::Knife::IonoscloudBackupunitGet.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 BackupUnitsApi.backupunits_find_by_id' do
|
16
|
+
backupunit = backupunit_mock
|
17
|
+
subject_config = {
|
18
|
+
ionoscloud_username: 'email',
|
19
|
+
ionoscloud_password: 'password',
|
20
|
+
backupunit_id: backupunit.id,
|
21
|
+
yes: true,
|
22
|
+
}
|
23
|
+
|
24
|
+
subject_config.each { |key, value| subject.config[key] = value }
|
25
|
+
|
26
|
+
expect(subject).to receive(:puts).with("ID: #{backupunit.id}")
|
27
|
+
expect(subject).to receive(:puts).with("Name: #{backupunit.properties.name}")
|
28
|
+
expect(subject).to receive(:puts).with("Email: #{backupunit.properties.email}")
|
29
|
+
|
30
|
+
expect(subject.api_client).not_to receive(:wait_for)
|
31
|
+
mock_call_api(
|
32
|
+
subject,
|
33
|
+
[
|
34
|
+
{
|
35
|
+
method: 'GET',
|
36
|
+
path: "/backupunits/#{backupunit.id}",
|
37
|
+
operation: :'BackupUnitsApi.backupunits_find_by_id',
|
38
|
+
return_type: 'BackupUnit',
|
39
|
+
result: backupunit,
|
40
|
+
},
|
41
|
+
],
|
42
|
+
)
|
43
|
+
|
44
|
+
expect { subject.run }.not_to raise_error(Exception)
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'should not make any call if any required option is missing' do
|
48
|
+
required_options = subject.instance_variable_get(:@required_options)
|
49
|
+
|
50
|
+
arrays_without_one_element(required_options).each do |test_case|
|
51
|
+
|
52
|
+
test_case[:array].each { |value| subject.config[value] = 'test' }
|
53
|
+
|
54
|
+
expect(subject).to receive(:puts).with("Missing required parameters #{test_case[:removed]}")
|
55
|
+
expect(subject.api_client).not_to receive(:call_api)
|
56
|
+
|
57
|
+
expect { subject.run }.to raise_error(SystemExit) do |error|
|
58
|
+
expect(error.status).to eq(1)
|
59
|
+
end
|
60
|
+
|
61
|
+
required_options.each { |value| subject.config[value] = nil }
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|