knife-ionoscloud 6.0.0 → 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/README.md +9 -0
- data/docs/README.md +6 -0
- data/docs/changelog.md +10 -0
- data/docs/docs_generator.rb +44 -9
- data/docs/subcommands/{backupunit_create.md → backup/backupunit_create.md} +1 -1
- data/docs/subcommands/{backupunit_delete.md → backup/backupunit_delete.md} +0 -0
- data/docs/subcommands/{backupunit_get.md → backup/backupunit_get.md} +0 -0
- data/docs/subcommands/{backupunit_list.md → backup/backupunit_list.md} +0 -0
- data/docs/subcommands/{backupunit_ssourl.md → backup/backupunit_ssourl.md} +0 -0
- data/docs/subcommands/{backupunit_update.md → backup/backupunit_update.md} +0 -0
- data/docs/subcommands/{composite_server_create.md → compute-engine/composite_server_create.md} +9 -3
- data/docs/subcommands/{cube_server_create.md → compute-engine/cube_server_create.md} +0 -0
- data/docs/subcommands/{datacenter_create.md → compute-engine/datacenter_create.md} +0 -0
- data/docs/subcommands/{datacenter_delete.md → compute-engine/datacenter_delete.md} +0 -0
- data/docs/subcommands/{datacenter_get.md → compute-engine/datacenter_get.md} +0 -0
- data/docs/subcommands/{datacenter_list.md → compute-engine/datacenter_list.md} +0 -0
- data/docs/subcommands/{datacenter_update.md → compute-engine/datacenter_update.md} +0 -0
- data/docs/subcommands/{firewall_create.md → compute-engine/firewall_create.md} +6 -3
- data/docs/subcommands/{firewall_delete.md → compute-engine/firewall_delete.md} +0 -0
- data/docs/subcommands/{firewall_get.md → compute-engine/firewall_get.md} +0 -0
- data/docs/subcommands/{firewall_list.md → compute-engine/firewall_list.md} +0 -0
- data/docs/subcommands/{firewall_update.md → compute-engine/firewall_update.md} +0 -0
- data/docs/subcommands/{flowlog_create.md → compute-engine/flowlog_create.md} +0 -0
- data/docs/subcommands/{flowlog_delete.md → compute-engine/flowlog_delete.md} +0 -0
- data/docs/subcommands/{flowlog_get.md → compute-engine/flowlog_get.md} +0 -0
- data/docs/subcommands/{flowlog_list.md → compute-engine/flowlog_list.md} +0 -0
- data/docs/subcommands/{flowlog_update.md → compute-engine/flowlog_update.md} +0 -0
- data/docs/subcommands/{image_list.md → compute-engine/image_list.md} +0 -0
- data/docs/subcommands/{ipblock_create.md → compute-engine/ipblock_create.md} +0 -0
- data/docs/subcommands/{ipblock_delete.md → compute-engine/ipblock_delete.md} +0 -0
- data/docs/subcommands/{ipblock_get.md → compute-engine/ipblock_get.md} +0 -0
- data/docs/subcommands/{ipblock_list.md → compute-engine/ipblock_list.md} +0 -0
- data/docs/subcommands/{ipblock_update.md → compute-engine/ipblock_update.md} +0 -0
- data/docs/subcommands/{ipfailover_add.md → compute-engine/ipfailover_add.md} +0 -0
- data/docs/subcommands/{ipfailover_remove.md → compute-engine/ipfailover_remove.md} +0 -0
- data/docs/subcommands/{label_add.md → compute-engine/label_add.md} +0 -0
- data/docs/subcommands/{label_list.md → compute-engine/label_list.md} +0 -0
- data/docs/subcommands/{label_remove.md → compute-engine/label_remove.md} +0 -0
- data/docs/subcommands/{lan_create.md → compute-engine/lan_create.md} +0 -0
- data/docs/subcommands/{lan_delete.md → compute-engine/lan_delete.md} +0 -0
- data/docs/subcommands/{lan_get.md → compute-engine/lan_get.md} +0 -0
- data/docs/subcommands/{lan_list.md → compute-engine/lan_list.md} +0 -0
- data/docs/subcommands/{lan_update.md → compute-engine/lan_update.md} +1 -4
- data/docs/subcommands/{loadbalancer_create.md → compute-engine/loadbalancer_create.md} +1 -1
- data/docs/subcommands/{loadbalancer_delete.md → compute-engine/loadbalancer_delete.md} +0 -0
- data/docs/subcommands/{loadbalancer_get.md → compute-engine/loadbalancer_get.md} +0 -0
- data/docs/subcommands/{loadbalancer_list.md → compute-engine/loadbalancer_list.md} +0 -0
- data/docs/subcommands/{loadbalancer_nic_add.md → compute-engine/loadbalancer_nic_add.md} +0 -0
- data/docs/subcommands/{loadbalancer_nic_remove.md → compute-engine/loadbalancer_nic_remove.md} +0 -0
- data/docs/subcommands/{loadbalancer_update.md → compute-engine/loadbalancer_update.md} +0 -0
- data/docs/subcommands/{location_list.md → compute-engine/location_list.md} +0 -0
- data/docs/subcommands/{natgateway_create.md → compute-engine/natgateway_create.md} +0 -0
- data/docs/subcommands/{natgateway_delete.md → compute-engine/natgateway_delete.md} +0 -0
- data/docs/subcommands/{natgateway_get.md → compute-engine/natgateway_get.md} +0 -0
- data/docs/subcommands/{natgateway_lan_add.md → compute-engine/natgateway_lan_add.md} +0 -0
- data/docs/subcommands/{natgateway_lan_remove.md → compute-engine/natgateway_lan_remove.md} +0 -0
- data/docs/subcommands/{natgateway_list.md → compute-engine/natgateway_list.md} +0 -0
- data/docs/subcommands/{natgateway_rule_add.md → compute-engine/natgateway_rule_add.md} +0 -0
- data/docs/subcommands/{natgateway_rule_list.md → compute-engine/natgateway_rule_list.md} +0 -0
- data/docs/subcommands/{natgateway_rule_remove.md → compute-engine/natgateway_rule_remove.md} +0 -0
- data/docs/subcommands/{natgateway_rule_update.md → compute-engine/natgateway_rule_update.md} +0 -0
- data/docs/subcommands/{natgateway_update.md → compute-engine/natgateway_update.md} +0 -0
- data/docs/subcommands/{networkloadbalancer_create.md → compute-engine/networkloadbalancer_create.md} +0 -0
- data/docs/subcommands/{networkloadbalancer_delete.md → compute-engine/networkloadbalancer_delete.md} +0 -0
- data/docs/subcommands/{networkloadbalancer_get.md → compute-engine/networkloadbalancer_get.md} +0 -0
- data/docs/subcommands/{networkloadbalancer_list.md → compute-engine/networkloadbalancer_list.md} +0 -0
- data/docs/subcommands/{networkloadbalancer_rule_add.md → compute-engine/networkloadbalancer_rule_add.md} +0 -0
- data/docs/subcommands/{networkloadbalancer_rule_list.md → compute-engine/networkloadbalancer_rule_list.md} +0 -0
- data/docs/subcommands/{networkloadbalancer_rule_remove.md → compute-engine/networkloadbalancer_rule_remove.md} +0 -0
- data/docs/subcommands/{networkloadbalancer_rule_target_add.md → compute-engine/networkloadbalancer_rule_target_add.md} +0 -0
- data/docs/subcommands/{networkloadbalancer_rule_target_list.md → compute-engine/networkloadbalancer_rule_target_list.md} +0 -0
- data/docs/subcommands/{networkloadbalancer_rule_target_remove.md → compute-engine/networkloadbalancer_rule_target_remove.md} +0 -0
- data/docs/subcommands/{networkloadbalancer_rule_update.md → compute-engine/networkloadbalancer_rule_update.md} +0 -0
- data/docs/subcommands/{networkloadbalancer_update.md → compute-engine/networkloadbalancer_update.md} +0 -0
- data/docs/subcommands/{nic_create.md → compute-engine/nic_create.md} +4 -4
- data/docs/subcommands/{nic_delete.md → compute-engine/nic_delete.md} +1 -1
- data/docs/subcommands/{nic_get.md → compute-engine/nic_get.md} +0 -0
- data/docs/subcommands/{nic_list.md → compute-engine/nic_list.md} +0 -0
- data/docs/subcommands/{nic_update.md → compute-engine/nic_update.md} +3 -3
- data/docs/subcommands/{pcc_create.md → compute-engine/pcc_create.md} +0 -0
- data/docs/subcommands/{pcc_delete.md → compute-engine/pcc_delete.md} +0 -0
- data/docs/subcommands/{pcc_get.md → compute-engine/pcc_get.md} +0 -0
- data/docs/subcommands/{pcc_list.md → compute-engine/pcc_list.md} +0 -0
- data/docs/subcommands/{pcc_update.md → compute-engine/pcc_update.md} +0 -0
- data/docs/subcommands/{request_get.md → compute-engine/request_get.md} +0 -0
- data/docs/subcommands/{request_list.md → compute-engine/request_list.md} +0 -0
- data/docs/subcommands/{request_status.md → compute-engine/request_status.md} +0 -0
- data/docs/subcommands/{request_wait.md → compute-engine/request_wait.md} +0 -0
- data/docs/subcommands/{server_console.md → compute-engine/server_console.md} +0 -0
- data/docs/subcommands/{server_create.md → compute-engine/server_create.md} +0 -0
- data/docs/subcommands/{server_delete.md → compute-engine/server_delete.md} +0 -0
- data/docs/subcommands/{server_get.md → compute-engine/server_get.md} +0 -0
- data/docs/subcommands/{server_list.md → compute-engine/server_list.md} +4 -1
- data/docs/subcommands/{server_reboot.md → compute-engine/server_reboot.md} +0 -0
- data/docs/subcommands/{server_resume.md → compute-engine/server_resume.md} +0 -0
- data/docs/subcommands/{server_start.md → compute-engine/server_start.md} +0 -0
- data/docs/subcommands/{server_stop.md → compute-engine/server_stop.md} +0 -0
- data/docs/subcommands/{server_suspend.md → compute-engine/server_suspend.md} +0 -0
- data/docs/subcommands/{server_token.md → compute-engine/server_token.md} +0 -0
- data/docs/subcommands/{server_update.md → compute-engine/server_update.md} +0 -0
- data/docs/subcommands/{server_upgrade.md → compute-engine/server_upgrade.md} +0 -0
- data/docs/subcommands/{snapshot_create.md → compute-engine/snapshot_create.md} +0 -0
- data/docs/subcommands/{snapshot_delete.md → compute-engine/snapshot_delete.md} +0 -0
- data/docs/subcommands/{snapshot_get.md → compute-engine/snapshot_get.md} +0 -0
- data/docs/subcommands/{snapshot_list.md → compute-engine/snapshot_list.md} +0 -0
- data/docs/subcommands/{snapshot_restore.md → compute-engine/snapshot_restore.md} +0 -0
- data/docs/subcommands/{snapshot_update.md → compute-engine/snapshot_update.md} +10 -10
- data/docs/subcommands/{template_list.md → compute-engine/template_list.md} +0 -0
- data/docs/subcommands/{volume_attach.md → compute-engine/volume_attach.md} +0 -0
- data/docs/subcommands/{volume_create.md → compute-engine/volume_create.md} +2 -23
- data/docs/subcommands/{volume_delete.md → compute-engine/volume_delete.md} +0 -0
- data/docs/subcommands/{volume_detach.md → compute-engine/volume_detach.md} +0 -0
- data/docs/subcommands/{volume_get.md → compute-engine/volume_get.md} +0 -0
- data/docs/subcommands/{volume_list.md → compute-engine/volume_list.md} +0 -0
- data/docs/subcommands/{volume_update.md → compute-engine/volume_update.md} +0 -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/{k8s_create.md → kubernetes/k8s_create.md} +5 -5
- data/docs/subcommands/{k8s_delete.md → kubernetes/k8s_delete.md} +0 -0
- data/docs/subcommands/{k8s_get.md → kubernetes/k8s_get.md} +0 -0
- data/docs/subcommands/{k8s_list.md → kubernetes/k8s_list.md} +0 -0
- data/docs/subcommands/{k8s_update.md → kubernetes/k8s_update.md} +0 -0
- data/docs/subcommands/{kubeconfig_get.md → kubernetes/kubeconfig_get.md} +0 -0
- data/docs/subcommands/{node_delete.md → kubernetes/node_delete.md} +0 -0
- data/docs/subcommands/{node_get.md → kubernetes/node_get.md} +0 -0
- data/docs/subcommands/{node_list.md → kubernetes/node_list.md} +0 -0
- data/docs/subcommands/{node_replace.md → kubernetes/node_replace.md} +0 -0
- data/docs/subcommands/{nodepool_create.md → kubernetes/nodepool_create.md} +4 -4
- data/docs/subcommands/{nodepool_delete.md → kubernetes/nodepool_delete.md} +0 -0
- data/docs/subcommands/{nodepool_get.md → kubernetes/nodepool_get.md} +0 -0
- data/docs/subcommands/{nodepool_lan_add.md → kubernetes/nodepool_lan_add.md} +0 -0
- data/docs/subcommands/{nodepool_lan_remove.md → kubernetes/nodepool_lan_remove.md} +0 -0
- data/docs/subcommands/{nodepool_list.md → kubernetes/nodepool_list.md} +0 -0
- data/docs/subcommands/{nodepool_update.md → kubernetes/nodepool_update.md} +0 -0
- data/docs/subcommands/{contract_list.md → user/contract_list.md} +0 -0
- data/docs/subcommands/{group_create.md → user/group_create.md} +10 -1
- data/docs/subcommands/{group_delete.md → user/group_delete.md} +0 -0
- data/docs/subcommands/{group_get.md → user/group_get.md} +0 -0
- data/docs/subcommands/{group_list.md → user/group_list.md} +0 -0
- data/docs/subcommands/{group_update.md → user/group_update.md} +10 -1
- data/docs/subcommands/{group_user_add.md → user/group_user_add.md} +0 -0
- data/docs/subcommands/{group_user_remove.md → user/group_user_remove.md} +0 -0
- data/docs/subcommands/{resource_list.md → user/resource_list.md} +0 -0
- data/docs/subcommands/{s3key_create.md → user/s3key_create.md} +0 -0
- data/docs/subcommands/{s3key_delete.md → user/s3key_delete.md} +0 -0
- data/docs/subcommands/{s3key_get.md → user/s3key_get.md} +0 -0
- data/docs/subcommands/{s3key_list.md → user/s3key_list.md} +0 -0
- data/docs/subcommands/{share_create.md → user/share_create.md} +1 -1
- data/docs/subcommands/{share_delete.md → user/share_delete.md} +2 -2
- data/docs/subcommands/{share_get.md → user/share_get.md} +0 -0
- data/docs/subcommands/{share_list.md → user/share_list.md} +0 -0
- data/docs/subcommands/{share_update.md → user/share_update.md} +0 -0
- data/docs/subcommands/{user_create.md → user/user_create.md} +3 -9
- data/docs/subcommands/{user_delete.md → user/user_delete.md} +0 -0
- data/docs/subcommands/{user_get.md → user/user_get.md} +0 -0
- data/docs/subcommands/{user_list.md → user/user_list.md} +0 -0
- data/docs/subcommands/{user_ssourl.md → user/user_ssourl.md} +0 -0
- data/docs/subcommands/{user_update.md → user/user_update.md} +0 -0
- data/docs/summary.md +167 -152
- data/docs/templates/summary.mustache +6 -3
- data/knife-ionoscloud.gemspec +1 -0
- data/lib/chef/knife/ionoscloud_backupunit_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_backupunit_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_backupunit_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_backupunit_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_backupunit_ssourl.rb +1 -2
- data/lib/chef/knife/ionoscloud_backupunit_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_base.rb +57 -0
- data/lib/chef/knife/ionoscloud_composite_server_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_contract_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_cube_server_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_datacenter_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_datacenter_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_datacenter_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_datacenter_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_datacenter_update.rb +1 -2
- 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 +1 -2
- data/lib/chef/knife/ionoscloud_firewall_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_firewall_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_firewall_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_firewall_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_flowlog_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_flowlog_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_flowlog_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_flowlog_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_flowlog_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_group_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_group_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_group_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_group_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_group_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_group_user_add.rb +1 -2
- data/lib/chef/knife/ionoscloud_group_user_remove.rb +1 -2
- data/lib/chef/knife/ionoscloud_image_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_ipblock_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_ipblock_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_ipblock_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_ipblock_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_ipblock_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_ipfailover_add.rb +1 -2
- data/lib/chef/knife/ionoscloud_ipfailover_remove.rb +1 -2
- data/lib/chef/knife/ionoscloud_k8s_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_k8s_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_k8s_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_k8s_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_k8s_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_kubeconfig_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_label_add.rb +1 -2
- data/lib/chef/knife/ionoscloud_label_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_label_remove.rb +1 -2
- data/lib/chef/knife/ionoscloud_lan_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_lan_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_lan_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_lan_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_lan_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_loadbalancer_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_loadbalancer_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_loadbalancer_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_loadbalancer_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_add.rb +1 -2
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_remove.rb +1 -2
- data/lib/chef/knife/ionoscloud_loadbalancer_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_location_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_natgateway_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_natgateway_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_natgateway_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_natgateway_lan_add.rb +1 -2
- data/lib/chef/knife/ionoscloud_natgateway_lan_remove.rb +1 -2
- data/lib/chef/knife/ionoscloud_natgateway_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_natgateway_rule_add.rb +1 -2
- data/lib/chef/knife/ionoscloud_natgateway_rule_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_natgateway_rule_remove.rb +1 -2
- data/lib/chef/knife/ionoscloud_natgateway_rule_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_natgateway_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_add.rb +1 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_remove.rb +1 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_add.rb +1 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove.rb +1 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_nic_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_nic_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_nic_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_nic_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_nic_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_node_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_node_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_node_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_node_replace.rb +1 -2
- data/lib/chef/knife/ionoscloud_nodepool_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_nodepool_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_nodepool_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_nodepool_lan_add.rb +1 -2
- data/lib/chef/knife/ionoscloud_nodepool_lan_remove.rb +1 -2
- data/lib/chef/knife/ionoscloud_nodepool_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_nodepool_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_pcc_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_pcc_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_pcc_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_pcc_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_pcc_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_request_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_request_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_request_status.rb +1 -2
- data/lib/chef/knife/ionoscloud_request_wait.rb +1 -2
- data/lib/chef/knife/ionoscloud_resource_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_s3key_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_s3key_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_s3key_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_s3key_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_console.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_reboot.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_resume.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_start.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_stop.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_suspend.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_token.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_upgrade.rb +1 -2
- data/lib/chef/knife/ionoscloud_share_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_share_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_share_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_share_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_share_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_snapshot_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_snapshot_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_snapshot_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_snapshot_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_snapshot_restore.rb +1 -2
- data/lib/chef/knife/ionoscloud_snapshot_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_template_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_user_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_user_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_user_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_user_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_user_ssourl.rb +1 -2
- data/lib/chef/knife/ionoscloud_user_update.rb +1 -2
- data/lib/chef/knife/ionoscloud_volume_attach.rb +1 -2
- data/lib/chef/knife/ionoscloud_volume_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_volume_delete.rb +1 -2
- data/lib/chef/knife/ionoscloud_volume_detach.rb +1 -2
- data/lib/chef/knife/ionoscloud_volume_get.rb +1 -2
- data/lib/chef/knife/ionoscloud_volume_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_volume_update.rb +1 -2
- data/lib/knife-ionoscloud/version.rb +1 -1
- 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/spec_helper.rb +107 -0
- metadata +209 -156
- data/spec/test.sh +0 -3
@@ -11,13 +11,20 @@ class Chef
|
|
11
11
|
def initialize(args = [])
|
12
12
|
super(args)
|
13
13
|
@description = ''
|
14
|
+
@directory = ''
|
14
15
|
@required_options = []
|
15
16
|
end
|
16
17
|
|
18
|
+
attr_reader :description, :required_options, :directory
|
19
|
+
|
17
20
|
def self.included(includer)
|
18
21
|
includer.class_eval do
|
19
22
|
deps do
|
23
|
+
warn_level = $VERBOSE
|
24
|
+
$VERBOSE = nil
|
20
25
|
require 'ionoscloud'
|
26
|
+
require 'ionoscloud-dbaas-postgres'
|
27
|
+
$VERBOSE = warn_level
|
21
28
|
end
|
22
29
|
|
23
30
|
option :ionoscloud_username,
|
@@ -105,6 +112,27 @@ class Chef
|
|
105
112
|
@api_client
|
106
113
|
end
|
107
114
|
|
115
|
+
def api_client_dbaas
|
116
|
+
return @api_client_dbaas if @api_client_dbaas
|
117
|
+
|
118
|
+
api_config_dbaas = IonoscloudDbaasPostgres::Configuration.new()
|
119
|
+
|
120
|
+
api_config_dbaas.username = config[:ionoscloud_username]
|
121
|
+
api_config_dbaas.password = config[:ionoscloud_password]
|
122
|
+
|
123
|
+
api_config_dbaas.debugging = config[:ionoscloud_debug] || false
|
124
|
+
|
125
|
+
@api_client_dbaas = IonoscloudDbaasPostgres::ApiClient.new(api_config_dbaas)
|
126
|
+
|
127
|
+
@api_client_dbaas.user_agent = [
|
128
|
+
'knife/v' + MODULE_VERSION,
|
129
|
+
@api_client_dbaas.default_headers['User-Agent'],
|
130
|
+
'chef/' + Chef::VERSION,
|
131
|
+
].join('_')
|
132
|
+
|
133
|
+
@api_client_dbaas
|
134
|
+
end
|
135
|
+
|
108
136
|
def get_request_id(headers)
|
109
137
|
begin
|
110
138
|
headers['Location'].scan(%r{/requests/(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)}).last.first
|
@@ -423,6 +451,35 @@ class Chef
|
|
423
451
|
end}"
|
424
452
|
puts "#{ui.color('Flowlogs', :cyan)}: #{natgateway.entities.flowlogs.items.map { |flowlog| flowlog.id }}"
|
425
453
|
end
|
454
|
+
|
455
|
+
def print_cluster(cluster)
|
456
|
+
connections = cluster.properties.connections.map { |connection| connection.to_hash }
|
457
|
+
|
458
|
+
print "\n"
|
459
|
+
puts "#{ui.color('ID', :cyan)}: #{cluster.id}"
|
460
|
+
puts "#{ui.color('Display Name', :cyan)}: #{cluster.properties.display_name}"
|
461
|
+
puts "#{ui.color('Postgres Version', :cyan)}: #{cluster.properties.postgres_version}"
|
462
|
+
puts "#{ui.color('Location', :cyan)}: #{cluster.properties.location}"
|
463
|
+
puts "#{ui.color('Instances', :cyan)}: #{cluster.properties.instances}"
|
464
|
+
puts "#{ui.color('RAM Size', :cyan)}: #{cluster.properties.ram}"
|
465
|
+
puts "#{ui.color('Cores', :cyan)}: #{cluster.properties.cores}"
|
466
|
+
puts "#{ui.color('Storage Size', :cyan)}: #{cluster.properties.storage_size}"
|
467
|
+
puts "#{ui.color('Storage Type', :cyan)}: #{cluster.properties.storage_type}"
|
468
|
+
puts "#{ui.color('Connections', :cyan)}: #{connections}"
|
469
|
+
puts "#{ui.color('Maintenance Window', :cyan)}: #{cluster.properties.maintenance_window.to_hash}"
|
470
|
+
puts "#{ui.color('Synchronization Mode', :cyan)}: #{cluster.properties.synchronization_mode}"
|
471
|
+
puts "#{ui.color('Lifecycle Status', :cyan)}: #{cluster.metadata.state}"
|
472
|
+
end
|
473
|
+
|
474
|
+
def print_cluster_backup(backup)
|
475
|
+
print "\n"
|
476
|
+
puts "#{ui.color('ID', :cyan)}: #{backup.id}"
|
477
|
+
puts "#{ui.color('Cluster ID', :cyan)}: #{backup.properties.cluster_id}"
|
478
|
+
puts "#{ui.color('Version', :cyan)}: #{backup.properties.version}"
|
479
|
+
puts "#{ui.color('Is Active', :cyan)}: #{backup.properties.is_active}"
|
480
|
+
puts "#{ui.color('Earliest Recovery Target Time', :cyan)}: #{backup.properties.earliest_recovery_target_time}"
|
481
|
+
puts "#{ui.color('Created Date', :cyan)}: #{backup.metadata.created_date}"
|
482
|
+
end
|
426
483
|
end
|
427
484
|
end
|
428
485
|
end
|
@@ -124,12 +124,11 @@ class Chef
|
|
124
124
|
description: 'The type of firewall rules that will be allowed on the NIC. If it is not specified it will take the '\
|
125
125
|
'default value INGRESS'
|
126
126
|
|
127
|
-
attr_reader :description, :required_options
|
128
|
-
|
129
127
|
def initialize(args = [])
|
130
128
|
super(args)
|
131
129
|
@description =
|
132
130
|
'This creates a new composite server with an attached volume and NIC in a specified virtual data center.'
|
131
|
+
@directory = 'compute-engine'
|
133
132
|
@required_options = [
|
134
133
|
:datacenter_id, :name, :cores, :ram, :size, :type, :dhcp, :lan, :ionoscloud_username, :ionoscloud_password,
|
135
134
|
]
|
@@ -7,12 +7,11 @@ class Chef
|
|
7
7
|
|
8
8
|
banner 'knife ionoscloud contract list'
|
9
9
|
|
10
|
-
attr_reader :description, :required_options
|
11
|
-
|
12
10
|
def initialize(args = [])
|
13
11
|
super(args)
|
14
12
|
@description =
|
15
13
|
'Lists information about available contract resources.'
|
14
|
+
@directory = 'user'
|
16
15
|
@required_options = [:ionoscloud_username, :ionoscloud_password]
|
17
16
|
end
|
18
17
|
|
@@ -104,12 +104,11 @@ class Chef
|
|
104
104
|
description: 'The type of firewall rules that will be allowed on the NIC. If it is not specified it will take the '\
|
105
105
|
'default value INGRESS'
|
106
106
|
|
107
|
-
attr_reader :description, :required_options
|
108
|
-
|
109
107
|
def initialize(args = [])
|
110
108
|
super(args)
|
111
109
|
@description =
|
112
110
|
'This creates a new cube server with an attached volume and NIC in a specified virtual data center.'
|
111
|
+
@directory = 'compute-engine'
|
113
112
|
@required_options = [
|
114
113
|
:datacenter_id, :name, :template, :ionoscloud_username, :ionoscloud_password,
|
115
114
|
]
|
@@ -22,8 +22,6 @@ class Chef
|
|
22
22
|
long: '--location LOCATION',
|
23
23
|
description: 'Location of the data center'
|
24
24
|
|
25
|
-
attr_reader :description, :required_options
|
26
|
-
|
27
25
|
def initialize(args = [])
|
28
26
|
super(args)
|
29
27
|
@description =
|
@@ -32,6 +30,7 @@ class Chef
|
|
32
30
|
"A list of locations can be obtained with location command.\n\n\t"\
|
33
31
|
"```text\nknife ionoscloud location list\n```\n\n"\
|
34
32
|
"Make a note of the desired location ID and now the data center can be created.\n"
|
33
|
+
@directory = 'compute-engine'
|
35
34
|
@required_options = [:location, :ionoscloud_username, :ionoscloud_password]
|
36
35
|
end
|
37
36
|
|
@@ -7,14 +7,13 @@ class Chef
|
|
7
7
|
|
8
8
|
banner 'knife ionoscloud datacenter delete DATACENTER_ID [DATACENTER_ID]'
|
9
9
|
|
10
|
-
attr_reader :description, :required_options
|
11
|
-
|
12
10
|
def initialize(args = [])
|
13
11
|
super(args)
|
14
12
|
@description =
|
15
13
|
'You will want to exercise a bit of caution here. Removing a data center will destroy '\
|
16
14
|
'all objects contained within that data center -- servers, volumes, snapshots, and so on. '\
|
17
15
|
'The objects -- once removed -- will be unrecoverable.'
|
16
|
+
@directory = 'compute-engine'
|
18
17
|
@required_options = [:ionoscloud_username, :ionoscloud_password]
|
19
18
|
end
|
20
19
|
|
@@ -12,12 +12,11 @@ class Chef
|
|
12
12
|
long: '--datacenter-id DATACENTER_ID',
|
13
13
|
description: 'ID 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
|
'Retrieves information about a Ionoscloud Datacenter.'
|
19
|
+
@directory = 'compute-engine'
|
21
20
|
@required_options = [:datacenter_id, :ionoscloud_username, :ionoscloud_password]
|
22
21
|
end
|
23
22
|
|
@@ -7,8 +7,6 @@ class Chef
|
|
7
7
|
|
8
8
|
banner 'knife ionoscloud datacenter list'
|
9
9
|
|
10
|
-
attr_reader :description, :required_options
|
11
|
-
|
12
10
|
def initialize(args = [])
|
13
11
|
super(args)
|
14
12
|
@description =
|
@@ -18,6 +16,7 @@ class Chef
|
|
18
16
|
'networking, and other resources. The goal is to give you the same '\
|
19
17
|
'experience as you would have if you were running your own physical '\
|
20
18
|
'data center. A list of available data centers can be obtained with the following command.'
|
19
|
+
@directory = 'compute-engine'
|
21
20
|
@required_options = [:ionoscloud_username, :ionoscloud_password]
|
22
21
|
end
|
23
22
|
|
@@ -25,12 +25,11 @@ class Chef
|
|
25
25
|
long: '--sec-auth-protection SEC_AUTH_PROTECTION',
|
26
26
|
description: 'Boolean value representing if the data center requires extra protection e.g. two factor protection'
|
27
27
|
|
28
|
-
attr_reader :description, :required_options
|
29
|
-
|
30
28
|
def initialize(args = [])
|
31
29
|
super(args)
|
32
30
|
@description =
|
33
31
|
'Updates information about a Ionoscloud Datacenter.'
|
32
|
+
@directory = 'compute-engine'
|
34
33
|
@required_options = [:datacenter_id, :ionoscloud_username, :ionoscloud_password]
|
35
34
|
@updatable_fields = [:name, :description, :sec_auth_protection]
|
36
35
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudDbaasPostgresBackupGet < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud dbaas postgres cluster get (options)'
|
9
|
+
|
10
|
+
option :backup_id,
|
11
|
+
short: '-B BACKUP_ID',
|
12
|
+
long: '--backup-id BACKUP_ID',
|
13
|
+
description: 'ID of the cluster backup'
|
14
|
+
|
15
|
+
def initialize(args = [])
|
16
|
+
super(args)
|
17
|
+
@description =
|
18
|
+
'Retrieve a PostgreSQL cluster backup by using its ID. This value can be
|
19
|
+
found when you GET a list of PostgreSQL cluster backups.'
|
20
|
+
@directory = 'dbaas-postgres'
|
21
|
+
@required_options = [:backup_id, :ionoscloud_username, :ionoscloud_password]
|
22
|
+
end
|
23
|
+
|
24
|
+
def run
|
25
|
+
$stdout.sync = true
|
26
|
+
handle_extra_config
|
27
|
+
validate_required_params(@required_options, config)
|
28
|
+
|
29
|
+
print_cluster_backup(IonoscloudDbaasPostgres::BackupsApi.new(api_client_dbaas).clusters_backups_find_by_id(config[:backup_id]))
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudDbaasPostgresBackupList < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud dbaas postgres backup list (options)'
|
9
|
+
|
10
|
+
option :cluster_id,
|
11
|
+
short: '-C CLUSTER_ID',
|
12
|
+
long: '--cluster-id CLUSTER_ID',
|
13
|
+
description: 'ID of the cluster'
|
14
|
+
|
15
|
+
def initialize(args = [])
|
16
|
+
super(args)
|
17
|
+
@description =
|
18
|
+
'If cluster_id is provided, retrieves a list of all backups of the given PostgreSQL cluster,
|
19
|
+
otherwise retrieves a list of all PostgreSQL cluster backups.'
|
20
|
+
@directory = 'dbaas-postgres'
|
21
|
+
@required_options = [:ionoscloud_username, :ionoscloud_password]
|
22
|
+
end
|
23
|
+
|
24
|
+
def run
|
25
|
+
$stdout.sync = true
|
26
|
+
handle_extra_config
|
27
|
+
validate_required_params(@required_options, config)
|
28
|
+
|
29
|
+
backup_list = [
|
30
|
+
ui.color('ID', :bold),
|
31
|
+
ui.color('Type', :bold),
|
32
|
+
ui.color('Cluster ID', :bold),
|
33
|
+
ui.color('Is Active', :bold),
|
34
|
+
ui.color('Earliest Recovery Target Time', :bold),
|
35
|
+
ui.color('Created Date', :bold),
|
36
|
+
]
|
37
|
+
|
38
|
+
backups_api = IonoscloudDbaasPostgres::BackupsApi.new(api_client_dbaas)
|
39
|
+
|
40
|
+
if config[:cluster_id]
|
41
|
+
backups = backups_api.cluster_backups_get(config[:cluster_id])
|
42
|
+
else
|
43
|
+
backups = backups_api.clusters_backups_get()
|
44
|
+
end
|
45
|
+
|
46
|
+
backups.items.each do |backup|
|
47
|
+
backup_list << backup.id
|
48
|
+
backup_list << backup.type
|
49
|
+
backup_list << backup.properties.cluster_id
|
50
|
+
backup_list << backup.properties.is_active
|
51
|
+
backup_list << backup.properties.earliest_recovery_target_time
|
52
|
+
backup_list << backup.metadata.created_date
|
53
|
+
end
|
54
|
+
|
55
|
+
puts ui.list(backup_list, :uneven_columns_across, 6)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,158 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudDbaasPostgresClusterCreate < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud dbaas postgres cluster create (options)'
|
9
|
+
|
10
|
+
option :postgres_version,
|
11
|
+
long: '--postgres-version POSTGRES_VERSION',
|
12
|
+
description: 'The PostgreSQL version of your cluster'
|
13
|
+
|
14
|
+
option :instances,
|
15
|
+
short: '-R INSTANCES',
|
16
|
+
long: '--instances INSTANCES',
|
17
|
+
description: 'The total number of instances in the cluster (one master and n-1 standbys).'
|
18
|
+
|
19
|
+
option :cores,
|
20
|
+
short: '-C CORES',
|
21
|
+
long: '--cores CORES',
|
22
|
+
description: 'The number of CPU cores per instance.'
|
23
|
+
|
24
|
+
option :ram,
|
25
|
+
short: '-r RAM',
|
26
|
+
long: '--ram RAM',
|
27
|
+
description: 'The amount of memory per instance(should be a multiple of 1024).'
|
28
|
+
|
29
|
+
option :storage_size,
|
30
|
+
long: '--size STORAGE_SIZE',
|
31
|
+
description: 'The amount of storage per instance.'
|
32
|
+
|
33
|
+
option :storage_type,
|
34
|
+
long: '--type STORAGE_TYPE',
|
35
|
+
description: 'The storage type used in your cluster.'
|
36
|
+
|
37
|
+
option :connections,
|
38
|
+
long: '--connections CONNECTIONS',
|
39
|
+
description: 'Array of VDCs to connect to your cluster.'
|
40
|
+
|
41
|
+
option :location,
|
42
|
+
short: '-l LOCATION',
|
43
|
+
long: '--location LOCATION',
|
44
|
+
description: 'The physical location where the cluster will be created. This will
|
45
|
+
be where all of your instances live. Property cannot be modified
|
46
|
+
after datacenter creation (disallowed in update requests)'
|
47
|
+
|
48
|
+
option :display_name,
|
49
|
+
short: '-n DISPLAY_NAME',
|
50
|
+
long: '--name DISPLAY_NAME',
|
51
|
+
description: 'The friendly name of your cluster.'
|
52
|
+
|
53
|
+
option :from_backup,
|
54
|
+
short: '-b FROM_BACKUP',
|
55
|
+
long: '--from-backup FROM_BACKUP',
|
56
|
+
description: 'Deprecated: backup is always enabled. Enables automatic backups of your cluster.'
|
57
|
+
|
58
|
+
option :time,
|
59
|
+
long: '--time TIME',
|
60
|
+
description: 'Time Of the day when to perform the maintenance.'
|
61
|
+
|
62
|
+
option :day_of_the_week,
|
63
|
+
short: '-d DAY_OF_THE_WEEK',
|
64
|
+
long: '--day-of-the-week DAY_OF_THE_WEEK',
|
65
|
+
description: 'Day Of the week when to perform the maintenance.'
|
66
|
+
|
67
|
+
option :synchronization_mode,
|
68
|
+
short: '-s SYNCHRONIZATION_MODE',
|
69
|
+
long: '--synchronization-mode SYNCHRONIZATION_MODE',
|
70
|
+
description: 'Represents different modes of replication'
|
71
|
+
|
72
|
+
option :username,
|
73
|
+
long: '--db-user DB_USERNAME',
|
74
|
+
description: 'The username for the initial postgres user.
|
75
|
+
Some system usernames are restricted (e.g. "postgres", "admin", "standby")'
|
76
|
+
|
77
|
+
option :password,
|
78
|
+
long: '--db-password DB_PASSWORD',
|
79
|
+
description: 'The username for the initial postgres user.'
|
80
|
+
|
81
|
+
option :backup_id,
|
82
|
+
short: '-B BACKUP_ID',
|
83
|
+
long: '--backup-id BACKUP_ID',
|
84
|
+
description: 'ID of backup'
|
85
|
+
|
86
|
+
option :recovery_target_time,
|
87
|
+
short: '-T RECOVERY_TARGET_TIME',
|
88
|
+
long: '--recovery-target-time RECOVERY_TARGET_TIME',
|
89
|
+
description: 'Recovery target time'
|
90
|
+
|
91
|
+
def initialize(args = [])
|
92
|
+
super(args)
|
93
|
+
@description =
|
94
|
+
'Creates a new PostgreSQL cluster.
|
95
|
+
If the `fromBackup` field is populated, the new cluster will be created
|
96
|
+
based on the given backup.'
|
97
|
+
@directory = 'dbaas-postgres'
|
98
|
+
@required_options = [
|
99
|
+
:postgres_version, :instances, :cores, :ram, :storage_size, :storage_type,
|
100
|
+
:connections, :location, :display_name, :synchronization_mode, :username, :password, :ionoscloud_username, :ionoscloud_password,
|
101
|
+
]
|
102
|
+
end
|
103
|
+
|
104
|
+
def run
|
105
|
+
$stdout.sync = true
|
106
|
+
handle_extra_config
|
107
|
+
validate_required_params(@required_options, config)
|
108
|
+
|
109
|
+
print "#{ui.color('Creating cluster...', :magenta)}"
|
110
|
+
|
111
|
+
config[:connections] = JSON[config[:connections]] if config[:connections] && config[:connections].instance_of?(String)
|
112
|
+
|
113
|
+
config[:connections] = config[:connections].map do
|
114
|
+
|connection|
|
115
|
+
IonoscloudDbaasPostgres::Connection.new(
|
116
|
+
datacenter_id: connection['datacenter_id'],
|
117
|
+
lan_id: String(connection['lan_id']),
|
118
|
+
cidr: connection['cidr'],
|
119
|
+
)
|
120
|
+
end if config[:connections]
|
121
|
+
|
122
|
+
clusters_api = IonoscloudDbaasPostgres::ClustersApi.new(api_client_dbaas)
|
123
|
+
|
124
|
+
cluster_properties = IonoscloudDbaasPostgres::CreateClusterProperties.new(
|
125
|
+
postgres_version: config[:postgres_version],
|
126
|
+
instances: Integer(config[:instances]),
|
127
|
+
cores: Integer(config[:cores]),
|
128
|
+
ram: Integer(config[:ram]),
|
129
|
+
storage_size: Integer(config[:storage_size]),
|
130
|
+
storage_type: config[:storage_type],
|
131
|
+
connections: config[:connections],
|
132
|
+
location: config[:location],
|
133
|
+
display_name: config[:display_name],
|
134
|
+
maintenance_window: (config[:time] && config[:day_of_the_week]) ? IonoscloudDbaasPostgres::MaintenanceWindow.new(
|
135
|
+
time: config[:time],
|
136
|
+
day_of_the_week: config[:day_of_the_week],
|
137
|
+
) : nil,
|
138
|
+
credentials: IonoscloudDbaasPostgres::DBUser.new(
|
139
|
+
username: config[:username],
|
140
|
+
password: config[:password],
|
141
|
+
),
|
142
|
+
synchronization_mode: config[:synchronization_mode],
|
143
|
+
from_backup: IonoscloudDbaasPostgres::CreateRestoreRequest.new(
|
144
|
+
backup_id: config[:backup_id],
|
145
|
+
recovery_target_time: config[:recovery_target_time],
|
146
|
+
),
|
147
|
+
)
|
148
|
+
|
149
|
+
cluster_request = IonoscloudDbaasPostgres::CreateClusterRequest.new()
|
150
|
+
cluster_request.properties = cluster_properties
|
151
|
+
|
152
|
+
cluster, _, headers = clusters_api.clusters_post_with_http_info(cluster_request)
|
153
|
+
|
154
|
+
print_cluster(cluster)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudDbaasPostgresClusterDelete < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud dbaas postgres cluster delete CLUSTER_ID [CLUSTER_ID]'
|
9
|
+
|
10
|
+
def initialize(args = [])
|
11
|
+
super(args)
|
12
|
+
@description =
|
13
|
+
'Delete a PostgreSQL cluster.'
|
14
|
+
@directory = 'dbaas-postgres'
|
15
|
+
@required_options = [:ionoscloud_username, :ionoscloud_password]
|
16
|
+
end
|
17
|
+
|
18
|
+
def run
|
19
|
+
$stdout.sync = true
|
20
|
+
handle_extra_config
|
21
|
+
validate_required_params(@required_options, config)
|
22
|
+
|
23
|
+
clusters_api = IonoscloudDbaasPostgres::ClustersApi.new(api_client_dbaas)
|
24
|
+
|
25
|
+
@name_args.each do |cluster_id|
|
26
|
+
begin
|
27
|
+
cluster = clusters_api.clusters_find_by_id(cluster_id)
|
28
|
+
rescue IonoscloudDbaasPostgres::ApiError => err
|
29
|
+
raise err unless err.code == 404
|
30
|
+
ui.error("Cluster ID #{cluster_id} not found. Skipping.")
|
31
|
+
next
|
32
|
+
end
|
33
|
+
|
34
|
+
print_cluster(cluster)
|
35
|
+
puts "\n"
|
36
|
+
|
37
|
+
begin
|
38
|
+
confirm('Do you really want to delete this cluster')
|
39
|
+
rescue SystemExit => exc
|
40
|
+
next
|
41
|
+
end
|
42
|
+
|
43
|
+
_, _, headers = clusters_api.clusters_delete_with_http_info(cluster_id)
|
44
|
+
ui.warn("Deleted Cluster #{cluster.id}.")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudDbaasPostgresClusterGet < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud dbaas postgres cluster get (options)'
|
9
|
+
|
10
|
+
option :cluster_id,
|
11
|
+
short: '-C CLUSTER_ID',
|
12
|
+
long: '--cluster-id CLUSTER_ID',
|
13
|
+
description: 'ID of the cluster'
|
14
|
+
|
15
|
+
def initialize(args = [])
|
16
|
+
super(args)
|
17
|
+
@description =
|
18
|
+
'You can retrieve a PostgreSQL cluster by using its ID. This value can be
|
19
|
+
found in the response body when a PostgreSQL cluster is created or when
|
20
|
+
you GET a list of PostgreSQL clusters.'
|
21
|
+
@directory = 'dbaas-postgres'
|
22
|
+
@required_options = [:cluster_id, :ionoscloud_username, :ionoscloud_password]
|
23
|
+
end
|
24
|
+
|
25
|
+
def run
|
26
|
+
$stdout.sync = true
|
27
|
+
handle_extra_config
|
28
|
+
validate_required_params(@required_options, config)
|
29
|
+
|
30
|
+
print_cluster(IonoscloudDbaasPostgres::ClustersApi.new(api_client_dbaas).clusters_find_by_id(config[:cluster_id]))
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudDbaasPostgresClusterList < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud dbaas postgres cluster list'
|
9
|
+
|
10
|
+
def initialize(args = [])
|
11
|
+
super(args)
|
12
|
+
@description =
|
13
|
+
'Retrieves a list of PostgreSQL clusters.'
|
14
|
+
@directory = 'dbaas-postgres'
|
15
|
+
@required_options = [:ionoscloud_username, :ionoscloud_password]
|
16
|
+
end
|
17
|
+
|
18
|
+
def run
|
19
|
+
$stdout.sync = true
|
20
|
+
handle_extra_config
|
21
|
+
validate_required_params(@required_options, config)
|
22
|
+
|
23
|
+
dbaas_cluster_list = [
|
24
|
+
ui.color('ID', :bold),
|
25
|
+
ui.color('Display Name', :bold),
|
26
|
+
ui.color('Postgres Version', :bold),
|
27
|
+
ui.color('Location', :bold),
|
28
|
+
ui.color('Instances', :bold),
|
29
|
+
ui.color('Datacenter ID', :bold),
|
30
|
+
ui.color('Lan ID', :bold),
|
31
|
+
ui.color('cidr', :bold),
|
32
|
+
ui.color('Status', :bold),
|
33
|
+
]
|
34
|
+
|
35
|
+
clusters_api = IonoscloudDbaasPostgres::ClustersApi.new(api_client_dbaas)
|
36
|
+
|
37
|
+
clusters_api.clusters_get(depth: 1).items.each do |cluster|
|
38
|
+
dbaas_cluster_list << cluster.id
|
39
|
+
dbaas_cluster_list << cluster.properties.display_name
|
40
|
+
dbaas_cluster_list << cluster.properties.postgres_version
|
41
|
+
dbaas_cluster_list << cluster.properties.location
|
42
|
+
dbaas_cluster_list << cluster.properties.instances
|
43
|
+
dbaas_cluster_list << cluster.properties.connections.first.datacenter_id
|
44
|
+
dbaas_cluster_list << cluster.properties.connections.first.lan_id
|
45
|
+
dbaas_cluster_list << cluster.properties.connections.first.cidr
|
46
|
+
dbaas_cluster_list << cluster.metadata.state
|
47
|
+
end
|
48
|
+
|
49
|
+
puts ui.list(dbaas_cluster_list, :uneven_columns_across, 9)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudDbaasPostgresClusterRestore < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud dbaas postgres cluster restore (options)'
|
9
|
+
|
10
|
+
option :cluster_id,
|
11
|
+
short: '-C CLUSTER_ID',
|
12
|
+
long: '--cluster-id CLUSTER_ID',
|
13
|
+
description: 'ID of the cluster'
|
14
|
+
|
15
|
+
option :backup_id,
|
16
|
+
short: '-B BACKUP_ID',
|
17
|
+
long: '--backup-id BACKUP_ID',
|
18
|
+
description: 'ID of backup'
|
19
|
+
|
20
|
+
option :recovery_target_time,
|
21
|
+
short: '-T RECOVERY_TARGET_TIME',
|
22
|
+
long: '--recovery-target-time RECOVERY_TARGET_TIME',
|
23
|
+
description: 'Recovery target time'
|
24
|
+
|
25
|
+
def initialize(args = [])
|
26
|
+
super(args)
|
27
|
+
@description =
|
28
|
+
'Triggers an in-place restore of the given PostgreSQL.'
|
29
|
+
@directory = 'dbaas-postgres'
|
30
|
+
@required_options = [:cluster_id, :ionoscloud_username, :ionoscloud_password]
|
31
|
+
end
|
32
|
+
|
33
|
+
def run
|
34
|
+
$stdout.sync = true
|
35
|
+
handle_extra_config
|
36
|
+
validate_required_params(@required_options, config)
|
37
|
+
|
38
|
+
print "#{ui.color('Restoring Cluster...', :magenta)}"
|
39
|
+
|
40
|
+
restore_request = IonoscloudDbaasPostgres::CreateRestoreRequest.new(backup_id: config[:backup_id], recovery_target_time: config[:recovery_target_time])
|
41
|
+
|
42
|
+
IonoscloudDbaasPostgres::RestoresApi.new(api_client_dbaas).cluster_restore_post(config[:cluster_id], restore_request)
|
43
|
+
|
44
|
+
puts("\nCluster restored succsefully.")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|