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
@@ -45,8 +45,7 @@ class Chef
|
|
45
45
|
option :cpu_family,
|
46
46
|
short: '-f CPU_FAMILY',
|
47
47
|
long: '--cpu-family CPU_FAMILY',
|
48
|
-
description: 'Sets the CPU type. [AMD_OPTERON, INTEL_XEON, INTEL_SKYLAKE]'
|
49
|
-
default: 'INTEL_SKYLAKE'
|
48
|
+
description: 'Sets the CPU type. [AMD_OPTERON, INTEL_XEON, INTEL_SKYLAKE]'
|
50
49
|
|
51
50
|
option :cores,
|
52
51
|
long: '--cores CORES',
|
@@ -60,13 +59,11 @@ class Chef
|
|
60
59
|
option :availability_zone,
|
61
60
|
short: '-a AVAILABILITY_ZONE',
|
62
61
|
long: '--availability-zone AVAILABILITY_ZONE',
|
63
|
-
description: 'The availability zone of the node pool'
|
64
|
-
default: 'AUTO'
|
62
|
+
description: 'The availability zone of the node pool'
|
65
63
|
|
66
64
|
option :storage_type,
|
67
65
|
long: '--storage-type STORAGE_TYPE',
|
68
|
-
description: 'Sets the storage type. [HDD, SSD]'
|
69
|
-
default: 'HDD'
|
66
|
+
description: 'Sets the storage type. [HDD, SSD]'
|
70
67
|
|
71
68
|
option :storage_size,
|
72
69
|
long: '--storage-size STORAGE_SIZE',
|
@@ -91,7 +88,13 @@ class Chef
|
|
91
88
|
'must contain one extra IP than maximum number of nodes could be. (nodeCount+1 if fixed '\
|
92
89
|
'node amount or maxNodeCount+1 if auto scaling is used) The extra provided IP Will be used during rebuilding of nodes.'
|
93
90
|
|
94
|
-
|
91
|
+
option :labels,
|
92
|
+
long: '--labels LABEL [LABEL]',
|
93
|
+
description: 'map of labels attached to node pool'
|
94
|
+
|
95
|
+
option :annotations,
|
96
|
+
long: '--annotations ANNOTATION [ANNOTATION]',
|
97
|
+
description: 'map of annotations attached to node pool'
|
95
98
|
|
96
99
|
def initialize(args = [])
|
97
100
|
super(args)
|
@@ -99,6 +102,7 @@ class Chef
|
|
99
102
|
"Creates a node pool into an existing Kubernetes cluster. "\
|
100
103
|
"The Kubernetes cluster must be in state \"ACTIVE\" before creating a node pool.\n\n"\
|
101
104
|
"The worker nodes within the node pools will be deployed into an existing data centers."
|
105
|
+
@directory = 'kubernetes'
|
102
106
|
@required_options = [
|
103
107
|
:datacenter_id, :cluster_id, :name, :version, :node_count, :cpu_family, :cores, :ram,
|
104
108
|
:availability_zone, :storage_type, :storage_size, :ionoscloud_username, :ionoscloud_password,
|
@@ -107,13 +111,17 @@ class Chef
|
|
107
111
|
|
108
112
|
def run
|
109
113
|
$stdout.sync = true
|
114
|
+
handle_extra_config
|
110
115
|
validate_required_params(@required_options, config)
|
111
116
|
|
112
117
|
print "#{ui.color('Creating K8s Nodepool...', :magenta)}"
|
113
118
|
|
114
119
|
kubernetes_api = Ionoscloud::KubernetesApi.new(api_client)
|
115
120
|
|
116
|
-
config[:public_ips] = config[:public_ips].split(',') if config[:public_ips]
|
121
|
+
config[:public_ips] = config[:public_ips].split(',') if config[:public_ips] && config[:public_ips].instance_of?(String)
|
122
|
+
config[:lans] = config[:lans].split(',') if config[:lans] && config[:lans].instance_of?(String)
|
123
|
+
config[:labels] = JSON[config[:labels]] if config[:labels] && config[:labels].instance_of?(String)
|
124
|
+
config[:annotations] = JSON[config[:annotations]] if config[:annotations] && config[:annotations].instance_of?(String)
|
117
125
|
|
118
126
|
nodepool_properties = {
|
119
127
|
name: config[:name],
|
@@ -127,62 +135,22 @@ class Chef
|
|
127
135
|
storage_type: config[:storage_type],
|
128
136
|
storage_size: config[:storage_size],
|
129
137
|
public_ips: config[:public_ips],
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
138
|
+
labels: config[:labels],
|
139
|
+
annotations: config[:annotations],
|
140
|
+
lans: config.key?(:lans) ? config[:lans].map { |lan| { id: Integer(lan) } } : nil,
|
141
|
+
auto_scaling: Ionoscloud::KubernetesAutoScaling.new(
|
142
|
+
min_node_count: config[:min_node_count],
|
143
|
+
max_node_count: config[:max_node_count],
|
144
|
+
),
|
145
|
+
maintenance_window: (config.key?(:maintenance_day) || config.key?(:maintenance_time)) ? Ionoscloud::KubernetesMaintenanceWindow.new(
|
134
146
|
day_of_the_week: config[:maintenance_day],
|
135
147
|
time: config[:maintenance_time],
|
136
|
-
)
|
137
|
-
|
138
|
-
|
139
|
-
if config[:min_node_count] || config[:max_node_count]
|
140
|
-
nodepool_properties[:auto_scaling] = Ionoscloud::KubernetesAutoScaling.new()
|
141
|
-
nodepool_properties[:auto_scaling].min_node_count = config[:min_node_count] unless config[:min_node_count].nil?
|
142
|
-
nodepool_properties[:auto_scaling].max_node_count = config[:max_node_count] unless config[:max_node_count].nil?
|
143
|
-
end
|
144
|
-
|
145
|
-
if config[:lans]
|
146
|
-
nodepool_properties[:lans] = config[:lans].split(',').map! { |lan| { id: Integer(lan) } }
|
147
|
-
end
|
148
|
+
) : nil,
|
149
|
+
}
|
148
150
|
|
149
151
|
nodepool = Ionoscloud::KubernetesNodePool.new(properties: Ionoscloud::KubernetesNodePoolPropertiesForPost.new(nodepool_properties))
|
150
152
|
|
151
|
-
|
152
|
-
|
153
|
-
auto_scaling = "Min node count: #{nodepool.properties.auto_scaling.min_node_count}, Max node count:#{nodepool.properties.auto_scaling.max_node_count}"
|
154
|
-
maintenance_window = "#{nodepool.properties.maintenance_window.day_of_the_week}, #{nodepool.properties.maintenance_window.time}"
|
155
|
-
|
156
|
-
puts "\n"
|
157
|
-
puts "#{ui.color('ID', :cyan)}: #{nodepool.id}"
|
158
|
-
puts "#{ui.color('Name', :cyan)}: #{nodepool.properties.name}"
|
159
|
-
puts "#{ui.color('K8s Version', :cyan)}: #{nodepool.properties.k8s_version}"
|
160
|
-
puts "#{ui.color('Datacenter ID', :cyan)}: #{nodepool.properties.datacenter_id}"
|
161
|
-
puts "#{ui.color('Node Count', :cyan)}: #{nodepool.properties.node_count}"
|
162
|
-
puts "#{ui.color('CPU Family', :cyan)}: #{nodepool.properties.cpu_family}"
|
163
|
-
puts "#{ui.color('Cores Count', :cyan)}: #{nodepool.properties.cores_count}"
|
164
|
-
puts "#{ui.color('RAM', :cyan)}: #{nodepool.properties.ram_size}"
|
165
|
-
puts "#{ui.color('Storage Type', :cyan)}: #{nodepool.properties.storage_type}"
|
166
|
-
puts "#{ui.color('Storage Size', :cyan)}: #{nodepool.properties.storage_size}"
|
167
|
-
puts "#{ui.color('Lans', :cyan)}: #{nodepool.properties.lans.map do
|
168
|
-
|lan|
|
169
|
-
{
|
170
|
-
id: lan.id,
|
171
|
-
dhcp: lan.dhcp,
|
172
|
-
routes: lan.routes ? lan.routes.map do
|
173
|
-
|route|
|
174
|
-
{
|
175
|
-
network: route.network,
|
176
|
-
gateway_ip: route.gateway_ip,
|
177
|
-
}
|
178
|
-
end : []
|
179
|
-
}
|
180
|
-
end}"
|
181
|
-
puts "#{ui.color('Availability Zone', :cyan)}: #{nodepool.properties.availability_zone}"
|
182
|
-
puts "#{ui.color('Auto Scaling', :cyan)}: #{auto_scaling}"
|
183
|
-
puts "#{ui.color('Maintenance Window', :cyan)}: #{maintenance_window}"
|
184
|
-
puts "#{ui.color('State', :cyan)}: #{nodepool.metadata.state}"
|
185
|
-
puts 'done'
|
153
|
+
print_k8s_nodepool(kubernetes_api.k8s_nodepools_post(config[:cluster_id], nodepool))
|
186
154
|
end
|
187
155
|
end
|
188
156
|
end
|
@@ -12,17 +12,17 @@ class Chef
|
|
12
12
|
long: '--cluster-id CLUSTER_ID',
|
13
13
|
description: 'The ID of the K8s Cluster'
|
14
14
|
|
15
|
-
attr_reader :description, :required_options
|
16
|
-
|
17
15
|
def initialize(args = [])
|
18
16
|
super(args)
|
19
17
|
@description =
|
20
18
|
'Deletes a node pool within an existing Kubernetes cluster.'
|
19
|
+
@directory = 'kubernetes'
|
21
20
|
@required_options = [:cluster_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
|
kubernetes_api = Ionoscloud::KubernetesApi.new(api_client)
|
@@ -36,38 +36,7 @@ class Chef
|
|
36
36
|
next
|
37
37
|
end
|
38
38
|
|
39
|
-
|
40
|
-
maintenance_window = "#{nodepool.properties.maintenance_window.day_of_the_week}, #{nodepool.properties.maintenance_window.time}"
|
41
|
-
|
42
|
-
msg_pair('ID', nodepool.id)
|
43
|
-
msg_pair('Name', nodepool.properties.name)
|
44
|
-
msg_pair('K8s Version', nodepool.properties.k8s_version)
|
45
|
-
msg_pair('Datacenter ID', nodepool.properties.datacenter_id)
|
46
|
-
msg_pair('Node Count', nodepool.properties.node_count)
|
47
|
-
msg_pair('CPU Family', nodepool.properties.cpu_family)
|
48
|
-
msg_pair('Cores Count', nodepool.properties.cores_count)
|
49
|
-
msg_pair('RAM', nodepool.properties.ram_size)
|
50
|
-
msg_pair('Storage Type', nodepool.properties.storage_type)
|
51
|
-
msg_pair('Storage Size', nodepool.properties.storage_size)
|
52
|
-
msg_pair('Lans', nodepool.properties.lans.map do
|
53
|
-
|lan|
|
54
|
-
{
|
55
|
-
id: lan.id,
|
56
|
-
dhcp: lan.dhcp,
|
57
|
-
routes: lan.routes ? lan.routes.map do
|
58
|
-
|route|
|
59
|
-
{
|
60
|
-
network: route.network,
|
61
|
-
gateway_ip: route.gateway_ip,
|
62
|
-
}
|
63
|
-
end : []
|
64
|
-
}
|
65
|
-
end)
|
66
|
-
msg_pair('Availability Zone', nodepool.properties.availability_zone)
|
67
|
-
msg_pair('Auto Scaling', auto_scaling)
|
68
|
-
msg_pair('Maintenance Window', maintenance_window)
|
69
|
-
msg_pair('State', nodepool.metadata.state)
|
70
|
-
|
39
|
+
print_k8s_nodepool(nodepool)
|
71
40
|
puts "\n"
|
72
41
|
|
73
42
|
begin
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNodepoolGet < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud nodepool get (options)'
|
9
|
+
|
10
|
+
option :cluster_id,
|
11
|
+
short: '-C CLUSTER_ID',
|
12
|
+
long: '--cluster-id CLUSTER_ID',
|
13
|
+
description: 'The ID of the K8s Cluster'
|
14
|
+
|
15
|
+
option :nodepool_id,
|
16
|
+
short: '-P NODEPOOL_ID',
|
17
|
+
long: '--nodepool-id NODEPOOL_ID',
|
18
|
+
description: 'The ID of the K8s Nodepool'
|
19
|
+
|
20
|
+
def initialize(args = [])
|
21
|
+
super(args)
|
22
|
+
@description =
|
23
|
+
'Retrieves the attributes of a given K8S Nodepool.'
|
24
|
+
@directory = 'kubernetes'
|
25
|
+
@required_options = [:cluster_id, :nodepool_id, :ionoscloud_username, :ionoscloud_password]
|
26
|
+
end
|
27
|
+
|
28
|
+
def run
|
29
|
+
$stdout.sync = true
|
30
|
+
handle_extra_config
|
31
|
+
validate_required_params(@required_options, config)
|
32
|
+
|
33
|
+
print_k8s_nodepool(
|
34
|
+
Ionoscloud::KubernetesApi.new(api_client).k8s_nodepools_find_by_id(
|
35
|
+
config[:cluster_id],
|
36
|
+
config[:nodepool_id],
|
37
|
+
),
|
38
|
+
)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -25,24 +25,23 @@ class Chef
|
|
25
25
|
option :no_dhcp,
|
26
26
|
long: '--nodhcp',
|
27
27
|
boolean: true,
|
28
|
-
default: false,
|
29
28
|
description: 'Indicates if the Kubernetes Node Pool LAN will reserve an IP using DHCP'
|
30
29
|
|
31
30
|
option :routes,
|
32
31
|
long: '--routes NETWORK,GATEWAY_IP [NETWORK,GATEWAY_IP]',
|
33
32
|
description: 'An array of additional LANs attached to worker nodes'
|
34
33
|
|
35
|
-
attr_reader :description, :required_options
|
36
|
-
|
37
34
|
def initialize(args = [])
|
38
35
|
super(args)
|
39
36
|
@description =
|
40
37
|
'Adds or updates a LAN within a Nodepool.'
|
38
|
+
@directory = 'kubernetes'
|
41
39
|
@required_options = [:cluster_id, :nodepool_id, :lan_id, :ionoscloud_username, :ionoscloud_password]
|
42
40
|
end
|
43
41
|
|
44
42
|
def run
|
45
43
|
$stdout.sync = true
|
44
|
+
handle_extra_config
|
46
45
|
validate_required_params(@required_options, config)
|
47
46
|
|
48
47
|
kubernetes_api = Ionoscloud::KubernetesApi.new(api_client)
|
@@ -56,7 +55,7 @@ class Chef
|
|
56
55
|
end
|
57
56
|
|
58
57
|
routes = []
|
59
|
-
config[:routes] = config[:routes].split(',') if config[:routes]
|
58
|
+
config[:routes] = config[:routes].split(',') if config[:routes] && config[:routes].instance_of?(String)
|
60
59
|
config[:routes].each_slice(2) do |network, gateway_ip|
|
61
60
|
routes << Ionoscloud::KubernetesNodePoolLanRoutes.new(
|
62
61
|
network: network,
|
@@ -70,8 +69,6 @@ class Chef
|
|
70
69
|
routes: routes,
|
71
70
|
)
|
72
71
|
|
73
|
-
puts new_lan
|
74
|
-
|
75
72
|
existing = nodepool.properties.lans.select { |lan| lan.id == new_lan.id }
|
76
73
|
|
77
74
|
new_nodepool = Ionoscloud::KubernetesNodePool.new(
|
@@ -98,32 +95,7 @@ class Chef
|
|
98
95
|
ui.info("Adding Lan #{config[:lan_id]} to the Nodepoool.")
|
99
96
|
end
|
100
97
|
|
101
|
-
|
102
|
-
maintenance_window = "#{nodepool.properties.maintenance_window.day_of_the_week}, #{nodepool.properties.maintenance_window.time}"
|
103
|
-
|
104
|
-
puts "\n"
|
105
|
-
puts "#{ui.color('ID', :cyan)}: #{nodepool.id}"
|
106
|
-
puts "#{ui.color('Name', :cyan)}: #{nodepool.properties.name}"
|
107
|
-
puts "#{ui.color('K8s Version', :cyan)}: #{nodepool.properties.k8s_version}"
|
108
|
-
puts "#{ui.color('Node Count', :cyan)}: #{nodepool.properties.node_count}"
|
109
|
-
puts "#{ui.color('Lans', :cyan)}: #{nodepool.properties.lans.map do
|
110
|
-
|lan|
|
111
|
-
{
|
112
|
-
id: lan.id,
|
113
|
-
dhcp: lan.dhcp,
|
114
|
-
routes: lan.routes ? lan.routes.map do
|
115
|
-
|route|
|
116
|
-
{
|
117
|
-
network: route.network,
|
118
|
-
gateway_ip: route.gateway_ip,
|
119
|
-
}
|
120
|
-
end : []
|
121
|
-
}
|
122
|
-
end}"
|
123
|
-
puts "#{ui.color('Auto Scaling', :cyan)}: #{auto_scaling}"
|
124
|
-
puts "#{ui.color('Maintenance Window', :cyan)}: #{maintenance_window}"
|
125
|
-
puts "#{ui.color('State', :cyan)}: #{nodepool.metadata.state}"
|
126
|
-
puts 'done'
|
98
|
+
print_k8s_nodepool(nodepool)
|
127
99
|
end
|
128
100
|
end
|
129
101
|
end
|
@@ -17,17 +17,17 @@ class Chef
|
|
17
17
|
long: '--nodepool NODEPOOL_ID',
|
18
18
|
description: 'The ID of the K8s Nodepool'
|
19
19
|
|
20
|
-
attr_reader :description, :required_options
|
21
|
-
|
22
20
|
def initialize(args = [])
|
23
21
|
super(args)
|
24
22
|
@description =
|
25
23
|
'Adds or updates a LAN within a Nodepool.'
|
24
|
+
@directory = 'kubernetes'
|
26
25
|
@required_options = [:cluster_id, :nodepool_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
|
kubernetes_api = Ionoscloud::KubernetesApi.new(api_client)
|
@@ -64,32 +64,7 @@ class Chef
|
|
64
64
|
ui.info("None of the specified Lan IDs (#{@name_args}) are present on the Nodepoool.")
|
65
65
|
end
|
66
66
|
|
67
|
-
|
68
|
-
maintenance_window = "#{nodepool.properties.maintenance_window.day_of_the_week}, #{nodepool.properties.maintenance_window.time}"
|
69
|
-
|
70
|
-
puts "\n"
|
71
|
-
puts "#{ui.color('ID', :cyan)}: #{nodepool.id}"
|
72
|
-
puts "#{ui.color('Name', :cyan)}: #{nodepool.properties.name}"
|
73
|
-
puts "#{ui.color('K8s Version', :cyan)}: #{nodepool.properties.k8s_version}"
|
74
|
-
puts "#{ui.color('Node Count', :cyan)}: #{nodepool.properties.node_count}"
|
75
|
-
puts "#{ui.color('Lans', :cyan)}: #{nodepool.properties.lans.map do
|
76
|
-
|lan|
|
77
|
-
{
|
78
|
-
id: lan.id,
|
79
|
-
dhcp: lan.dhcp,
|
80
|
-
routes: lan.routes ? lan.routes.map do
|
81
|
-
|route|
|
82
|
-
{
|
83
|
-
network: route.network,
|
84
|
-
gateway_ip: route.gateway_ip,
|
85
|
-
}
|
86
|
-
end : []
|
87
|
-
}
|
88
|
-
end}"
|
89
|
-
puts "#{ui.color('Auto Scaling', :cyan)}: #{auto_scaling}"
|
90
|
-
puts "#{ui.color('Maintenance Window', :cyan)}: #{maintenance_window}"
|
91
|
-
puts "#{ui.color('State', :cyan)}: #{nodepool.metadata.state}"
|
92
|
-
puts 'done'
|
67
|
+
print_k8s_nodepool(nodepool)
|
93
68
|
end
|
94
69
|
end
|
95
70
|
end
|
@@ -12,17 +12,17 @@ class Chef
|
|
12
12
|
long: '--cluster-id CLUSTER_ID',
|
13
13
|
description: 'The ID of the K8s Cluster'
|
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 node pools contained in a selected Kubernetes cluster.'
|
19
|
+
@directory = 'kubernetes'
|
21
20
|
@required_options = [:cluster_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
|
nodepool_list = [
|
@@ -0,0 +1,123 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNodepoolUpdate < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud nodepool update (options)'
|
9
|
+
|
10
|
+
option :cluster_id,
|
11
|
+
short: '-C CLUSTER_ID',
|
12
|
+
long: '--cluster-id CLUSTER_ID',
|
13
|
+
description: 'ID of the Kubernetes cluster'
|
14
|
+
|
15
|
+
option :nodepool_id,
|
16
|
+
short: '-P NODEPOOL_ID',
|
17
|
+
long: '--nodepool-id NODEPOOL_ID',
|
18
|
+
description: 'ID of the Kubernetes nodepool'
|
19
|
+
|
20
|
+
option :k8s_version,
|
21
|
+
short: '-v VERSION',
|
22
|
+
long: '--version VERSION',
|
23
|
+
description: 'The version for the Kubernetes cluster.'
|
24
|
+
|
25
|
+
option :maintenance_day,
|
26
|
+
long: '--maintenance-day MAINTENANCE_DAY',
|
27
|
+
description: 'Day Of the week when to perform the maintenance.'
|
28
|
+
|
29
|
+
option :maintenance_time,
|
30
|
+
short: '-t MAINTENANCE_TIME',
|
31
|
+
long: '--maintenance-time MAINTENANCE_TIME',
|
32
|
+
description: 'Time Of the day when to perform the maintenance.'
|
33
|
+
|
34
|
+
option :node_count,
|
35
|
+
short: '-c NODE_COUNT',
|
36
|
+
long: '--node-count NODE_COUNT',
|
37
|
+
description: 'The number of worker nodes that the node pool should contain. Min 2, Max: Determined by the resource availability.'
|
38
|
+
|
39
|
+
option :min_node_count,
|
40
|
+
long: '--min-node-count MIN_NODE_COUNT',
|
41
|
+
description: 'The minimum number of worker nodes that the managed node group can scale in'
|
42
|
+
|
43
|
+
option :max_node_count,
|
44
|
+
long: '--max-node-count MAX_NODE_COUNT',
|
45
|
+
description: 'The maximum number of worker nodes that the managed node pool can scale-out.'
|
46
|
+
|
47
|
+
option :lans,
|
48
|
+
long: '--lans LAN_ID [LAN_ID]',
|
49
|
+
description: 'An array of additional private LANs attached to worker nodes'
|
50
|
+
|
51
|
+
option :public_ips,
|
52
|
+
long: '--ips PUBLIC_IP [PUBLIC_IP]',
|
53
|
+
description: 'Optional array of reserved public IP addresses to be used by the nodes. '\
|
54
|
+
'IPs must be from same location as the data center used for the node pool. The array '\
|
55
|
+
'must contain one extra IP than maximum number of nodes could be. (nodeCount+1 if fixed '\
|
56
|
+
'node amount or maxNodeCount+1 if auto scaling is used) The extra provided IP Will be used during rebuilding of nodes.'
|
57
|
+
|
58
|
+
option :labels,
|
59
|
+
long: '--labels LABEL [LABEL]',
|
60
|
+
description: 'map of labels attached to node pool'
|
61
|
+
|
62
|
+
option :annotations,
|
63
|
+
long: '--annotations ANNOTATION [ANNOTATION]',
|
64
|
+
description: 'map of annotations attached to node pool'
|
65
|
+
|
66
|
+
def initialize(args = [])
|
67
|
+
super(args)
|
68
|
+
@description =
|
69
|
+
'Updates information about a Ionoscloud K8s Nodepool.'
|
70
|
+
@directory = 'kubernetes'
|
71
|
+
@required_options = [:cluster_id, :nodepool_id, :ionoscloud_username, :ionoscloud_password]
|
72
|
+
@updatable_fields = [
|
73
|
+
:k8s_version, :node_count, :public_ips, :lans, :maintenance_day, :maintenance_time,
|
74
|
+
:min_node_count, :max_node_count, :labels, :annotations,
|
75
|
+
]
|
76
|
+
end
|
77
|
+
|
78
|
+
def run
|
79
|
+
$stdout.sync = true
|
80
|
+
handle_extra_config
|
81
|
+
validate_required_params(@required_options, config)
|
82
|
+
|
83
|
+
config[:public_ips] = config[:public_ips].split(',') if config[:public_ips] && config[:public_ips].instance_of?(String)
|
84
|
+
config[:lans] = config[:lans].split(',') if config[:lans] && config[:lans].instance_of?(String)
|
85
|
+
config[:labels] = JSON[config[:labels]] if config[:labels] && config[:labels].instance_of?(String)
|
86
|
+
config[:annotations] = JSON[config[:annotations]] if config[:annotations] && config[:annotations].instance_of?(String)
|
87
|
+
|
88
|
+
kubernetes_api = Ionoscloud::KubernetesApi.new(api_client)
|
89
|
+
|
90
|
+
if @updatable_fields.map { |el| config[el] }.any?
|
91
|
+
print "#{ui.color('Updating K8s Nodepool...', :magenta)}"
|
92
|
+
|
93
|
+
nodepool = kubernetes_api.k8s_nodepools_find_by_id(config[:cluster_id], config[:nodepool_id])
|
94
|
+
|
95
|
+
new_nodepool = Ionoscloud::KubernetesNodePoolForPut.new(
|
96
|
+
properties: Ionoscloud::KubernetesNodePoolPropertiesForPut.new(
|
97
|
+
k8s_version: config.key?(:k8s_version) ? config[:k8s_version] : nodepool.properties.k8s_version,
|
98
|
+
node_count: config.key?(:node_count) ? config[:node_count] : nodepool.properties.node_count,
|
99
|
+
public_ips: config.key?(:public_ips) ? config[:public_ips] : nodepool.properties.public_ips,
|
100
|
+
labels: config.key?(:labels) ? config[:labels] : nodepool.properties.labels,
|
101
|
+
annotations: config.key?(:annotations) ? config[:annotations] : nodepool.properties.annotations,
|
102
|
+
lans: config.key?(:lans) ? config[:lans].map! { |lan| { id: Integer(lan) } } : nodepool.properties.lans,
|
103
|
+
maintenance_window: Ionoscloud::KubernetesMaintenanceWindow.new(
|
104
|
+
day_of_the_week: config.key?(:maintenance_day) ? config[:maintenance_day] : nodepool.properties.maintenance_window.day_of_the_week,
|
105
|
+
time: config.key?(:maintenance_time) ? config[:maintenance_time] : nodepool.properties.maintenance_window.time,
|
106
|
+
),
|
107
|
+
auto_scaling: Ionoscloud::KubernetesAutoScaling.new(
|
108
|
+
min_node_count: config.key?(:min_node_count) ? config[:min_node_count] : nodepool.properties.auto_scaling.min_node_count,
|
109
|
+
max_node_count: config.key?(:max_node_count) ? config[:max_node_count] : nodepool.properties.auto_scaling.max_node_count,
|
110
|
+
),
|
111
|
+
),
|
112
|
+
)
|
113
|
+
|
114
|
+
kubernetes_api.k8s_nodepools_put(config[:cluster_id], config[:nodepool_id], new_nodepool)
|
115
|
+
else
|
116
|
+
ui.warn("Nothing to update, please set one of the attributes #{@updatable_fields}.")
|
117
|
+
end
|
118
|
+
|
119
|
+
print_k8s_nodepool(kubernetes_api.k8s_nodepools_find_by_id(config[:cluster_id], config[:nodepool_id]))
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
@@ -21,35 +21,37 @@ class Chef
|
|
21
21
|
long: '--peers DATACENTER_ID,LAN_ID [DATACENTER_ID,LAN_ID]',
|
22
22
|
description: 'An array of LANs joined to this private cross connect'
|
23
23
|
|
24
|
-
attr_reader :description, :required_options
|
25
|
-
|
26
24
|
def initialize(args = [])
|
27
25
|
super(args)
|
28
26
|
@description =
|
29
27
|
'Creates a Private Cross-Connect.'
|
28
|
+
@directory = 'compute-engine'
|
30
29
|
@required_options = [:ionoscloud_username, :ionoscloud_password]
|
31
30
|
end
|
32
31
|
|
33
32
|
def run
|
34
33
|
$stdout.sync = true
|
34
|
+
handle_extra_config
|
35
35
|
validate_required_params(@required_options, config)
|
36
36
|
|
37
37
|
print "#{ui.color('Creating private cross connect...', :magenta)}"
|
38
38
|
|
39
39
|
pcc_api = Ionoscloud::PrivateCrossConnectsApi.new(api_client)
|
40
|
-
config[:peers] = config[:peers].split(',')
|
40
|
+
config[:peers] = config[:peers].split(',') if config[:peers] && config[:peers].instance_of?(String)
|
41
41
|
|
42
42
|
if config[:peers] && config[:peers].length % 2 != 0
|
43
43
|
ui.error('Each Lan ID should correspond to one Datacenter ID!')
|
44
44
|
exit(1)
|
45
45
|
end
|
46
46
|
|
47
|
-
pcc, _, headers = pcc_api.pccs_post_with_http_info(
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
47
|
+
pcc, _, headers = pcc_api.pccs_post_with_http_info(
|
48
|
+
Ionoscloud::PrivateCrossConnect.new(
|
49
|
+
properties: Ionoscloud::PrivateCrossConnectProperties.new(
|
50
|
+
name: config[:name],
|
51
|
+
description: config[:description],
|
52
|
+
),
|
53
|
+
),
|
54
|
+
)
|
53
55
|
|
54
56
|
dot = ui.color('.', :magenta)
|
55
57
|
api_client.wait_for { print dot; is_done? get_request_id headers }
|
@@ -57,7 +59,7 @@ class Chef
|
|
57
59
|
pcc = pcc_api.pccs_find_by_id(pcc.id)
|
58
60
|
|
59
61
|
if config[:peers]
|
60
|
-
lan_api = Ionoscloud::
|
62
|
+
lan_api = Ionoscloud::LANsApi.new(api_client)
|
61
63
|
|
62
64
|
header_list = []
|
63
65
|
allowed_datacenters_ids = pcc.properties.connectable_datacenters.map { |datacenter| datacenter.id }
|
@@ -80,15 +82,7 @@ class Chef
|
|
80
82
|
end
|
81
83
|
end
|
82
84
|
|
83
|
-
|
84
|
-
|
85
|
-
puts "\n"
|
86
|
-
puts "#{ui.color('ID', :cyan)}: #{pcc.id}"
|
87
|
-
puts "#{ui.color('Name', :cyan)}: #{pcc.properties.name}"
|
88
|
-
puts "#{ui.color('Description', :cyan)}: #{pcc.properties.description}"
|
89
|
-
puts "#{ui.color('Peers', :cyan)}: #{pcc.properties.peers.to_s}"
|
90
|
-
puts "#{ui.color('Datacenters', :cyan)}: #{pcc.properties.connectable_datacenters.to_s}"
|
91
|
-
puts 'done'
|
85
|
+
print_pcc(pcc_api.pccs_find_by_id(pcc.id))
|
92
86
|
end
|
93
87
|
end
|
94
88
|
end
|
@@ -7,17 +7,17 @@ class Chef
|
|
7
7
|
|
8
8
|
banner 'knife ionoscloud pcc delete PCC_ID [PCC_ID]'
|
9
9
|
|
10
|
-
attr_reader :description, :required_options
|
11
|
-
|
12
10
|
def initialize(args = [])
|
13
11
|
super(args)
|
14
12
|
@description =
|
15
13
|
'Deletes a Private Cross-Connect.'
|
14
|
+
@directory = 'compute-engine'
|
16
15
|
@required_options = [:ionoscloud_username, :ionoscloud_password]
|
17
16
|
end
|
18
17
|
|
19
18
|
def run
|
20
19
|
$stdout.sync = true
|
20
|
+
handle_extra_config
|
21
21
|
validate_required_params(@required_options, config)
|
22
22
|
|
23
23
|
pcc_api = Ionoscloud::PrivateCrossConnectsApi.new(api_client)
|
@@ -31,15 +31,7 @@ class Chef
|
|
31
31
|
next
|
32
32
|
end
|
33
33
|
|
34
|
-
|
35
|
-
datacenters = pcc.properties.connectable_datacenters.map { |datacenter| datacenter.id }
|
36
|
-
|
37
|
-
msg_pair('ID', pcc.id)
|
38
|
-
msg_pair('Name', pcc.properties.name)
|
39
|
-
msg_pair('Description', pcc.properties.description)
|
40
|
-
msg_pair('Peers', peers.to_s)
|
41
|
-
msg_pair('Datacenters', datacenters.to_s)
|
42
|
-
|
34
|
+
print_pcc(pcc)
|
43
35
|
puts "\n"
|
44
36
|
|
45
37
|
begin
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudPccGet < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud pcc get (options)'
|
9
|
+
|
10
|
+
option :pcc_id,
|
11
|
+
short: '-P PRIVATE_CROSS_CONNECT_ID',
|
12
|
+
long: '--pcc-id PRIVATE_CROSS_CONNECT_ID',
|
13
|
+
description: 'ID of the Private Cross Connect'
|
14
|
+
|
15
|
+
def initialize(args = [])
|
16
|
+
super(args)
|
17
|
+
@description =
|
18
|
+
'Retrieves information about a Ionoscloud Private Cross Connect.'
|
19
|
+
@directory = 'compute-engine'
|
20
|
+
@required_options = [:pcc_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
|
+
|
28
|
+
print_pcc(Ionoscloud::PrivateCrossConnectsApi.new(api_client).pccs_find_by_id(config[:pcc_id]))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|