knife-ionoscloud 6.0.0.alpha.1 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/IONOS.CLOUD.BLU.svg +1 -0
- data/.github/workflows/publish.yml +4 -1
- data/README.md +9 -0
- data/docs/README.md +37 -0
- data/docs/changelog.md +10 -0
- data/docs/docs_generator.rb +45 -10
- data/docs/subcommands/{backupunit_create.md → backup/backupunit_create.md} +7 -1
- data/docs/subcommands/{backupunit_delete.md → backup/backupunit_delete.md} +7 -1
- data/docs/subcommands/backup/backupunit_get.md +38 -0
- data/docs/subcommands/{backupunit_list.md → backup/backupunit_list.md} +7 -1
- data/docs/subcommands/{backupunit_ssourl.md → backup/backupunit_ssourl.md} +7 -1
- data/docs/subcommands/backup/backupunit_update.md +44 -0
- data/docs/subcommands/{composite_server_create.md → compute-engine/composite_server_create.md} +15 -3
- data/docs/subcommands/compute-engine/cube_server_create.md +94 -0
- data/docs/subcommands/{datacenter_create.md → compute-engine/datacenter_create.md} +7 -1
- data/docs/subcommands/{datacenter_delete.md → compute-engine/datacenter_delete.md} +7 -1
- data/docs/subcommands/compute-engine/datacenter_get.md +38 -0
- data/docs/subcommands/{datacenter_list.md → compute-engine/datacenter_list.md} +7 -1
- data/docs/subcommands/compute-engine/datacenter_update.md +47 -0
- data/docs/subcommands/{firewall_create.md → compute-engine/firewall_create.md} +11 -2
- data/docs/subcommands/{firewall_delete.md → compute-engine/firewall_delete.md} +6 -0
- data/docs/subcommands/compute-engine/firewall_get.md +50 -0
- data/docs/subcommands/{firewall_list.md → compute-engine/firewall_list.md} +7 -1
- data/docs/subcommands/compute-engine/firewall_update.md +74 -0
- data/docs/subcommands/compute-engine/flowlog_create.md +66 -0
- data/docs/subcommands/compute-engine/flowlog_delete.md +54 -0
- data/docs/subcommands/compute-engine/flowlog_get.md +58 -0
- data/docs/subcommands/compute-engine/flowlog_list.md +54 -0
- data/docs/subcommands/compute-engine/flowlog_update.md +70 -0
- data/docs/subcommands/{image_list.md → compute-engine/image_list.md} +7 -1
- data/docs/subcommands/{ipblock_create.md → compute-engine/ipblock_create.md} +7 -1
- data/docs/subcommands/{ipblock_delete.md → compute-engine/ipblock_delete.md} +7 -1
- data/docs/subcommands/compute-engine/ipblock_get.md +38 -0
- data/docs/subcommands/{ipblock_list.md → compute-engine/ipblock_list.md} +7 -1
- data/docs/subcommands/compute-engine/ipblock_update.md +41 -0
- data/docs/subcommands/{ipfailover_add.md → compute-engine/ipfailover_add.md} +7 -1
- data/docs/subcommands/{ipfailover_remove.md → compute-engine/ipfailover_remove.md} +7 -1
- data/docs/subcommands/{label_add.md → compute-engine/label_add.md} +7 -1
- data/docs/subcommands/{label_list.md → compute-engine/label_list.md} +7 -1
- data/docs/subcommands/{label_remove.md → compute-engine/label_remove.md} +6 -0
- data/docs/subcommands/{lan_create.md → compute-engine/lan_create.md} +7 -1
- data/docs/subcommands/{lan_delete.md → compute-engine/lan_delete.md} +6 -0
- data/docs/subcommands/compute-engine/lan_get.md +42 -0
- data/docs/subcommands/{lan_list.md → compute-engine/lan_list.md} +7 -1
- data/docs/subcommands/compute-engine/lan_update.md +51 -0
- data/docs/subcommands/{loadbalancer_create.md → compute-engine/loadbalancer_create.md} +7 -1
- data/docs/subcommands/{loadbalancer_delete.md → compute-engine/loadbalancer_delete.md} +6 -0
- data/docs/subcommands/{loadbalancer_get.md → compute-engine/loadbalancer_get.md} +7 -1
- data/docs/subcommands/{loadbalancer_list.md → compute-engine/loadbalancer_list.md} +7 -1
- data/docs/subcommands/{loadbalancer_nic_add.md → compute-engine/loadbalancer_nic_add.md} +6 -0
- data/docs/subcommands/{loadbalancer_nic_remove.md → compute-engine/loadbalancer_nic_remove.md} +6 -0
- data/docs/subcommands/compute-engine/loadbalancer_update.md +51 -0
- data/docs/subcommands/{location_list.md → compute-engine/location_list.md} +7 -1
- data/docs/subcommands/compute-engine/natgateway_create.md +44 -0
- data/docs/subcommands/compute-engine/natgateway_delete.md +38 -0
- data/docs/subcommands/compute-engine/natgateway_get.md +42 -0
- data/docs/subcommands/compute-engine/natgateway_lan_add.md +49 -0
- data/docs/subcommands/compute-engine/natgateway_lan_remove.md +42 -0
- data/docs/subcommands/compute-engine/natgateway_list.md +38 -0
- data/docs/subcommands/compute-engine/natgateway_rule_add.md +69 -0
- data/docs/subcommands/compute-engine/natgateway_rule_list.md +41 -0
- data/docs/subcommands/compute-engine/natgateway_rule_remove.md +42 -0
- data/docs/subcommands/compute-engine/natgateway_rule_update.md +69 -0
- data/docs/subcommands/compute-engine/natgateway_update.md +51 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_create.md +57 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_delete.md +38 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_get.md +42 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_list.md +38 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_rule_add.md +75 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_rule_list.md +42 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_rule_remove.md +42 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_rule_target_add.md +67 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_rule_target_list.md +46 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_rule_target_remove.md +54 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_rule_update.md +75 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_update.md +57 -0
- data/docs/subcommands/{nic_create.md → compute-engine/nic_create.md} +9 -3
- data/docs/subcommands/{nic_delete.md → compute-engine/nic_delete.md} +6 -0
- data/docs/subcommands/compute-engine/nic_get.md +46 -0
- data/docs/subcommands/{nic_list.md → compute-engine/nic_list.md} +7 -1
- data/docs/subcommands/compute-engine/nic_update.md +61 -0
- data/docs/subcommands/{pcc_create.md → compute-engine/pcc_create.md} +7 -1
- data/docs/subcommands/{pcc_delete.md → compute-engine/pcc_delete.md} +7 -1
- data/docs/subcommands/compute-engine/pcc_get.md +38 -0
- data/docs/subcommands/{pcc_list.md → compute-engine/pcc_list.md} +7 -1
- data/docs/subcommands/compute-engine/pcc_update.md +44 -0
- data/docs/subcommands/compute-engine/request_get.md +38 -0
- data/docs/subcommands/{request_list.md → compute-engine/request_list.md} +7 -1
- data/docs/subcommands/{request_status.md → compute-engine/request_status.md} +7 -1
- data/docs/subcommands/{request_wait.md → compute-engine/request_wait.md} +7 -1
- data/docs/subcommands/compute-engine/server_console.md +42 -0
- data/docs/subcommands/{server_create.md → compute-engine/server_create.md} +7 -1
- data/docs/subcommands/{server_delete.md → compute-engine/server_delete.md} +6 -0
- data/docs/subcommands/compute-engine/server_get.md +42 -0
- data/docs/subcommands/{server_list.md → compute-engine/server_list.md} +10 -1
- data/docs/subcommands/{server_reboot.md → compute-engine/server_reboot.md} +6 -0
- data/docs/subcommands/compute-engine/server_resume.md +38 -0
- data/docs/subcommands/{server_start.md → compute-engine/server_start.md} +6 -0
- data/docs/subcommands/{server_stop.md → compute-engine/server_stop.md} +6 -0
- data/docs/subcommands/compute-engine/server_suspend.md +38 -0
- data/docs/subcommands/compute-engine/server_token.md +42 -0
- data/docs/subcommands/compute-engine/server_update.md +63 -0
- data/docs/subcommands/compute-engine/server_upgrade.md +42 -0
- data/docs/subcommands/{snapshot_create.md → compute-engine/snapshot_create.md} +7 -1
- data/docs/subcommands/{snapshot_delete.md → compute-engine/snapshot_delete.md} +7 -1
- data/docs/subcommands/compute-engine/snapshot_get.md +38 -0
- data/docs/subcommands/{snapshot_list.md → compute-engine/snapshot_list.md} +7 -1
- data/docs/subcommands/{snapshot_restore.md → compute-engine/snapshot_restore.md} +7 -1
- data/docs/subcommands/compute-engine/snapshot_update.md +80 -0
- data/docs/subcommands/compute-engine/template_list.md +34 -0
- data/docs/subcommands/{volume_attach.md → compute-engine/volume_attach.md} +6 -0
- data/docs/subcommands/{volume_create.md → compute-engine/volume_create.md} +14 -5
- data/docs/subcommands/{volume_delete.md → compute-engine/volume_delete.md} +6 -0
- data/docs/subcommands/{volume_detach.md → compute-engine/volume_detach.md} +6 -0
- data/docs/subcommands/compute-engine/volume_get.md +42 -0
- data/docs/subcommands/{volume_list.md → compute-engine/volume_list.md} +7 -1
- data/docs/subcommands/compute-engine/volume_update.md +69 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_backup_get.md +38 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_backup_list.md +38 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_create.md +100 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_delete.md +34 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_get.md +38 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_list.md +34 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_restore.md +44 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_update.md +65 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_logs_get.md +47 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_version_list.md +38 -0
- data/docs/subcommands/kubernetes/k8s_create.md +53 -0
- data/docs/subcommands/{k8s_delete.md → kubernetes/k8s_delete.md} +7 -1
- data/docs/subcommands/kubernetes/k8s_get.md +38 -0
- data/docs/subcommands/{k8s_list.md → kubernetes/k8s_list.md} +7 -1
- data/docs/subcommands/kubernetes/k8s_update.md +56 -0
- data/docs/subcommands/{kubeconfig_get.md → kubernetes/kubeconfig_get.md} +7 -1
- data/docs/subcommands/{node_delete.md → kubernetes/node_delete.md} +6 -0
- data/docs/subcommands/kubernetes/node_get.md +46 -0
- data/docs/subcommands/{node_list.md → kubernetes/node_list.md} +7 -1
- data/docs/subcommands/{node_replace.md → kubernetes/node_replace.md} +6 -0
- data/docs/subcommands/{nodepool_create.md → kubernetes/nodepool_create.md} +16 -1
- data/docs/subcommands/{nodepool_delete.md → kubernetes/nodepool_delete.md} +6 -0
- data/docs/subcommands/kubernetes/nodepool_get.md +42 -0
- data/docs/subcommands/kubernetes/nodepool_lan_add.md +52 -0
- data/docs/subcommands/kubernetes/nodepool_lan_remove.md +42 -0
- data/docs/subcommands/{nodepool_list.md → kubernetes/nodepool_list.md} +7 -1
- data/docs/subcommands/kubernetes/nodepool_update.md +72 -0
- data/docs/subcommands/{contract_list.md → user/contract_list.md} +7 -1
- data/docs/subcommands/{group_create.md → user/group_create.md} +16 -1
- data/docs/subcommands/{group_delete.md → user/group_delete.md} +7 -1
- data/docs/subcommands/{group_get.md → user/group_get.md} +7 -1
- data/docs/subcommands/{group_list.md → user/group_list.md} +7 -1
- data/docs/subcommands/user/group_update.md +77 -0
- data/docs/subcommands/{group_user_add.md → user/group_user_add.md} +6 -0
- data/docs/subcommands/{group_user_remove.md → user/group_user_remove.md} +6 -0
- data/docs/subcommands/{resource_list.md → user/resource_list.md} +7 -1
- data/docs/subcommands/{s3key_create.md → user/s3key_create.md} +7 -1
- data/docs/subcommands/{s3key_delete.md → user/s3key_delete.md} +6 -0
- data/docs/subcommands/user/s3key_get.md +42 -0
- data/docs/subcommands/{s3key_list.md → user/s3key_list.md} +7 -1
- data/docs/subcommands/{share_create.md → user/share_create.md} +7 -1
- data/docs/subcommands/{share_delete.md → user/share_delete.md} +6 -0
- data/docs/subcommands/user/share_get.md +42 -0
- data/docs/subcommands/{share_list.md → user/share_list.md} +7 -1
- data/docs/subcommands/user/share_update.md +48 -0
- data/docs/subcommands/{user_create.md → user/user_create.md} +7 -1
- data/docs/subcommands/{user_delete.md → user/user_delete.md} +7 -1
- data/docs/subcommands/user/user_get.md +38 -0
- data/docs/subcommands/{user_list.md → user/user_list.md} +7 -1
- data/docs/subcommands/{user_ssourl.md → user/user_ssourl.md} +7 -1
- data/docs/subcommands/user/user_update.md +59 -0
- data/docs/summary.md +167 -82
- data/docs/templates/summary.mustache +6 -3
- data/knife-ionoscloud.gemspec +2 -1
- data/lib/chef/knife/ionoscloud_backupunit_create.rb +12 -16
- data/lib/chef/knife/ionoscloud_backupunit_delete.rb +3 -6
- data/lib/chef/knife/ionoscloud_backupunit_get.rb +32 -0
- data/lib/chef/knife/ionoscloud_backupunit_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_backupunit_ssourl.rb +2 -2
- data/lib/chef/knife/ionoscloud_backupunit_update.rb +61 -0
- data/lib/chef/knife/ionoscloud_base.rb +417 -1
- data/lib/chef/knife/ionoscloud_composite_server_create.rb +7 -11
- data/lib/chef/knife/ionoscloud_contract_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_cube_server_create.rb +7 -11
- data/lib/chef/knife/ionoscloud_datacenter_create.rb +12 -15
- data/lib/chef/knife/ionoscloud_datacenter_delete.rb +3 -8
- data/lib/chef/knife/ionoscloud_datacenter_get.rb +32 -0
- data/lib/chef/knife/ionoscloud_datacenter_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_datacenter_update.rb +66 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_backup_get.rb +33 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_backup_list.rb +59 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_create.rb +158 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_delete.rb +49 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_get.rb +34 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_list.rb +53 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_restore.rb +48 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_update.rb +102 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_logs_get.rb +59 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_version_list.rb +49 -0
- data/lib/chef/knife/ionoscloud_firewall_create.rb +10 -24
- data/lib/chef/knife/ionoscloud_firewall_delete.rb +4 -13
- data/lib/chef/knife/ionoscloud_firewall_get.rb +51 -0
- data/lib/chef/knife/ionoscloud_firewall_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_firewall_update.rb +131 -0
- data/lib/chef/knife/ionoscloud_flowlog_create.rb +6 -14
- data/lib/chef/knife/ionoscloud_flowlog_delete.rb +10 -14
- data/lib/chef/knife/ionoscloud_flowlog_get.rb +83 -0
- data/lib/chef/knife/ionoscloud_flowlog_list.rb +4 -4
- data/lib/chef/knife/ionoscloud_flowlog_update.rb +124 -0
- data/lib/chef/knife/ionoscloud_group_create.rb +3 -18
- data/lib/chef/knife/ionoscloud_group_delete.rb +3 -20
- data/lib/chef/knife/ionoscloud_group_get.rb +3 -21
- data/lib/chef/knife/ionoscloud_group_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_group_update.rb +130 -0
- data/lib/chef/knife/ionoscloud_group_user_add.rb +3 -20
- data/lib/chef/knife/ionoscloud_group_user_remove.rb +3 -20
- data/lib/chef/knife/ionoscloud_image_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_ipblock_create.rb +12 -15
- data/lib/chef/knife/ionoscloud_ipblock_delete.rb +3 -6
- data/lib/chef/knife/ionoscloud_ipblock_get.rb +32 -0
- data/lib/chef/knife/ionoscloud_ipblock_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_ipblock_update.rb +56 -0
- data/lib/chef/knife/ionoscloud_ipfailover_add.rb +3 -3
- data/lib/chef/knife/ionoscloud_ipfailover_remove.rb +3 -3
- data/lib/chef/knife/ionoscloud_k8s_create.rb +28 -36
- data/lib/chef/knife/ionoscloud_k8s_delete.rb +3 -11
- data/lib/chef/knife/ionoscloud_k8s_get.rb +32 -0
- data/lib/chef/knife/ionoscloud_k8s_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_k8s_update.rb +98 -0
- data/lib/chef/knife/ionoscloud_kubeconfig_get.rb +2 -2
- data/lib/chef/knife/ionoscloud_label_add.rb +2 -2
- data/lib/chef/knife/ionoscloud_label_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_label_remove.rb +2 -2
- data/lib/chef/knife/ionoscloud_lan_create.rb +8 -17
- data/lib/chef/knife/ionoscloud_lan_delete.rb +5 -6
- data/lib/chef/knife/ionoscloud_lan_get.rb +37 -0
- data/lib/chef/knife/ionoscloud_lan_list.rb +4 -3
- data/lib/chef/knife/ionoscloud_lan_update.rb +75 -0
- data/lib/chef/knife/ionoscloud_loadbalancer_create.rb +7 -16
- data/lib/chef/knife/ionoscloud_loadbalancer_delete.rb +3 -10
- data/lib/chef/knife/ionoscloud_loadbalancer_get.rb +4 -14
- data/lib/chef/knife/ionoscloud_loadbalancer_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_add.rb +4 -16
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_remove.rb +4 -17
- data/lib/chef/knife/ionoscloud_loadbalancer_update.rb +72 -0
- data/lib/chef/knife/ionoscloud_location_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_natgateway_create.rb +7 -19
- data/lib/chef/knife/ionoscloud_natgateway_delete.rb +4 -20
- data/lib/chef/knife/ionoscloud_natgateway_get.rb +41 -0
- data/lib/chef/knife/ionoscloud_natgateway_lan_add.rb +4 -13
- data/lib/chef/knife/ionoscloud_natgateway_lan_remove.rb +3 -10
- data/lib/chef/knife/ionoscloud_natgateway_list.rb +3 -2
- data/lib/chef/knife/ionoscloud_natgateway_rule_add.rb +8 -28
- data/lib/chef/knife/ionoscloud_natgateway_rule_list.rb +3 -2
- data/lib/chef/knife/ionoscloud_natgateway_rule_remove.rb +5 -23
- data/lib/chef/knife/ionoscloud_natgateway_rule_update.rb +115 -0
- data/lib/chef/knife/ionoscloud_natgateway_update.rb +83 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_create.rb +8 -15
- data/lib/chef/knife/ionoscloud_networkloadbalancer_delete.rb +4 -24
- data/lib/chef/knife/ionoscloud_networkloadbalancer_get.rb +41 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_add.rb +32 -48
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_list.rb +3 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_remove.rb +21 -32
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_add.rb +7 -26
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_list.rb +3 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove.rb +6 -24
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_update.rb +147 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_update.rb +97 -0
- data/lib/chef/knife/ionoscloud_nic_create.rb +10 -24
- data/lib/chef/knife/ionoscloud_nic_delete.rb +4 -10
- data/lib/chef/knife/ionoscloud_nic_get.rb +48 -0
- data/lib/chef/knife/ionoscloud_nic_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_nic_update.rb +95 -0
- data/lib/chef/knife/ionoscloud_node_delete.rb +2 -2
- data/lib/chef/knife/ionoscloud_node_get.rb +48 -0
- data/lib/chef/knife/ionoscloud_node_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_node_replace.rb +2 -2
- data/lib/chef/knife/ionoscloud_nodepool_create.rb +27 -59
- data/lib/chef/knife/ionoscloud_nodepool_delete.rb +3 -34
- data/lib/chef/knife/ionoscloud_nodepool_get.rb +42 -0
- data/lib/chef/knife/ionoscloud_nodepool_lan_add.rb +4 -32
- data/lib/chef/knife/ionoscloud_nodepool_lan_remove.rb +3 -28
- data/lib/chef/knife/ionoscloud_nodepool_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_nodepool_update.rb +123 -0
- data/lib/chef/knife/ionoscloud_pcc_create.rb +13 -19
- data/lib/chef/knife/ionoscloud_pcc_delete.rb +3 -11
- data/lib/chef/knife/ionoscloud_pcc_get.rb +32 -0
- data/lib/chef/knife/ionoscloud_pcc_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_pcc_update.rb +62 -0
- data/lib/chef/knife/ionoscloud_request_get.rb +39 -0
- data/lib/chef/knife/ionoscloud_request_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_request_status.rb +2 -2
- data/lib/chef/knife/ionoscloud_request_wait.rb +2 -2
- data/lib/chef/knife/ionoscloud_resource_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_s3key_create.rb +3 -7
- data/lib/chef/knife/ionoscloud_s3key_delete.rb +3 -6
- data/lib/chef/knife/ionoscloud_s3key_get.rb +37 -0
- data/lib/chef/knife/ionoscloud_s3key_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_console.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_create.rb +16 -30
- data/lib/chef/knife/ionoscloud_server_delete.rb +4 -10
- data/lib/chef/knife/ionoscloud_server_get.rb +42 -0
- data/lib/chef/knife/ionoscloud_server_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_reboot.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_resume.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_start.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_stop.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_suspend.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_token.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_update.rb +96 -0
- data/lib/chef/knife/ionoscloud_server_upgrade.rb +2 -2
- data/lib/chef/knife/ionoscloud_share_create.rb +9 -13
- data/lib/chef/knife/ionoscloud_share_delete.rb +4 -5
- data/lib/chef/knife/ionoscloud_share_get.rb +37 -0
- data/lib/chef/knife/ionoscloud_share_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_share_update.rb +69 -0
- data/lib/chef/knife/ionoscloud_snapshot_create.rb +3 -11
- data/lib/chef/knife/ionoscloud_snapshot_delete.rb +3 -8
- data/lib/chef/knife/ionoscloud_snapshot_get.rb +31 -0
- data/lib/chef/knife/ionoscloud_snapshot_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_snapshot_restore.rb +3 -14
- data/lib/chef/knife/ionoscloud_snapshot_update.rb +125 -0
- data/lib/chef/knife/ionoscloud_template_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_user_create.rb +3 -10
- data/lib/chef/knife/ionoscloud_user_delete.rb +3 -8
- data/lib/chef/knife/ionoscloud_user_get.rb +31 -0
- data/lib/chef/knife/ionoscloud_user_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_user_ssourl.rb +2 -2
- data/lib/chef/knife/ionoscloud_user_update.rb +91 -0
- data/lib/chef/knife/ionoscloud_volume_attach.rb +2 -2
- data/lib/chef/knife/ionoscloud_volume_create.rb +4 -15
- data/lib/chef/knife/ionoscloud_volume_delete.rb +4 -10
- data/lib/chef/knife/ionoscloud_volume_detach.rb +2 -2
- data/lib/chef/knife/ionoscloud_volume_get.rb +35 -0
- data/lib/chef/knife/ionoscloud_volume_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_volume_update.rb +105 -0
- data/lib/knife-ionoscloud/version.rb +1 -1
- data/spec/chef/knife/ionoscloud_backupunit_get_spec.rb +65 -0
- data/spec/chef/knife/ionoscloud_backupunit_update_spec.rb +78 -0
- data/spec/chef/knife/ionoscloud_datacenter_create_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_datacenter_delete_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_datacenter_get_spec.rb +69 -0
- data/spec/chef/knife/ionoscloud_datacenter_update_spec.rb +82 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_backup_get_spec.rb +67 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_backup_list_spec.rb +111 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_create_spec.rb +99 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_delete_spec.rb +109 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_get_spec.rb +73 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_list_spec.rb +84 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_restore_spec.rb +59 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_update_spec.rb +89 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_logs_get_spec.rb +67 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_version_list_spec.rb +94 -0
- data/spec/chef/knife/ionoscloud_firewall_create_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_firewall_delete_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_firewall_get_spec.rb +77 -0
- data/spec/chef/knife/ionoscloud_firewall_update_spec.rb +117 -0
- data/spec/chef/knife/ionoscloud_flowlog_create_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_flowlog_delete_spec.rb +10 -10
- data/spec/chef/knife/ionoscloud_flowlog_get_spec.rb +171 -0
- data/spec/chef/knife/ionoscloud_flowlog_list_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_flowlog_update_spec.rb +244 -0
- data/spec/chef/knife/ionoscloud_group_create_spec.rb +3 -0
- 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_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_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_update_spec.rb +89 -0
- data/spec/chef/knife/ionoscloud_natgateway_create_spec.rb +15 -0
- data/spec/chef/knife/ionoscloud_natgateway_get_spec.rb +81 -0
- data/spec/chef/knife/ionoscloud_natgateway_lan_add_spec.rb +15 -0
- data/spec/chef/knife/ionoscloud_natgateway_lan_remove_spec.rb +15 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_add_spec.rb +1 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_remove_spec.rb +1 -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 +13 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_delete_spec.rb +3 -2
- data/spec/chef/knife/ionoscloud_networkloadbalancer_get_spec.rb +82 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_add_spec.rb +4 -3
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_remove_spec.rb +70 -44
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_add_spec.rb +26 -22
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove_spec.rb +79 -61
- 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_get_spec.rb +72 -0
- 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 +8 -17
- 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 +29 -33
- data/spec/chef/knife/ionoscloud_nodepool_lan_remove.rb +14 -17
- data/spec/chef/knife/ionoscloud_nodepool_update_spec.rb +134 -0
- data/spec/chef/knife/ionoscloud_pcc_create_spec.rb +7 -4
- data/spec/chef/knife/ionoscloud_pcc_delete_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_pcc_get_spec.rb +71 -0
- 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_s3key_get_spec.rb +66 -0
- data/spec/chef/knife/ionoscloud_server_create_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_server_delete_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_server_get_spec.rb +74 -0
- data/spec/chef/knife/ionoscloud_server_update_spec.rb +105 -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 +12 -0
- data/spec/chef/knife/ionoscloud_snapshot_delete_spec.rb +12 -0
- data/spec/chef/knife/ionoscloud_snapshot_get_spec.rb +79 -0
- data/spec/chef/knife/ionoscloud_snapshot_restore_spec.rb +9 -0
- data/spec/chef/knife/ionoscloud_snapshot_update_spec.rb +113 -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_update_spec.rb +110 -0
- data/spec/chef/knife/ionoscloud_volume_create_spec.rb +15 -5
- data/spec/chef/knife/ionoscloud_volume_delete_spec.rb +10 -0
- data/spec/chef/knife/ionoscloud_volume_get_spec.rb +81 -0
- data/spec/chef/knife/ionoscloud_volume_update_spec.rb +116 -0
- data/spec/spec_helper.rb +148 -23
- metadata +336 -90
- data/docs/subcommands/k8s_create.md +0 -47
- data/spec/test.sh +0 -3
@@ -36,19 +36,19 @@ class Chef
|
|
36
36
|
long: '--sec-auth',
|
37
37
|
description: 'Indicates if secure (two-factor) authentication should be forced for the user.'
|
38
38
|
|
39
|
-
attr_reader :description, :required_options
|
40
|
-
|
41
39
|
def initialize(args = [])
|
42
40
|
super(args)
|
43
41
|
@description =
|
44
42
|
'Creates a new user under a particular contract. **Please Note**: The password set '\
|
45
43
|
'here cannot be updated through the API currently. It is recommended that a new user '\
|
46
44
|
'log into the DCD and change their password.'
|
45
|
+
@directory = 'user'
|
47
46
|
@required_options = [:firstname, :lastname, :email, :password, :ionoscloud_username, :ionoscloud_password]
|
48
47
|
end
|
49
48
|
|
50
49
|
def run
|
51
50
|
$stdout.sync = true
|
51
|
+
handle_extra_config
|
52
52
|
validate_required_params(@required_options, config)
|
53
53
|
|
54
54
|
print "#{ui.color('Creating user...', :magenta)}"
|
@@ -69,14 +69,7 @@ class Chef
|
|
69
69
|
dot = ui.color('.', :magenta)
|
70
70
|
api_client.wait_for { print dot; is_done? get_request_id headers }
|
71
71
|
|
72
|
-
|
73
|
-
puts "#{ui.color('ID', :cyan)}: #{user.id}"
|
74
|
-
puts "#{ui.color('Firstname', :cyan)}: #{user.properties.firstname}"
|
75
|
-
puts "#{ui.color('Lastname', :cyan)}: #{user.properties.lastname}"
|
76
|
-
puts "#{ui.color('Email', :cyan)}: #{user.properties.email}"
|
77
|
-
puts "#{ui.color('Administrator', :cyan)}: #{user.properties.administrator.to_s}"
|
78
|
-
puts "#{ui.color('2-Factor Auth', :cyan)}: #{user.properties.force_sec_auth.to_s}"
|
79
|
-
puts 'done'
|
72
|
+
print_user(user)
|
80
73
|
end
|
81
74
|
end
|
82
75
|
end
|
@@ -7,19 +7,19 @@ class Chef
|
|
7
7
|
|
8
8
|
banner 'knife ionoscloud user delete USER_ID [USER_ID]'
|
9
9
|
|
10
|
-
attr_reader :description, :required_options
|
11
|
-
|
12
10
|
def initialize(args = [])
|
13
11
|
super(args)
|
14
12
|
@description =
|
15
13
|
'Blacklists the user, disabling them. The user is not completely purged, '\
|
16
14
|
'therefore if you anticipate needing to create a user with the same name '\
|
17
15
|
'in the future, we suggest renaming the user before you delete it.'
|
16
|
+
@directory = 'user'
|
18
17
|
@required_options = [:ionoscloud_username, :ionoscloud_password]
|
19
18
|
end
|
20
19
|
|
21
20
|
def run
|
22
21
|
$stdout.sync = true
|
22
|
+
handle_extra_config
|
23
23
|
validate_required_params(@required_options, config)
|
24
24
|
|
25
25
|
user_management_api = Ionoscloud::UserManagementApi.new(api_client)
|
@@ -33,12 +33,7 @@ class Chef
|
|
33
33
|
next
|
34
34
|
end
|
35
35
|
|
36
|
-
|
37
|
-
msg_pair('Firstname', user.properties.firstname)
|
38
|
-
msg_pair('Lastname', user.properties.lastname)
|
39
|
-
msg_pair('Email', user.properties.email)
|
40
|
-
msg_pair('Administrator', user.properties.administrator.to_s)
|
41
|
-
msg_pair('2-Factor Auth', user.properties.force_sec_auth.to_s)
|
36
|
+
print_user(user)
|
42
37
|
puts "\n"
|
43
38
|
|
44
39
|
begin
|
@@ -0,0 +1,31 @@
|
|
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
|
+
def initialize(args = [])
|
16
|
+
super(args)
|
17
|
+
@description =
|
18
|
+
'Retrieves the attributes of a given Ionoscloud User.'
|
19
|
+
@directory = 'user'
|
20
|
+
@required_options = [:user_id, :ionoscloud_username, :ionoscloud_password]
|
21
|
+
end
|
22
|
+
|
23
|
+
def run
|
24
|
+
$stdout.sync = true
|
25
|
+
handle_extra_config
|
26
|
+
validate_required_params(@required_options, config)
|
27
|
+
print_user(Ionoscloud::UserManagementApi.new(api_client).um_users_find_by_id(config[:user_id]))
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -12,19 +12,19 @@ class Chef
|
|
12
12
|
long: '--group-id GROUP_ID',
|
13
13
|
description: 'ID of the group.'
|
14
14
|
|
15
|
-
attr_reader :description, :required_options
|
16
|
-
|
17
15
|
def initialize(args = [])
|
18
16
|
super(args)
|
19
17
|
@description =
|
20
18
|
'Retrieve a list of all the users that have been created under a contract. '\
|
21
19
|
'You can retrieve a list of users who are members of the group by passing the '\
|
22
20
|
'_group\_id_ option.'
|
21
|
+
@directory = 'user'
|
23
22
|
@required_options = [:ionoscloud_username, :ionoscloud_password]
|
24
23
|
end
|
25
24
|
|
26
25
|
def run
|
27
26
|
$stdout.sync = true
|
27
|
+
handle_extra_config
|
28
28
|
validate_required_params(@required_options, config)
|
29
29
|
|
30
30
|
user_list = [
|
@@ -12,17 +12,17 @@ class Chef
|
|
12
12
|
long: '--user-id USER_ID',
|
13
13
|
description: 'The ID of the Backup unit.'
|
14
14
|
|
15
|
-
attr_reader :description, :required_options
|
16
|
-
|
17
15
|
def initialize(args = [])
|
18
16
|
super(args)
|
19
17
|
@description =
|
20
18
|
'Retrieve S3 object storage single signon URL for the given user.'
|
19
|
+
@directory = 'user'
|
21
20
|
@required_options = [:user_id, :ionoscloud_username, :ionoscloud_password]
|
22
21
|
end
|
23
22
|
|
24
23
|
def run
|
25
24
|
$stdout.sync = true
|
25
|
+
handle_extra_config
|
26
26
|
validate_required_params(@required_options, config)
|
27
27
|
|
28
28
|
begin
|
@@ -0,0 +1,91 @@
|
|
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
|
+
def initialize(args = [])
|
47
|
+
super(args)
|
48
|
+
@description =
|
49
|
+
'Updates information about a Ionoscloud User.'
|
50
|
+
@directory = 'user'
|
51
|
+
@required_options = [:user_id, :ionoscloud_username, :ionoscloud_password]
|
52
|
+
@updatable_fields = [:firstname, :lastname, :email, :administrator, :force_sec_auth, :sec_auth_active, :active]
|
53
|
+
end
|
54
|
+
|
55
|
+
def run
|
56
|
+
$stdout.sync = true
|
57
|
+
handle_extra_config
|
58
|
+
validate_required_params(@required_options, config)
|
59
|
+
|
60
|
+
user_management_api = Ionoscloud::UserManagementApi.new(api_client)
|
61
|
+
|
62
|
+
if @updatable_fields.map { |el| config[el] }.any?
|
63
|
+
print "#{ui.color('Updating User...', :magenta)}"
|
64
|
+
|
65
|
+
user = user_management_api.um_users_find_by_id(config[:user_id])
|
66
|
+
|
67
|
+
new_user = Ionoscloud::UserPut.new(
|
68
|
+
properties: Ionoscloud::UserPropertiesPut.new(
|
69
|
+
firstname: config[:firstname] || user.properties.firstname,
|
70
|
+
lastname: config[:lastname] || user.properties.lastname,
|
71
|
+
email: config[:email] || user.properties.email,
|
72
|
+
administrator: (config.key?(:administrator) ? config[:administrator].to_s.downcase == 'true' : user.properties.administrator),
|
73
|
+
force_sec_auth: (config.key?(:force_sec_auth) ? config[:force_sec_auth].to_s.downcase == 'true' : user.properties.force_sec_auth),
|
74
|
+
sec_auth_active: (config.key?(:sec_auth_active) ? config[:sec_auth_active].to_s.downcase == 'true' : user.properties.sec_auth_active),
|
75
|
+
active: (config.key?(:active) ? config[:active].to_s.downcase == 'true' : user.properties.active),
|
76
|
+
),
|
77
|
+
)
|
78
|
+
|
79
|
+
_, _, headers = user_management_api.um_users_put_with_http_info(config[:user_id], new_user)
|
80
|
+
|
81
|
+
dot = ui.color('.', :magenta)
|
82
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
83
|
+
else
|
84
|
+
ui.warn("Nothing to update, please set one of the attributes #{@updatable_fields}.")
|
85
|
+
end
|
86
|
+
|
87
|
+
print_user(user_management_api.um_users_find_by_id(config[:user_id]))
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -17,17 +17,17 @@ class Chef
|
|
17
17
|
long: '--server-id SERVER_ID',
|
18
18
|
description: 'The ID of the server'
|
19
19
|
|
20
|
-
attr_reader :description, :required_options
|
21
|
-
|
22
20
|
def initialize(args = [])
|
23
21
|
super(args)
|
24
22
|
@description =
|
25
23
|
'This will attach a pre-existing storage volume to the server.'
|
24
|
+
@directory = 'compute-engine'
|
26
25
|
@required_options = [:datacenter_id, :server_id, :ionoscloud_username, :ionoscloud_password]
|
27
26
|
end
|
28
27
|
|
29
28
|
def run
|
30
29
|
$stdout.sync = true
|
30
|
+
handle_extra_config
|
31
31
|
validate_required_params(@required_options, config)
|
32
32
|
|
33
33
|
server_api = Ionoscloud::ServersApi.new(api_client)
|
@@ -71,21 +71,21 @@ class Chef
|
|
71
71
|
'immutable and is only allowed to be set on a new volume creation. It is mandatory to provide either \'public image\' '\
|
72
72
|
'or \'imageAlias\' that has cloud-init compatibility in conjunction with this property.'
|
73
73
|
|
74
|
-
attr_reader :description, :required_options
|
75
|
-
|
76
74
|
def initialize(args = [])
|
77
75
|
super(args)
|
78
76
|
@description =
|
79
77
|
'Creates a volume within the data center. This will NOT attach the volume to a server. '\
|
80
78
|
'Please see the Servers section for details on how to attach storage volumes.'
|
79
|
+
@directory = 'compute-engine'
|
81
80
|
@required_options = [:datacenter_id, :name, :type, :size, :ionoscloud_username, :ionoscloud_password]
|
82
81
|
end
|
83
82
|
|
84
83
|
def run
|
85
84
|
$stdout.sync = true
|
85
|
+
handle_extra_config
|
86
86
|
validate_required_params(@required_options, config)
|
87
87
|
|
88
|
-
config[:ssh_keys] = config[:ssh_keys].split(',') if config[:ssh_keys]
|
88
|
+
config[:ssh_keys] = config[:ssh_keys].split(',') if config[:ssh_keys] && config[:ssh_keys].instance_of?(String)
|
89
89
|
|
90
90
|
print "#{ui.color('Creating volume...', :magenta)}"
|
91
91
|
|
@@ -113,18 +113,7 @@ class Chef
|
|
113
113
|
dot = ui.color('.', :magenta)
|
114
114
|
api_client.wait_for(300) { print dot; is_done? get_request_id headers }
|
115
115
|
|
116
|
-
|
117
|
-
|
118
|
-
puts "\n"
|
119
|
-
puts "#{ui.color('ID', :cyan)}: #{volume.id}"
|
120
|
-
puts "#{ui.color('Name', :cyan)}: #{volume.properties.name}"
|
121
|
-
puts "#{ui.color('Size', :cyan)}: #{volume.properties.size}"
|
122
|
-
puts "#{ui.color('Bus', :cyan)}: #{volume.properties.bus}"
|
123
|
-
puts "#{ui.color('Image', :cyan)}: #{volume.properties.image}"
|
124
|
-
puts "#{ui.color('Type', :cyan)}: #{volume.properties.type}"
|
125
|
-
puts "#{ui.color('Licence Type', :cyan)}: #{volume.properties.licence_type}"
|
126
|
-
puts "#{ui.color('Zone', :cyan)}: #{volume.properties.availability_zone}"
|
127
|
-
puts 'done'
|
116
|
+
print_volume(volume_api.datacenters_volumes_find_by_id(config[:datacenter_id], volume.id))
|
128
117
|
end
|
129
118
|
end
|
130
119
|
end
|
@@ -12,18 +12,18 @@ class Chef
|
|
12
12
|
long: '--datacenter-id DATACENTER_ID',
|
13
13
|
description: 'Name of the data center'
|
14
14
|
|
15
|
-
attr_reader :description, :required_options
|
16
|
-
|
17
15
|
def initialize(args = [])
|
18
16
|
super(args)
|
19
17
|
@description =
|
20
18
|
'Deletes the specified volume. This will result in the volume being '\
|
21
19
|
'removed from your virtual data center. Please use this with caution!'
|
20
|
+
@directory = 'compute-engine'
|
22
21
|
@required_options = [:datacenter_id, :ionoscloud_username, :ionoscloud_password]
|
23
22
|
end
|
24
23
|
|
25
24
|
def run
|
26
25
|
$stdout.sync = true
|
26
|
+
handle_extra_config
|
27
27
|
validate_required_params(@required_options, config)
|
28
28
|
|
29
29
|
volume_api = Ionoscloud::VolumesApi.new(api_client)
|
@@ -40,14 +40,8 @@ class Chef
|
|
40
40
|
next
|
41
41
|
end
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
msg_pair('Size', volume.properties.size)
|
46
|
-
msg_pair('Bus', volume.properties.bus)
|
47
|
-
msg_pair('Image', volume.properties.image)
|
48
|
-
msg_pair('Type', volume.properties.type)
|
49
|
-
msg_pair('Licence Type', volume.properties.licence_type)
|
50
|
-
msg_pair('Zone', volume.properties.availability_zone)
|
43
|
+
print_volume(volume)
|
44
|
+
puts "\n"
|
51
45
|
|
52
46
|
begin
|
53
47
|
confirm('Do you really want to delete this volume')
|
@@ -17,8 +17,6 @@ class Chef
|
|
17
17
|
long: '--server-id SERVER_ID',
|
18
18
|
description: 'The ID of the server'
|
19
19
|
|
20
|
-
attr_reader :description, :required_options
|
21
|
-
|
22
20
|
def initialize(args = [])
|
23
21
|
super(args)
|
24
22
|
@description =
|
@@ -26,11 +24,13 @@ class Chef
|
|
26
24
|
"HotUnplug settings, this may result in the server being rebooted.\n\n"\
|
27
25
|
"This will NOT delete the volume from your virtual data center. You will "\
|
28
26
|
"need to make a separate request to delete a volume."
|
27
|
+
@directory = 'compute-engine'
|
29
28
|
@required_options = [:datacenter_id, :server_id, :ionoscloud_username, :ionoscloud_password]
|
30
29
|
end
|
31
30
|
|
32
31
|
def run
|
33
32
|
$stdout.sync = true
|
33
|
+
handle_extra_config
|
34
34
|
validate_required_params(@required_options, config)
|
35
35
|
|
36
36
|
server_api = Ionoscloud::ServersApi.new(api_client)
|
@@ -0,0 +1,35 @@
|
|
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
|
+
def initialize(args = [])
|
20
|
+
super(args)
|
21
|
+
@description =
|
22
|
+
'Retrieves the attributes of a given Volume.'
|
23
|
+
@directory = 'compute-engine'
|
24
|
+
@required_options = [:datacenter_id, :volume_id, :ionoscloud_username, :ionoscloud_password]
|
25
|
+
end
|
26
|
+
|
27
|
+
def run
|
28
|
+
$stdout.sync = true
|
29
|
+
handle_extra_config
|
30
|
+
validate_required_params(@required_options, config)
|
31
|
+
print_volume(Ionoscloud::VolumesApi.new(api_client).datacenters_volumes_find_by_id(config[:datacenter_id], config[:volume_id]))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -17,18 +17,18 @@ class Chef
|
|
17
17
|
long: '--server-id SERVER_ID',
|
18
18
|
description: 'The ID of the server'
|
19
19
|
|
20
|
-
attr_reader :description, :required_options
|
21
|
-
|
22
20
|
def initialize(args = [])
|
23
21
|
super(args)
|
24
22
|
@description =
|
25
23
|
'List all available volumes under a data center. '\
|
26
24
|
'You can also list all volumes attached to a specific server.'
|
25
|
+
@directory = 'compute-engine'
|
27
26
|
@required_options = [:datacenter_id, :ionoscloud_username, :ionoscloud_password]
|
28
27
|
end
|
29
28
|
|
30
29
|
def run
|
31
30
|
$stdout.sync = true
|
31
|
+
handle_extra_config
|
32
32
|
validate_required_params(@required_options, config)
|
33
33
|
|
34
34
|
volume_list = [
|
@@ -0,0 +1,105 @@
|
|
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
|
+
def initialize(args = [])
|
59
|
+
super(args)
|
60
|
+
@description =
|
61
|
+
'Updates information about a Ionoscloud Volume.'
|
62
|
+
@directory = 'compute-engine'
|
63
|
+
@required_options = [:datacenter_id, :volume_id, :ionoscloud_username, :ionoscloud_password]
|
64
|
+
@updatable_fields = [
|
65
|
+
:name, :size, :bus, :cpu_hot_plug, :ram_hot_plug, :nic_hot_plug, :nic_hot_unplug, :disc_virtio_hot_plug, :disc_virtio_hot_unplug,
|
66
|
+
]
|
67
|
+
end
|
68
|
+
|
69
|
+
def run
|
70
|
+
$stdout.sync = true
|
71
|
+
handle_extra_config
|
72
|
+
validate_required_params(@required_options, config)
|
73
|
+
|
74
|
+
volume_api = Ionoscloud::VolumesApi.new(api_client)
|
75
|
+
|
76
|
+
if @updatable_fields.map { |el| config[el] }.any?
|
77
|
+
print "#{ui.color('Updating Volume...', :magenta)}"
|
78
|
+
|
79
|
+
_, _, headers = volume_api.datacenters_volumes_patch_with_http_info(
|
80
|
+
config[:datacenter_id],
|
81
|
+
config[:volume_id],
|
82
|
+
Ionoscloud::VolumeProperties.new(
|
83
|
+
name: config[:name],
|
84
|
+
size: config[:size],
|
85
|
+
bus: config[:bus],
|
86
|
+
cpu_hot_plug: (config.key?(:cpu_hot_plug) ? config[:cpu_hot_plug].to_s.downcase == 'true' : nil),
|
87
|
+
ram_hot_plug: (config.key?(:ram_hot_plug) ? config[:ram_hot_plug].to_s.downcase == 'true' : nil),
|
88
|
+
nic_hot_plug: (config.key?(:nic_hot_plug) ? config[:nic_hot_plug].to_s.downcase == 'true' : nil),
|
89
|
+
nic_hot_unplug: (config.key?(:nic_hot_unplug) ? config[:nic_hot_unplug].to_s.downcase == 'true' : nil),
|
90
|
+
disc_virtio_hot_plug: (config.key?(:disc_virtio_hot_plug) ? config[:disc_virtio_hot_plug].to_s.downcase == 'true' : nil),
|
91
|
+
disc_virtio_hot_unplug: (config.key?(:disc_virtio_hot_unplug) ? config[:disc_virtio_hot_unplug].to_s.downcase == 'true' : nil),
|
92
|
+
),
|
93
|
+
)
|
94
|
+
|
95
|
+
dot = ui.color('.', :magenta)
|
96
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
97
|
+
else
|
98
|
+
ui.warn("Nothing to update, please set one of the attributes #{@updatable_fields}.")
|
99
|
+
end
|
100
|
+
|
101
|
+
print_volume(volume_api.datacenters_volumes_find_by_id(config[:datacenter_id], config[:volume_id]))
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -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
|