knife-ionoscloud 5.1.2 → 6.0.0
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 +16 -4
- data/docs/subcommands/backupunit_create.md +6 -3
- data/docs/subcommands/backupunit_delete.md +6 -3
- data/docs/subcommands/backupunit_get.md +6 -3
- data/docs/subcommands/backupunit_list.md +6 -3
- data/docs/subcommands/backupunit_ssourl.md +6 -3
- data/docs/subcommands/backupunit_update.md +6 -3
- data/docs/subcommands/composite_server_create.md +6 -3
- data/docs/subcommands/contract_list.md +6 -3
- data/docs/subcommands/cube_server_create.md +94 -0
- data/docs/subcommands/datacenter_create.md +6 -3
- data/docs/subcommands/datacenter_delete.md +6 -3
- data/docs/subcommands/datacenter_get.md +6 -3
- data/docs/subcommands/datacenter_list.md +6 -3
- data/docs/subcommands/datacenter_update.md +6 -3
- data/docs/subcommands/firewall_create.md +6 -3
- data/docs/subcommands/firewall_delete.md +5 -2
- data/docs/subcommands/firewall_get.md +6 -3
- data/docs/subcommands/firewall_list.md +6 -3
- data/docs/subcommands/firewall_update.md +6 -3
- data/docs/subcommands/flowlog_create.md +66 -0
- data/docs/subcommands/flowlog_delete.md +54 -0
- data/docs/subcommands/flowlog_get.md +58 -0
- data/docs/subcommands/flowlog_list.md +54 -0
- data/docs/subcommands/flowlog_update.md +70 -0
- data/docs/subcommands/group_create.md +6 -3
- data/docs/subcommands/group_delete.md +6 -3
- data/docs/subcommands/group_get.md +6 -3
- data/docs/subcommands/group_list.md +6 -3
- data/docs/subcommands/group_update.md +6 -3
- data/docs/subcommands/group_user_add.md +5 -2
- data/docs/subcommands/group_user_remove.md +5 -2
- data/docs/subcommands/image_list.md +6 -3
- data/docs/subcommands/ipblock_create.md +6 -3
- data/docs/subcommands/ipblock_delete.md +6 -3
- data/docs/subcommands/ipblock_get.md +6 -3
- data/docs/subcommands/ipblock_list.md +6 -3
- data/docs/subcommands/ipblock_update.md +6 -3
- data/docs/subcommands/ipfailover_add.md +6 -3
- data/docs/subcommands/ipfailover_remove.md +6 -3
- data/docs/subcommands/k8s_create.md +6 -6
- data/docs/subcommands/k8s_delete.md +6 -3
- data/docs/subcommands/k8s_get.md +6 -3
- data/docs/subcommands/k8s_list.md +6 -3
- data/docs/subcommands/k8s_update.md +6 -3
- data/docs/subcommands/kubeconfig_get.md +6 -3
- data/docs/subcommands/label_add.md +6 -3
- data/docs/subcommands/label_list.md +6 -3
- data/docs/subcommands/label_remove.md +5 -2
- data/docs/subcommands/lan_create.md +6 -3
- data/docs/subcommands/lan_delete.md +5 -2
- data/docs/subcommands/lan_get.md +6 -3
- data/docs/subcommands/lan_list.md +6 -3
- data/docs/subcommands/lan_update.md +6 -3
- data/docs/subcommands/loadbalancer_create.md +6 -3
- data/docs/subcommands/loadbalancer_delete.md +5 -2
- data/docs/subcommands/loadbalancer_get.md +6 -3
- data/docs/subcommands/loadbalancer_list.md +6 -3
- data/docs/subcommands/loadbalancer_nic_add.md +5 -2
- data/docs/subcommands/loadbalancer_nic_remove.md +5 -2
- data/docs/subcommands/loadbalancer_update.md +6 -3
- data/docs/subcommands/location_list.md +6 -3
- data/docs/subcommands/natgateway_create.md +44 -0
- data/docs/subcommands/natgateway_delete.md +38 -0
- data/docs/subcommands/natgateway_get.md +42 -0
- data/docs/subcommands/natgateway_lan_add.md +49 -0
- data/docs/subcommands/natgateway_lan_remove.md +42 -0
- data/docs/subcommands/natgateway_list.md +38 -0
- data/docs/subcommands/natgateway_rule_add.md +69 -0
- data/docs/subcommands/natgateway_rule_list.md +41 -0
- data/docs/subcommands/natgateway_rule_remove.md +42 -0
- data/docs/subcommands/natgateway_rule_update.md +69 -0
- data/docs/subcommands/natgateway_update.md +51 -0
- data/docs/subcommands/networkloadbalancer_create.md +57 -0
- data/docs/subcommands/networkloadbalancer_delete.md +38 -0
- data/docs/subcommands/networkloadbalancer_get.md +42 -0
- data/docs/subcommands/networkloadbalancer_list.md +38 -0
- data/docs/subcommands/networkloadbalancer_rule_add.md +75 -0
- data/docs/subcommands/networkloadbalancer_rule_list.md +42 -0
- data/docs/subcommands/networkloadbalancer_rule_remove.md +42 -0
- data/docs/subcommands/networkloadbalancer_rule_target_add.md +67 -0
- data/docs/subcommands/networkloadbalancer_rule_target_list.md +46 -0
- data/docs/subcommands/networkloadbalancer_rule_target_remove.md +54 -0
- data/docs/subcommands/networkloadbalancer_rule_update.md +75 -0
- data/docs/subcommands/networkloadbalancer_update.md +57 -0
- data/docs/subcommands/nic_create.md +6 -3
- data/docs/subcommands/nic_delete.md +5 -2
- data/docs/subcommands/nic_get.md +6 -3
- data/docs/subcommands/nic_list.md +6 -3
- data/docs/subcommands/nic_update.md +6 -3
- data/docs/subcommands/node_delete.md +5 -2
- data/docs/subcommands/node_get.md +6 -3
- data/docs/subcommands/node_list.md +6 -3
- data/docs/subcommands/node_replace.md +5 -2
- data/docs/subcommands/nodepool_create.md +6 -3
- data/docs/subcommands/nodepool_delete.md +5 -2
- data/docs/subcommands/nodepool_get.md +6 -3
- data/docs/subcommands/nodepool_lan_add.md +52 -0
- data/docs/subcommands/nodepool_lan_remove.md +42 -0
- data/docs/subcommands/nodepool_list.md +6 -3
- data/docs/subcommands/nodepool_update.md +6 -3
- data/docs/subcommands/pcc_create.md +6 -3
- data/docs/subcommands/pcc_delete.md +6 -3
- data/docs/subcommands/pcc_get.md +6 -3
- data/docs/subcommands/pcc_list.md +6 -3
- data/docs/subcommands/pcc_update.md +6 -3
- data/docs/subcommands/request_get.md +6 -3
- data/docs/subcommands/request_list.md +6 -3
- data/docs/subcommands/request_status.md +6 -3
- data/docs/subcommands/request_wait.md +6 -3
- data/docs/subcommands/resource_list.md +6 -3
- data/docs/subcommands/s3key_create.md +6 -3
- data/docs/subcommands/s3key_delete.md +5 -2
- data/docs/subcommands/s3key_get.md +6 -3
- data/docs/subcommands/s3key_list.md +6 -3
- data/docs/subcommands/server_console.md +42 -0
- data/docs/subcommands/server_create.md +6 -3
- data/docs/subcommands/server_delete.md +5 -2
- data/docs/subcommands/server_get.md +6 -3
- data/docs/subcommands/server_list.md +6 -3
- data/docs/subcommands/server_reboot.md +5 -2
- data/docs/subcommands/server_resume.md +38 -0
- data/docs/subcommands/server_start.md +5 -2
- data/docs/subcommands/server_stop.md +5 -2
- data/docs/subcommands/server_suspend.md +38 -0
- data/docs/subcommands/server_token.md +42 -0
- data/docs/subcommands/server_update.md +6 -3
- data/docs/subcommands/server_upgrade.md +42 -0
- data/docs/subcommands/share_create.md +6 -3
- data/docs/subcommands/share_delete.md +5 -2
- data/docs/subcommands/share_get.md +6 -3
- data/docs/subcommands/share_list.md +6 -3
- data/docs/subcommands/share_update.md +6 -3
- data/docs/subcommands/snapshot_create.md +6 -3
- data/docs/subcommands/snapshot_delete.md +6 -3
- data/docs/subcommands/snapshot_get.md +6 -3
- data/docs/subcommands/snapshot_list.md +6 -3
- data/docs/subcommands/snapshot_restore.md +6 -3
- data/docs/subcommands/snapshot_update.md +16 -13
- data/docs/subcommands/template_list.md +34 -0
- data/docs/subcommands/user_create.md +6 -3
- data/docs/subcommands/user_delete.md +6 -3
- data/docs/subcommands/user_get.md +6 -3
- data/docs/subcommands/user_list.md +6 -3
- data/docs/subcommands/user_ssourl.md +6 -3
- data/docs/subcommands/user_update.md +6 -3
- data/docs/subcommands/volume_attach.md +5 -2
- data/docs/subcommands/volume_create.md +6 -3
- data/docs/subcommands/volume_delete.md +5 -2
- data/docs/subcommands/volume_detach.md +5 -2
- data/docs/subcommands/volume_get.md +6 -3
- data/docs/subcommands/volume_list.md +6 -3
- data/docs/subcommands/volume_update.md +6 -3
- data/docs/summary.md +37 -0
- data/knife-ionoscloud.gemspec +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_create.rb +2 -1
- data/lib/chef/knife/ionoscloud_backupunit_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_get.rb +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_ssourl.rb +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_update.rb +2 -2
- data/lib/chef/knife/ionoscloud_base.rb +111 -5
- data/lib/chef/knife/ionoscloud_composite_server_create.rb +37 -11
- 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 +2 -2
- data/lib/chef/knife/ionoscloud_datacenter_delete.rb +2 -1
- data/lib/chef/knife/ionoscloud_datacenter_get.rb +1 -1
- data/lib/chef/knife/ionoscloud_datacenter_list.rb +3 -3
- data/lib/chef/knife/ionoscloud_datacenter_update.rb +1 -1
- data/lib/chef/knife/ionoscloud_firewall_create.rb +16 -12
- data/lib/chef/knife/ionoscloud_firewall_delete.rb +3 -3
- data/lib/chef/knife/ionoscloud_firewall_get.rb +5 -3
- data/lib/chef/knife/ionoscloud_firewall_list.rb +5 -3
- data/lib/chef/knife/ionoscloud_firewall_update.rb +7 -6
- data/lib/chef/knife/ionoscloud_flowlog_create.rb +114 -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 +125 -0
- data/lib/chef/knife/ionoscloud_group_create.rb +31 -15
- data/lib/chef/knife/ionoscloud_group_get.rb +1 -3
- data/lib/chef/knife/ionoscloud_group_list.rb +7 -1
- data/lib/chef/knife/ionoscloud_group_update.rb +17 -0
- data/lib/chef/knife/ionoscloud_group_user_add.rb +1 -6
- data/lib/chef/knife/ionoscloud_group_user_remove.rb +1 -6
- data/lib/chef/knife/ionoscloud_image_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_ipblock_delete.rb +0 -1
- data/lib/chef/knife/ionoscloud_ipblock_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_ipfailover_add.rb +15 -8
- data/lib/chef/knife/ionoscloud_ipfailover_remove.rb +9 -2
- data/lib/chef/knife/ionoscloud_k8s_create.rb +13 -18
- data/lib/chef/knife/ionoscloud_label_add.rb +1 -1
- data/lib/chef/knife/ionoscloud_label_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_label_remove.rb +1 -1
- data/lib/chef/knife/ionoscloud_lan_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_lan_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_lan_get.rb +1 -1
- data/lib/chef/knife/ionoscloud_lan_list.rb +3 -4
- data/lib/chef/knife/ionoscloud_lan_update.rb +2 -13
- data/lib/chef/knife/ionoscloud_loadbalancer_create.rb +2 -1
- data/lib/chef/knife/ionoscloud_loadbalancer_delete.rb +2 -1
- data/lib/chef/knife/ionoscloud_loadbalancer_get.rb +5 -5
- data/lib/chef/knife/ionoscloud_loadbalancer_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_add.rb +4 -6
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_remove.rb +4 -7
- data/lib/chef/knife/ionoscloud_loadbalancer_update.rb +1 -1
- 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 +105 -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 +135 -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 +123 -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 +25 -19
- data/lib/chef/knife/ionoscloud_nic_delete.rb +3 -2
- data/lib/chef/knife/ionoscloud_nic_get.rb +7 -5
- data/lib/chef/knife/ionoscloud_nic_list.rb +9 -5
- data/lib/chef/knife/ionoscloud_nic_update.rb +8 -5
- data/lib/chef/knife/ionoscloud_node_delete.rb +6 -1
- data/lib/chef/knife/ionoscloud_node_get.rb +7 -5
- data/lib/chef/knife/ionoscloud_node_list.rb +0 -1
- data/lib/chef/knife/ionoscloud_nodepool_create.rb +12 -21
- data/lib/chef/knife/ionoscloud_nodepool_get.rb +6 -4
- data/lib/chef/knife/ionoscloud_nodepool_lan_add.rb +103 -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_pcc_create.rb +4 -4
- data/lib/chef/knife/ionoscloud_pcc_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_pcc_get.rb +1 -1
- data/lib/chef/knife/ionoscloud_pcc_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_pcc_update.rb +1 -1
- data/lib/chef/knife/ionoscloud_request_get.rb +1 -1
- data/lib/chef/knife/ionoscloud_request_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_request_status.rb +1 -1
- data/lib/chef/knife/ionoscloud_s3key_create.rb +2 -2
- data/lib/chef/knife/ionoscloud_s3key_delete.rb +3 -3
- data/lib/chef/knife/ionoscloud_s3key_get.rb +1 -1
- 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 +5 -7
- data/lib/chef/knife/ionoscloud_server_delete.rb +3 -1
- data/lib/chef/knife/ionoscloud_server_get.rb +8 -6
- 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 +1 -1
- data/lib/chef/knife/ionoscloud_server_upgrade.rb +45 -0
- data/lib/chef/knife/ionoscloud_share_create.rb +1 -0
- data/lib/chef/knife/ionoscloud_share_delete.rb +2 -1
- data/lib/chef/knife/ionoscloud_snapshot_create.rb +2 -2
- data/lib/chef/knife/ionoscloud_snapshot_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_snapshot_get.rb +1 -1
- 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 +1 -1
- data/lib/chef/knife/ionoscloud_template_list.rb +47 -0
- data/lib/chef/knife/ionoscloud_user_create.rb +12 -23
- data/lib/chef/knife/ionoscloud_user_delete.rb +1 -0
- data/lib/chef/knife/ionoscloud_user_ssourl.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_attach.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_create.rb +18 -54
- data/lib/chef/knife/ionoscloud_volume_delete.rb +2 -1
- data/lib/chef/knife/ionoscloud_volume_detach.rb +9 -2
- data/lib/chef/knife/ionoscloud_volume_get.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_volume_update.rb +3 -3
- 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 +2 -2
- 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 +3 -3
- data/spec/chef/knife/ionoscloud_base_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_composite_server_create_spec.rb +11 -8
- data/spec/chef/knife/ionoscloud_contract_list_spec.rb +32 -27
- data/spec/chef/knife/ionoscloud_cube_server_create_spec.rb +249 -0
- data/spec/chef/knife/ionoscloud_datacenter_create_spec.rb +3 -9
- data/spec/chef/knife/ionoscloud_datacenter_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_datacenter_get_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_datacenter_list_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_datacenter_update_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_firewall_create_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_firewall_delete_spec.rb +6 -5
- data/spec/chef/knife/ionoscloud_firewall_get_spec.rb +3 -2
- data/spec/chef/knife/ionoscloud_firewall_list_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_firewall_update_spec.rb +4 -3
- data/spec/chef/knife/ionoscloud_flowlog_create_spec.rb +254 -0
- data/spec/chef/knife/ionoscloud_flowlog_delete_spec.rb +360 -0
- data/spec/chef/knife/ionoscloud_flowlog_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 -7
- data/spec/chef/knife/ionoscloud_group_delete_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_group_get_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_group_list_spec.rb +11 -2
- data/spec/chef/knife/ionoscloud_group_update_spec.rb +24 -12
- data/spec/chef/knife/ionoscloud_group_user_add_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_group_user_remove_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_image_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_ipblock_delete_spec.rb +0 -2
- data/spec/chef/knife/ionoscloud_ipblock_list_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_ipfailover_add_spec.rb +3 -4
- data/spec/chef/knife/ionoscloud_ipfailover_remove_spec.rb +4 -5
- data/spec/chef/knife/ionoscloud_k8s_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_k8s_delete_spec.rb +15 -16
- data/spec/chef/knife/ionoscloud_k8s_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_k8s_update_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_kubeconfig_get_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_label_add_spec.rb +10 -10
- data/spec/chef/knife/ionoscloud_label_list_spec.rb +14 -14
- data/spec/chef/knife/ionoscloud_label_remove_spec.rb +20 -20
- data/spec/chef/knife/ionoscloud_lan_create_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_lan_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_lan_get_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_lan_list_spec.rb +3 -5
- data/spec/chef/knife/ionoscloud_lan_update_spec.rb +4 -8
- 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 +3 -3
- 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 +5 -3
- data/spec/chef/knife/ionoscloud_nic_list_spec.rb +12 -6
- data/spec/chef/knife/ionoscloud_nic_update_spec.rb +10 -5
- data/spec/chef/knife/ionoscloud_nodepool_create_spec.rb +9 -11
- data/spec/chef/knife/ionoscloud_nodepool_delete_spec.rb +25 -25
- data/spec/chef/knife/ionoscloud_nodepool_get_spec.rb +1 -1
- 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 +5 -1
- data/spec/chef/knife/ionoscloud_pcc_create_spec.rb +7 -7
- data/spec/chef/knife/ionoscloud_pcc_delete_spec.rb +6 -6
- data/spec/chef/knife/ionoscloud_pcc_get_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_pcc_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_pcc_update_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_request_get_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_request_list_spec.rb +24 -25
- 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 +2 -2
- 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 +5 -2
- 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 +6 -3
- data/spec/chef/knife/ionoscloud_server_upgrade_spec.rb +96 -0
- data/spec/chef/knife/ionoscloud_snapshot_create_spec.rb +3 -4
- data/spec/chef/knife/ionoscloud_snapshot_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_snapshot_get_spec.rb +2 -2
- 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 +3 -3
- data/spec/chef/knife/ionoscloud_template_list_spec.rb +78 -0
- data/spec/chef/knife/ionoscloud_user_ssourl_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_volume_attach_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_volume_create_spec.rb +12 -11
- data/spec/chef/knife/ionoscloud_volume_delete_spec.rb +6 -5
- data/spec/chef/knife/ionoscloud_volume_detach_spec.rb +5 -14
- data/spec/chef/knife/ionoscloud_volume_get_spec.rb +3 -2
- data/spec/chef/knife/ionoscloud_volume_list_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_volume_update_spec.rb +4 -3
- data/spec/spec_helper.rb +268 -96
- metadata +152 -4
@@ -1,8 +1,19 @@
|
|
1
1
|
require 'chef/knife'
|
2
2
|
|
3
|
+
require 'knife-ionoscloud/version'
|
4
|
+
|
5
|
+
|
6
|
+
MODULE_VERSION = Knife::Ionoscloud::VERSION unless defined? MODULE_VERSION
|
7
|
+
|
3
8
|
class Chef
|
4
9
|
class Knife
|
5
10
|
module IonoscloudBase
|
11
|
+
def initialize(args = [])
|
12
|
+
super(args)
|
13
|
+
@description = ''
|
14
|
+
@required_options = []
|
15
|
+
end
|
16
|
+
|
6
17
|
def self.included(includer)
|
7
18
|
includer.class_eval do
|
8
19
|
deps do
|
@@ -19,6 +30,10 @@ class Chef
|
|
19
30
|
long: '--password PASSWORD',
|
20
31
|
description: 'Your Ionoscloud password'
|
21
32
|
|
33
|
+
option :ionoscloud_url,
|
34
|
+
long: '--url URL',
|
35
|
+
description: 'The Ionoscloud API URL'
|
36
|
+
|
22
37
|
option :extra_config_file,
|
23
38
|
short: '-e EXTRA_CONFIG_FILE_PATH',
|
24
39
|
long: '--extra-config EXTRA_CONFIG_FILE_PATH',
|
@@ -26,6 +41,12 @@ class Chef
|
|
26
41
|
end
|
27
42
|
end
|
28
43
|
|
44
|
+
def msg_pair(label, value, color = :cyan)
|
45
|
+
if !value.nil? && !value.to_s.empty?
|
46
|
+
puts "#{ui.color(label, color)}: #{value}"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
29
50
|
def validate_required_params(required_params, params)
|
30
51
|
missing_params = required_params.select do |param|
|
31
52
|
params[param].nil?
|
@@ -55,14 +76,33 @@ class Chef
|
|
55
76
|
end
|
56
77
|
|
57
78
|
def api_client
|
79
|
+
return @api_client if @api_client
|
80
|
+
|
58
81
|
api_config = Ionoscloud::Configuration.new()
|
59
82
|
|
60
83
|
api_config.username = config[:ionoscloud_username]
|
61
84
|
api_config.password = config[:ionoscloud_password]
|
62
85
|
|
86
|
+
if config[:ionoscloud_url]
|
87
|
+
uri = URI.parse(config[:ionoscloud_url])
|
88
|
+
|
89
|
+
api_config.scheme = uri.scheme
|
90
|
+
api_config.host = uri.host
|
91
|
+
api_config.base_path = uri.path
|
92
|
+
api_config.server_index = nil
|
93
|
+
end
|
94
|
+
|
63
95
|
api_config.debugging = config[:ionoscloud_debug] || false
|
64
96
|
|
65
|
-
@api_client
|
97
|
+
@api_client = Ionoscloud::ApiClient.new(api_config)
|
98
|
+
|
99
|
+
@api_client.user_agent = [
|
100
|
+
'knife/v' + MODULE_VERSION,
|
101
|
+
@api_client.default_headers['User-Agent'],
|
102
|
+
'chef/' + Chef::VERSION,
|
103
|
+
].join('_')
|
104
|
+
|
105
|
+
@api_client
|
66
106
|
end
|
67
107
|
|
68
108
|
def get_request_id(headers)
|
@@ -74,7 +114,7 @@ class Chef
|
|
74
114
|
end
|
75
115
|
|
76
116
|
def is_done?(request_id)
|
77
|
-
response = Ionoscloud::
|
117
|
+
response = Ionoscloud::RequestsApi.new(api_client).requests_status_get(request_id)
|
78
118
|
if response.metadata.status == 'FAILED'
|
79
119
|
puts "\nRequest #{request_id} failed\n#{response.metadata.message.to_s}"
|
80
120
|
exit(1)
|
@@ -84,12 +124,14 @@ class Chef
|
|
84
124
|
|
85
125
|
def print_datacenter(datacenter)
|
86
126
|
print "\n"
|
127
|
+
cpu_architecture = datacenter.properties.cpu_architecture.nil? ? [] : datacenter.properties.cpu_architecture.map { |arch| arch.to_hash }
|
87
128
|
puts "#{ui.color('ID', :cyan)}: #{datacenter.id}"
|
88
129
|
puts "#{ui.color('Name', :cyan)}: #{datacenter.properties.name}"
|
89
130
|
puts "#{ui.color('Description', :cyan)}: #{datacenter.properties.description}"
|
90
131
|
puts "#{ui.color('Location', :cyan)}: #{datacenter.properties.location}"
|
91
132
|
puts "#{ui.color('Version', :cyan)}: #{datacenter.properties.version}"
|
92
133
|
puts "#{ui.color('Features', :cyan)}: #{datacenter.properties.features}"
|
134
|
+
puts "#{ui.color('CPU Architecture', :cyan)}: #{cpu_architecture}"
|
93
135
|
puts "#{ui.color('Sec Auth Protection', :cyan)}: #{datacenter.properties.sec_auth_protection}"
|
94
136
|
end
|
95
137
|
|
@@ -104,6 +146,7 @@ class Chef
|
|
104
146
|
print "\n"
|
105
147
|
puts "#{ui.color('ID', :cyan)}: #{firewall.id}"
|
106
148
|
puts "#{ui.color('Name', :cyan)}: #{firewall.properties.name}"
|
149
|
+
puts "#{ui.color('Type', :cyan)}: #{firewall.properties.type}"
|
107
150
|
puts "#{ui.color('Protocol', :cyan)}: #{firewall.properties.protocol}"
|
108
151
|
puts "#{ui.color('Source MAC', :cyan)}: #{firewall.properties.source_mac}"
|
109
152
|
puts "#{ui.color('Source IP', :cyan)}: #{firewall.properties.source_ip}"
|
@@ -127,6 +170,10 @@ class Chef
|
|
127
170
|
puts "#{ui.color('Create K8s Clusters', :cyan)}: #{group.properties.create_k8s_cluster.to_s}"
|
128
171
|
puts "#{ui.color('Create PCC', :cyan)}: #{group.properties.create_pcc.to_s}"
|
129
172
|
puts "#{ui.color('Create Internet Acess', :cyan)}: #{group.properties.create_internet_access.to_s}"
|
173
|
+
puts "#{ui.color('Create Flow Logs', :cyan)}: #{group.properties.create_flow_log.to_s}"
|
174
|
+
puts "#{ui.color('Access and Manage Monitoring', :cyan)}: #{group.properties.access_and_manage_monitoring.to_s}"
|
175
|
+
puts "#{ui.color('Access and Manage Certificates', :cyan)}: #{group.properties.access_and_manage_certificates.to_s}"
|
176
|
+
|
130
177
|
puts "#{ui.color('Users', :cyan)}: #{(group.entities.users.items.map { |el| el.id }).to_s}" unless group.entities.users.items.nil?
|
131
178
|
end
|
132
179
|
|
@@ -146,7 +193,6 @@ class Chef
|
|
146
193
|
s3_buckets = (cluster.properties.s3_buckets.nil? ? [] : cluster.properties.s3_buckets.map { |el| el.name })
|
147
194
|
puts "#{ui.color('ID', :cyan)}: #{cluster.id}"
|
148
195
|
puts "#{ui.color('Name', :cyan)}: #{cluster.properties.name}"
|
149
|
-
puts "#{ui.color('Public', :cyan)}: #{cluster.properties.public}"
|
150
196
|
puts "#{ui.color('k8s Version', :cyan)}: #{cluster.properties.k8s_version}"
|
151
197
|
puts "#{ui.color('Maintenance Window', :cyan)}: #{maintenance_window}"
|
152
198
|
puts "#{ui.color('State', :cyan)}: #{cluster.metadata.state}"
|
@@ -183,7 +229,9 @@ class Chef
|
|
183
229
|
puts "#{ui.color('IPs', :cyan)}: #{nic.properties.ips.to_s}"
|
184
230
|
puts "#{ui.color('DHCP', :cyan)}: #{nic.properties.dhcp}"
|
185
231
|
puts "#{ui.color('LAN', :cyan)}: #{nic.properties.lan}"
|
186
|
-
puts "#{ui.color('
|
232
|
+
puts "#{ui.color('Firewall Type', :cyan)}: #{nic.properties.firewall_type}"
|
233
|
+
puts "#{ui.color('Device Number', :cyan)}: #{nic.properties.device_number}"
|
234
|
+
puts "#{ui.color('PCI Slot', :cyan)}: #{nic.properties.pci_slot}"
|
187
235
|
end
|
188
236
|
|
189
237
|
def print_k8s_node(node)
|
@@ -200,7 +248,7 @@ class Chef
|
|
200
248
|
print "\n"
|
201
249
|
auto_scaling = "Min node count: #{nodepool.properties.auto_scaling.min_node_count}, Max node count:#{nodepool.properties.auto_scaling.max_node_count}"
|
202
250
|
maintenance_window = "#{nodepool.properties.maintenance_window.day_of_the_week}, #{nodepool.properties.maintenance_window.time}"
|
203
|
-
lans = nodepool.properties.lans.map { |lan|
|
251
|
+
lans = nodepool.properties.lans.map { |lan| lan.to_hash }
|
204
252
|
puts "#{ui.color('ID', :cyan)}: #{nodepool.id}"
|
205
253
|
puts "#{ui.color('Name', :cyan)}: #{nodepool.properties.name}"
|
206
254
|
puts "#{ui.color('K8s Version', :cyan)}: #{nodepool.properties.k8s_version}"
|
@@ -243,10 +291,13 @@ class Chef
|
|
243
291
|
print "\n"
|
244
292
|
puts "#{ui.color('ID', :cyan)}: #{server.id}"
|
245
293
|
puts "#{ui.color('Name', :cyan)}: #{server.properties.name}"
|
294
|
+
puts "#{ui.color('Type', :cyan)}: #{server.properties.type}"
|
295
|
+
puts "#{ui.color('Template', :cyan)}: #{server.properties.template_uuid}"
|
246
296
|
puts "#{ui.color('Cores', :cyan)}: #{server.properties.cores}"
|
247
297
|
puts "#{ui.color('CPU Family', :cyan)}: #{server.properties.cpu_family}"
|
248
298
|
puts "#{ui.color('Ram', :cyan)}: #{server.properties.ram}"
|
249
299
|
puts "#{ui.color('Availability Zone', :cyan)}: #{server.properties.availability_zone}"
|
300
|
+
puts "#{ui.color('VM State', :cyan)}: #{server.properties.vm_state}"
|
250
301
|
puts "#{ui.color('Boot Volume', :cyan)}: #{server.properties.boot_volume ? server.properties.boot_volume.id : ''}"
|
251
302
|
puts "#{ui.color('Boot CDROM', :cyan)}: #{server.properties.boot_cdrom ? server.properties.boot_cdrom.id : ''}"
|
252
303
|
end
|
@@ -316,6 +367,61 @@ class Chef
|
|
316
367
|
puts "#{ui.color('Disc Virtio Hot Plug', :cyan)}: #{volume.properties.disc_virtio_hot_plug}"
|
317
368
|
puts "#{ui.color('Disc Virtio Hot Unplug', :cyan)}: #{volume.properties.disc_virtio_hot_unplug}"
|
318
369
|
puts "#{ui.color('Device number', :cyan)}: #{volume.properties.device_number}"
|
370
|
+
puts "#{ui.color('PCI Slot', :cyan)}: #{volume.properties.pci_slot}"
|
371
|
+
end
|
372
|
+
|
373
|
+
def print_flowlog(flowlog)
|
374
|
+
print "\n"
|
375
|
+
puts "#{ui.color('ID', :cyan)}: #{flowlog.id}"
|
376
|
+
puts "#{ui.color('Name', :cyan)}: #{flowlog.properties.name}"
|
377
|
+
puts "#{ui.color('Action', :cyan)}: #{flowlog.properties.action}"
|
378
|
+
puts "#{ui.color('Direction', :cyan)}: #{flowlog.properties.direction}"
|
379
|
+
puts "#{ui.color('Bucket', :cyan)}: #{flowlog.properties.bucket}"
|
380
|
+
end
|
381
|
+
|
382
|
+
def print_network_load_balancer(network_load_balancer)
|
383
|
+
print "\n"
|
384
|
+
puts "#{ui.color('ID', :cyan)}: #{network_load_balancer.id}"
|
385
|
+
puts "#{ui.color('Name', :cyan)}: #{network_load_balancer.properties.name}"
|
386
|
+
puts "#{ui.color('Listener LAN', :cyan)}: #{network_load_balancer.properties.listener_lan}"
|
387
|
+
puts "#{ui.color('IPS', :cyan)}: #{network_load_balancer.properties.ips}"
|
388
|
+
puts "#{ui.color('Target LAN', :cyan)}: #{network_load_balancer.properties.target_lan}"
|
389
|
+
puts "#{ui.color('Private IPS', :cyan)}: #{network_load_balancer.properties.lb_private_ips}"
|
390
|
+
puts "#{ui.color('Forwarding Rules', :cyan)}: #{network_load_balancer.entities.forwardingrules.items.map do |rule|
|
391
|
+
{
|
392
|
+
id: rule.id,
|
393
|
+
name: rule.properties.name,
|
394
|
+
algorithm: rule.properties.algorithm,
|
395
|
+
protocol: rule.properties.protocol,
|
396
|
+
listener_ip: rule.properties.listener_ip,
|
397
|
+
listener_port: rule.properties.listener_port,
|
398
|
+
health_check: rule.properties.health_check.nil? ? nil : rule.properties.health_check.to_hash,
|
399
|
+
targets: (rule.properties.targets.nil? ? [] : rule.properties.targets.map { |target| target.to_hash }),
|
400
|
+
}
|
401
|
+
end}"
|
402
|
+
puts "#{ui.color('Flowlogs', :cyan)}: #{network_load_balancer.entities.flowlogs.items.map { |flowlog| flowlog.id }}"
|
403
|
+
end
|
404
|
+
|
405
|
+
def print_natgateway(natgateway)
|
406
|
+
print "\n"
|
407
|
+
puts "#{ui.color('ID', :cyan)}: #{natgateway.id}"
|
408
|
+
puts "#{ui.color('Name', :cyan)}: #{natgateway.properties.name}"
|
409
|
+
puts "#{ui.color('IPS', :cyan)}: #{natgateway.properties.public_ips}"
|
410
|
+
puts "#{ui.color('LANS', :cyan)}: #{natgateway.properties.lans.map { |el| { id: el.id, gateway_ips: el.gateway_ips } }}"
|
411
|
+
puts "#{ui.color('Rules', :cyan)}: #{natgateway.entities.rules.items.map do |rule|
|
412
|
+
{
|
413
|
+
id: rule.id,
|
414
|
+
name: rule.properties.name,
|
415
|
+
type: rule.properties.type,
|
416
|
+
protocol: rule.properties.protocol,
|
417
|
+
public_ip: rule.properties.public_ip,
|
418
|
+
source_subnet: rule.properties.source_subnet,
|
419
|
+
target_subnet: rule.properties.target_subnet,
|
420
|
+
target_port_range_start: rule.properties.target_port_range ? rule.properties.target_port_range.start : '',
|
421
|
+
target_port_range_end: rule.properties.target_port_range ? rule.properties.target_port_range._end : '',
|
422
|
+
}
|
423
|
+
end}"
|
424
|
+
puts "#{ui.color('Flowlogs', :cyan)}: #{natgateway.entities.flowlogs.items.map { |flowlog| flowlog.id }}"
|
319
425
|
end
|
320
426
|
end
|
321
427
|
end
|
@@ -25,8 +25,7 @@ class Chef
|
|
25
25
|
option :cpu_family,
|
26
26
|
short: '-f CPU_FAMILY',
|
27
27
|
long: '--cpu-family CPU_FAMILY',
|
28
|
-
description: 'The family of processor cores (INTEL_XEON or AMD_OPTERON)'
|
29
|
-
default: 'INTEL_SKYLAKE'
|
28
|
+
description: 'The family of processor cores (INTEL_XEON or AMD_OPTERON)'
|
30
29
|
|
31
30
|
option :ram,
|
32
31
|
short: '-r RAM',
|
@@ -36,8 +35,7 @@ class Chef
|
|
36
35
|
option :availability_zone,
|
37
36
|
short: '-a AVAILABILITY_ZONE',
|
38
37
|
long: '--availability-zone AVAILABILITY_ZONE',
|
39
|
-
description: 'The availability zone of the server'
|
40
|
-
default: 'AUTO'
|
38
|
+
description: 'The availability zone of the server'
|
41
39
|
|
42
40
|
option :volume_name,
|
43
41
|
long: '--volume-name NAME',
|
@@ -87,6 +85,20 @@ class Chef
|
|
87
85
|
long: '--ssh-keys SSHKEY1,SSHKEY2,...',
|
88
86
|
description: 'A list of public SSH keys to include'
|
89
87
|
|
88
|
+
option :backupunit_id,
|
89
|
+
short: '-B BACKUPUNIT_ID',
|
90
|
+
long: '--backupunit BACKUPUNIT_ID',
|
91
|
+
description: 'The uuid of the Backup Unit that user has access to. The property is immutable and is only allowed '\
|
92
|
+
'to be set on a new volume creation. It is mandatory to provide either \'public image\' or \'imageAlias\' in '\
|
93
|
+
'conjunction with this property.'
|
94
|
+
|
95
|
+
option :user_data,
|
96
|
+
short: '-u USER_DATA',
|
97
|
+
long: '--user-data USER_DATA',
|
98
|
+
description: 'The cloud-init configuration for the volume as base64 encoded string. The property is '\
|
99
|
+
'immutable and is only allowed to be set on a new volume creation. It is mandatory to provide either \'public image\' '\
|
100
|
+
'or \'imageAlias\' that has cloud-init compatibility in conjunction with this property.'
|
101
|
+
|
90
102
|
option :nic_name,
|
91
103
|
long: '--nic-name NAME',
|
92
104
|
description: 'Name of the NIC'
|
@@ -100,7 +112,6 @@ class Chef
|
|
100
112
|
short: '-h',
|
101
113
|
long: '--dhcp',
|
102
114
|
boolean: true | false,
|
103
|
-
default: true,
|
104
115
|
description: 'Set to false if you wish to disable DHCP'
|
105
116
|
|
106
117
|
option :lan,
|
@@ -108,9 +119,10 @@ class Chef
|
|
108
119
|
long: '--lan ID',
|
109
120
|
description: 'The LAN ID the NIC will reside on; if the LAN ID does not exist it will be created'
|
110
121
|
|
111
|
-
option :
|
112
|
-
long: '--
|
113
|
-
description: '
|
122
|
+
option :firewall_type,
|
123
|
+
long: '--firewall-type FIREWALL_TYPE',
|
124
|
+
description: 'The type of firewall rules that will be allowed on the NIC. If it is not specified it will take the '\
|
125
|
+
'default value INGRESS'
|
114
126
|
|
115
127
|
attr_reader :description, :required_options
|
116
128
|
|
@@ -145,6 +157,8 @@ class Chef
|
|
145
157
|
type: config[:type],
|
146
158
|
licence_type: config[:licence_type],
|
147
159
|
availability_zone: config[:volume_availability_zone],
|
160
|
+
backupunit_id: config[:backupunit_id],
|
161
|
+
user_data: config[:user_data],
|
148
162
|
}.compact)
|
149
163
|
)
|
150
164
|
|
@@ -154,7 +168,7 @@ class Chef
|
|
154
168
|
ips: config[:ips],
|
155
169
|
dhcp: config[:dhcp],
|
156
170
|
lan: config[:lan],
|
157
|
-
|
171
|
+
firewall_type: config[:firewall_type],
|
158
172
|
}.compact)
|
159
173
|
)
|
160
174
|
|
@@ -176,14 +190,26 @@ class Chef
|
|
176
190
|
),
|
177
191
|
)
|
178
192
|
|
179
|
-
server_api = Ionoscloud::
|
193
|
+
server_api = Ionoscloud::ServersApi.new(api_client)
|
180
194
|
|
181
195
|
server, _, headers = server_api.datacenters_servers_post_with_http_info(config[:datacenter_id], server)
|
182
196
|
|
183
197
|
dot = ui.color('.', :magenta)
|
184
198
|
api_client.wait_for { print dot; is_done? get_request_id headers }
|
185
199
|
|
186
|
-
|
200
|
+
server = server_api.datacenters_servers_find_by_id(config[:datacenter_id], server.id)
|
201
|
+
|
202
|
+
puts "\n"
|
203
|
+
puts "#{ui.color('ID', :cyan)}: #{server.id}"
|
204
|
+
puts "#{ui.color('Name', :cyan)}: #{server.properties.name}"
|
205
|
+
puts "#{ui.color('Cores', :cyan)}: #{server.properties.cores}"
|
206
|
+
puts "#{ui.color('CPU Family', :cyan)}: #{server.properties.cpu_family}"
|
207
|
+
puts "#{ui.color('Ram', :cyan)}: #{server.properties.ram}"
|
208
|
+
puts "#{ui.color('Availability Zone', :cyan)}: #{server.properties.availability_zone}"
|
209
|
+
puts "#{ui.color('Boot Volume', :cyan)}: #{server.properties.boot_volume ? server.properties.boot_volume.id : ''}"
|
210
|
+
puts "#{ui.color('Boot CDROM', :cyan)}: #{server.properties.boot_cdrom ? server.properties.boot_cdrom.id : ''}"
|
211
|
+
|
212
|
+
puts 'done'
|
187
213
|
end
|
188
214
|
end
|
189
215
|
end
|
@@ -21,30 +21,39 @@ class Chef
|
|
21
21
|
handle_extra_config
|
22
22
|
validate_required_params(@required_options, config)
|
23
23
|
|
24
|
-
|
24
|
+
contracts = Ionoscloud::ContractResourcesApi.new(api_client).contracts_get()
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
26
|
+
contracts.items.each do
|
27
|
+
|contract|
|
28
|
+
puts "#{ui.color('Contract Type', :cyan)}: #{contract.type}"
|
29
|
+
puts "#{ui.color('Contract Owner', :cyan)}: #{contract.properties.owner}"
|
30
|
+
puts "#{ui.color('Contract Number', :cyan)}: #{contract.properties.contract_number}"
|
31
|
+
puts "#{ui.color('Registration Domain', :cyan)}: #{contract.properties.reg_domain}"
|
32
|
+
puts "#{ui.color('Status', :cyan)}: #{contract.properties.status}"
|
33
|
+
puts "#{ui.color('Cores per contract', :cyan)}: #{contract.properties.resource_limits.cores_per_contract}"
|
34
|
+
puts "#{ui.color('Cores per server', :cyan)}: #{contract.properties.resource_limits.cores_per_server}"
|
35
|
+
puts "#{ui.color('Cores provisioned', :cyan)}: #{contract.properties.resource_limits.cores_provisioned}"
|
36
|
+
puts "#{ui.color('HDD limit per contract', :cyan)}: #{contract.properties.resource_limits.hdd_limit_per_contract}"
|
37
|
+
puts "#{ui.color('HDD limit per volume', :cyan)}: #{contract.properties.resource_limits.hdd_limit_per_volume}"
|
38
|
+
puts "#{ui.color('HDD volume provisioned', :cyan)}: #{contract.properties.resource_limits.hdd_volume_provisioned}"
|
39
|
+
puts "#{ui.color('RAM per contract', :cyan)}: #{contract.properties.resource_limits.ram_per_contract}"
|
40
|
+
puts "#{ui.color('RAM per server', :cyan)}: #{contract.properties.resource_limits.ram_per_server}"
|
41
|
+
puts "#{ui.color('RAM provisioned', :cyan)}: #{contract.properties.resource_limits.ram_provisioned}"
|
42
|
+
puts "#{ui.color('Reservable IPs', :cyan)}: #{contract.properties.resource_limits.reservable_ips}"
|
43
|
+
puts "#{ui.color('Reservable IPs in use', :cyan)}: #{contract.properties.resource_limits.reserved_ips_in_use}"
|
44
|
+
puts "#{ui.color('Reservable IPs on contract', :cyan)}: #{contract.properties.resource_limits.reserved_ips_on_contract}"
|
45
|
+
puts "#{ui.color('SSD limit per contract', :cyan)}: #{contract.properties.resource_limits.ssd_limit_per_contract}"
|
46
|
+
puts "#{ui.color('SSD limit per volume', :cyan)}: #{contract.properties.resource_limits.ssd_limit_per_volume}"
|
47
|
+
puts "#{ui.color('SSD volume provisioned', :cyan)}: #{contract.properties.resource_limits.ssd_volume_provisioned}"
|
48
|
+
puts "#{ui.color('DAS volume provisioned', :cyan)}: #{contract.properties.resource_limits.das_volume_provisioned}"
|
49
|
+
puts "#{ui.color('K8s Cluster Limit Total', :cyan)}: #{contract.properties.resource_limits.k8s_cluster_limit_total}"
|
50
|
+
puts "#{ui.color('K8s Clusters provisioned', :cyan)}: #{contract.properties.resource_limits.k8s_clusters_provisioned}"
|
51
|
+
puts "#{ui.color('NLB total limit', :cyan)}: #{contract.properties.resource_limits.nlb_limit_total}"
|
52
|
+
puts "#{ui.color('NLBs provisioned', :cyan)}: #{contract.properties.resource_limits.nlb_provisioned}"
|
53
|
+
puts "#{ui.color('NAT gateway total limit', :cyan)}: #{contract.properties.resource_limits.nat_gateway_limit_total}"
|
54
|
+
puts "#{ui.color('NAT gateways provisioned', :cyan)}: #{contract.properties.resource_limits.nat_gateway_provisioned}"
|
55
|
+
puts "\n"
|
56
|
+
end
|
48
57
|
end
|
49
58
|
end
|
50
59
|
end
|
@@ -0,0 +1,212 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudCubeServerCreate < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud cube server create (options)'
|
9
|
+
|
10
|
+
option :datacenter_id,
|
11
|
+
short: '-D DATACENTER_ID',
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
13
|
+
description: 'Name of the virtual datacenter'
|
14
|
+
|
15
|
+
option :name,
|
16
|
+
short: '-n NAME',
|
17
|
+
long: '--name NAME',
|
18
|
+
description: '(required) Name of the server'
|
19
|
+
|
20
|
+
option :template,
|
21
|
+
long: '--template TEMPLATE_UUID',
|
22
|
+
description: 'The UUID of the template for creating a CUBE server; the available templates for CUBE servers can be found on the templates resource'
|
23
|
+
|
24
|
+
option :cpu_family,
|
25
|
+
short: '-f CPU_FAMILY',
|
26
|
+
long: '--cpu-family CPU_FAMILY',
|
27
|
+
description: 'The family of processor cores (INTEL_XEON or AMD_OPTERON)'
|
28
|
+
|
29
|
+
option :availability_zone,
|
30
|
+
short: '-a AVAILABILITY_ZONE',
|
31
|
+
long: '--availability-zone AVAILABILITY_ZONE',
|
32
|
+
description: 'The availability zone of the server'
|
33
|
+
|
34
|
+
option :volume_name,
|
35
|
+
long: '--volume-name NAME',
|
36
|
+
description: 'Name of the volume'
|
37
|
+
|
38
|
+
option :bus,
|
39
|
+
short: '-b BUS',
|
40
|
+
long: '--bus BUS',
|
41
|
+
description: 'The bus type of the volume (VIRTIO or IDE)'
|
42
|
+
|
43
|
+
option :image,
|
44
|
+
short: '-N ID',
|
45
|
+
long: '--image ID',
|
46
|
+
description: '(required) The image or snapshot ID'
|
47
|
+
|
48
|
+
option :licence_type,
|
49
|
+
short: '-l LICENCE',
|
50
|
+
long: '--licence-type LICENCE',
|
51
|
+
description: 'The licence type of the volume (LINUX, WINDOWS, WINDOWS2016, UNKNOWN, OTHER)'
|
52
|
+
|
53
|
+
option :image_password,
|
54
|
+
short: '-P PASSWORD',
|
55
|
+
long: '--image-password PASSWORD',
|
56
|
+
description: 'The password set on the image for the "root" or "Administrator" user'
|
57
|
+
|
58
|
+
option :ssh_keys,
|
59
|
+
short: '-K SSHKEY[,SSHKEY,...]',
|
60
|
+
long: '--ssh-keys SSHKEY1,SSHKEY2,...',
|
61
|
+
description: 'A list of public SSH keys to include'
|
62
|
+
|
63
|
+
option :backupunit_id,
|
64
|
+
short: '-B BACKUPUNIT_ID',
|
65
|
+
long: '--backupunit BACKUPUNIT_ID',
|
66
|
+
description: 'The uuid of the Backup Unit that user has access to. The property is immutable and is only allowed '\
|
67
|
+
'to be set on a new volume creation. It is mandatory to provide either \'public image\' or \'imageAlias\' in '\
|
68
|
+
'conjunction with this property.'
|
69
|
+
|
70
|
+
option :user_data,
|
71
|
+
short: '-u USER_DATA',
|
72
|
+
long: '--user-data USER_DATA',
|
73
|
+
description: 'The cloud-init configuration for the volume as base64 encoded string. The property is '\
|
74
|
+
'immutable and is only allowed to be set on a new volume creation. It is mandatory to provide either \'public image\' '\
|
75
|
+
'or \'imageAlias\' that has cloud-init compatibility in conjunction with this property.'
|
76
|
+
|
77
|
+
option :set_boot,
|
78
|
+
long: '--set-boot',
|
79
|
+
description: 'Whether to set the volume as the boot volume'
|
80
|
+
|
81
|
+
option :nic_name,
|
82
|
+
long: '--nic-name NAME',
|
83
|
+
description: 'Name of the NIC'
|
84
|
+
|
85
|
+
option :ips,
|
86
|
+
short: '-i IP[,IP,...]',
|
87
|
+
long: '--ips IP[,IP,...]',
|
88
|
+
description: 'IPs assigned to the NIC'
|
89
|
+
|
90
|
+
option :dhcp,
|
91
|
+
short: '-h',
|
92
|
+
long: '--dhcp',
|
93
|
+
boolean: true | false,
|
94
|
+
description: 'Set to false if you wish to disable DHCP'
|
95
|
+
|
96
|
+
option :lan,
|
97
|
+
short: '-L ID',
|
98
|
+
long: '--lan ID',
|
99
|
+
description: 'The LAN ID the NIC will reside on; if the LAN ID does not exist it will be created'
|
100
|
+
|
101
|
+
option :firewall_type,
|
102
|
+
short: '-t FIREWALL_TYPE',
|
103
|
+
long: '--firewall-type FIREWALL_TYPE',
|
104
|
+
description: 'The type of firewall rules that will be allowed on the NIC. If it is not specified it will take the '\
|
105
|
+
'default value INGRESS'
|
106
|
+
|
107
|
+
attr_reader :description, :required_options
|
108
|
+
|
109
|
+
def initialize(args = [])
|
110
|
+
super(args)
|
111
|
+
@description =
|
112
|
+
'This creates a new cube server with an attached volume and NIC in a specified virtual data center.'
|
113
|
+
@required_options = [
|
114
|
+
:datacenter_id, :name, :template, :ionoscloud_username, :ionoscloud_password,
|
115
|
+
]
|
116
|
+
end
|
117
|
+
|
118
|
+
def run
|
119
|
+
$stdout.sync = true
|
120
|
+
handle_extra_config
|
121
|
+
validate_required_params(@required_options, config)
|
122
|
+
|
123
|
+
config[:ssh_keys] = config[:ssh_keys].split(',') if config[:ssh_keys] && config[:ssh_keys].instance_of?(String)
|
124
|
+
config[:ips] = config[:ips].split(',') if config[:ips] && config[:ips].instance_of?(String)
|
125
|
+
|
126
|
+
print ui.color('Creating cube server...', :magenta).to_s
|
127
|
+
|
128
|
+
volumes = [Ionoscloud::Volume.new(
|
129
|
+
properties: Ionoscloud::VolumeProperties.new({
|
130
|
+
name: config[:volume_name],
|
131
|
+
bus: config[:bus] || 'VIRTIO',
|
132
|
+
image: config[:image],
|
133
|
+
ssh_keys: config[:ssh_keys],
|
134
|
+
image_password: config[:image_password],
|
135
|
+
type: 'DAS',
|
136
|
+
licence_type: config[:licence_type],
|
137
|
+
backupunit_id: config[:backupunit_id],
|
138
|
+
user_data: config[:user_data],
|
139
|
+
}.compact)
|
140
|
+
)]
|
141
|
+
|
142
|
+
nics = []
|
143
|
+
|
144
|
+
if config[:nic_name] || config[:ips] || config[:dhcp] || config[:lan]
|
145
|
+
nics = [
|
146
|
+
Ionoscloud::Nic.new(
|
147
|
+
properties: Ionoscloud::NicProperties.new({
|
148
|
+
name: config[:nic_name],
|
149
|
+
ips: config[:ips],
|
150
|
+
dhcp: config[:dhcp],
|
151
|
+
lan: config[:lan],
|
152
|
+
firewall_type: config[:firewall_type],
|
153
|
+
}.compact)
|
154
|
+
)
|
155
|
+
]
|
156
|
+
end
|
157
|
+
|
158
|
+
server = Ionoscloud::Server.new(
|
159
|
+
properties: Ionoscloud::ServerProperties.new({
|
160
|
+
name: config[:name],
|
161
|
+
type: 'CUBE',
|
162
|
+
template_uuid: config[:template],
|
163
|
+
cpu_family: config[:cpu_family],
|
164
|
+
ram: config[:ram],
|
165
|
+
availability_zone: config[:availability_zone],
|
166
|
+
}.compact),
|
167
|
+
entities: Ionoscloud::ServerEntities.new(
|
168
|
+
volumes: {
|
169
|
+
items: volumes,
|
170
|
+
},
|
171
|
+
nics: {
|
172
|
+
items: nics,
|
173
|
+
},
|
174
|
+
),
|
175
|
+
)
|
176
|
+
|
177
|
+
server_api = Ionoscloud::ServersApi.new(api_client)
|
178
|
+
|
179
|
+
server, _, headers = server_api.datacenters_servers_post_with_http_info(config[:datacenter_id], server)
|
180
|
+
|
181
|
+
dot = ui.color('.', :magenta)
|
182
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
183
|
+
|
184
|
+
server = server_api.datacenters_servers_find_by_id(config[:datacenter_id], server.id, depth: 1)
|
185
|
+
|
186
|
+
if config[:set_boot]
|
187
|
+
changes = Ionoscloud::ServerProperties.new(boot_volume: { id: server.entities.volumes.items[0].id })
|
188
|
+
_, _, headers = server_api.datacenters_servers_patch_with_http_info(
|
189
|
+
config[:datacenter_id], server.id, changes,
|
190
|
+
)
|
191
|
+
|
192
|
+
api_client.wait_for { is_done? get_request_id headers }
|
193
|
+
|
194
|
+
server = server_api.datacenters_servers_find_by_id(config[:datacenter_id], server.id, depth: 1)
|
195
|
+
end
|
196
|
+
|
197
|
+
puts "\n"
|
198
|
+
puts "#{ui.color('ID', :cyan)}: #{server.id}"
|
199
|
+
puts "#{ui.color('Name', :cyan)}: #{server.properties.name}"
|
200
|
+
puts "#{ui.color('Type', :cyan)}: #{server.properties.type}"
|
201
|
+
puts "#{ui.color('Cores', :cyan)}: #{server.properties.cores}"
|
202
|
+
puts "#{ui.color('CPU Family', :cyan)}: #{server.properties.cpu_family}"
|
203
|
+
puts "#{ui.color('Ram', :cyan)}: #{server.properties.ram}"
|
204
|
+
puts "#{ui.color('Availability Zone', :cyan)}: #{server.properties.availability_zone}"
|
205
|
+
puts "#{ui.color('Boot Volume', :cyan)}: #{server.properties.boot_volume ? server.properties.boot_volume.id : ''}"
|
206
|
+
puts "#{ui.color('Boot CDROM', :cyan)}: #{server.properties.boot_cdrom ? server.properties.boot_cdrom.id : ''}"
|
207
|
+
|
208
|
+
puts 'done'
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
@@ -42,7 +42,7 @@ class Chef
|
|
42
42
|
|
43
43
|
print "#{ui.color('Creating data center...', :magenta)}"
|
44
44
|
|
45
|
-
datacenter_api = Ionoscloud::
|
45
|
+
datacenter_api = Ionoscloud::DataCentersApi.new(api_client)
|
46
46
|
|
47
47
|
datacenter, _, headers = datacenter_api.datacenters_post_with_http_info(
|
48
48
|
Ionoscloud::Datacenter.new(
|
@@ -57,7 +57,7 @@ class Chef
|
|
57
57
|
dot = ui.color('.', :magenta)
|
58
58
|
api_client.wait_for { print dot; is_done? get_request_id headers }
|
59
59
|
|
60
|
-
print_datacenter(
|
60
|
+
print_datacenter(datacenter)
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
@@ -23,7 +23,7 @@ class Chef
|
|
23
23
|
handle_extra_config
|
24
24
|
validate_required_params(@required_options, config)
|
25
25
|
|
26
|
-
datacenter_api = Ionoscloud::
|
26
|
+
datacenter_api = Ionoscloud::DataCentersApi.new(api_client)
|
27
27
|
|
28
28
|
@name_args.each do |datacenter_id|
|
29
29
|
begin
|
@@ -36,6 +36,7 @@ class Chef
|
|
36
36
|
|
37
37
|
print_datacenter(datacenter)
|
38
38
|
puts "\n"
|
39
|
+
|
39
40
|
begin
|
40
41
|
confirm('Do you really want to delete this data center')
|
41
42
|
rescue SystemExit => exc
|
@@ -26,7 +26,7 @@ class Chef
|
|
26
26
|
handle_extra_config
|
27
27
|
validate_required_params(@required_options, config)
|
28
28
|
|
29
|
-
print_datacenter(Ionoscloud::
|
29
|
+
print_datacenter(Ionoscloud::DataCentersApi.new(api_client).datacenters_find_by_id(config[:datacenter_id]))
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|