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
@@ -7,17 +7,17 @@ class Chef
|
|
7
7
|
|
8
8
|
banner 'knife ionoscloud k8s list'
|
9
9
|
|
10
|
-
attr_reader :description, :required_options
|
11
|
-
|
12
10
|
def initialize(args = [])
|
13
11
|
super(args)
|
14
12
|
@description =
|
15
13
|
'Retrieve a list of Kubernetes clusters.'
|
14
|
+
@directory = 'kubernetes'
|
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
|
cluster_list = [
|
@@ -0,0 +1,98 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudK8sUpdate < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud k8s 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 :name,
|
16
|
+
short: '-n NAME',
|
17
|
+
long: '--name NAME',
|
18
|
+
description: 'Name of the server'
|
19
|
+
|
20
|
+
option :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 :api_subnet_allow_list,
|
35
|
+
long: '--subnets SUBNET[,SUBNET,...]',
|
36
|
+
description: 'Access to the K8s API server is restricted to these CIDRs. Cluster-internal traffic is not affected by this '\
|
37
|
+
'restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default '\
|
38
|
+
'value will be used: 32 for IPv4 and 128 for IPv6.'
|
39
|
+
|
40
|
+
option :s3_buckets,
|
41
|
+
long: '--s3-buckets BUCKET[,BUCKET,...]',
|
42
|
+
description: 'List of S3 bucket configured for K8s usage. For now it contains only one S3 bucket used to store K8s API audit logs.'
|
43
|
+
|
44
|
+
def initialize(args = [])
|
45
|
+
super(args)
|
46
|
+
@description =
|
47
|
+
'Updates information about a Ionoscloud K8s Cluster.'
|
48
|
+
@directory = 'kubernetes'
|
49
|
+
@required_options = [:cluster_id, :ionoscloud_username, :ionoscloud_password]
|
50
|
+
@updatable_fields = [
|
51
|
+
:name, :version, :maintenance_day, :maintenance_time, :api_subnet_allow_list, :s3_buckets,
|
52
|
+
]
|
53
|
+
end
|
54
|
+
|
55
|
+
def run
|
56
|
+
$stdout.sync = true
|
57
|
+
handle_extra_config
|
58
|
+
validate_required_params(@required_options, config)
|
59
|
+
|
60
|
+
kubernetes_api = Ionoscloud::KubernetesApi.new(api_client)
|
61
|
+
|
62
|
+
if @updatable_fields.map { |el| config[el] }.any?
|
63
|
+
print "#{ui.color('Updating K8s Cluster...', :magenta)}"
|
64
|
+
|
65
|
+
if config[:api_subnet_allow_list] && config[:api_subnet_allow_list].instance_of?(String)
|
66
|
+
config[:api_subnet_allow_list] = config[:api_subnet_allow_list].split(',')
|
67
|
+
end
|
68
|
+
config[:s3_buckets] = config[:s3_buckets].split(',') if config[:s3_buckets] && config[:s3_buckets].instance_of?(String)
|
69
|
+
|
70
|
+
if config.key?(:s3_buckets)
|
71
|
+
config[:s3_buckets] = config[:s3_buckets].map { |el| Ionoscloud::S3Bucket.new(name: el) }
|
72
|
+
end
|
73
|
+
|
74
|
+
cluster = kubernetes_api.k8s_find_by_cluster_id(config[:cluster_id])
|
75
|
+
|
76
|
+
new_cluster = Ionoscloud::KubernetesCluster.new(
|
77
|
+
properties: Ionoscloud::KubernetesClusterPropertiesForPut.new(
|
78
|
+
name: config.key?(:name) ? config[:name] : cluster.properties.name,
|
79
|
+
k8s_version: config.key?(:version) ? config[:version] : cluster.properties.k8s_version,
|
80
|
+
maintenance_window: Ionoscloud::KubernetesMaintenanceWindow.new(
|
81
|
+
day_of_the_week: config.key?(:maintenance_day) ? config[:maintenance_day] : cluster.properties.maintenance_window.day_of_the_week,
|
82
|
+
time: config.key?(:maintenance_time) ? config[:maintenance_time] : cluster.properties.maintenance_window.time,
|
83
|
+
),
|
84
|
+
api_subnet_allow_list: config.key?(:api_subnet_allow_list) ? config[:api_subnet_allow_list] : cluster.properties.api_subnet_allow_list,
|
85
|
+
s3_buckets: config.key?(:s3_buckets) ? config[:s3_buckets] : cluster.properties.s3_buckets,
|
86
|
+
),
|
87
|
+
)
|
88
|
+
|
89
|
+
kubernetes_api.k8s_put(config[:cluster_id], new_cluster)
|
90
|
+
else
|
91
|
+
ui.warn("Nothing to update, please set one of the attributes #{@updatable_fields}.")
|
92
|
+
end
|
93
|
+
|
94
|
+
print_k8s_cluster(kubernetes_api.k8s_find_by_cluster_id(config[:cluster_id]))
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -12,17 +12,17 @@ class Chef
|
|
12
12
|
long: '--cluster-id CLUSTER_ID',
|
13
13
|
description: 'The ID of the Kubernetes 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 the kubeconfig file for a given 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
|
begin
|
@@ -31,17 +31,17 @@ class Chef
|
|
31
31
|
long: '--resource-id RESOURCE_ID',
|
32
32
|
description: 'ID of the resource.'
|
33
33
|
|
34
|
-
attr_reader :description, :required_options
|
35
|
-
|
36
34
|
def initialize(args = [])
|
37
35
|
super(args)
|
38
36
|
@description =
|
39
37
|
'Add a Label to a Resource.'
|
38
|
+
@directory = 'compute-engine'
|
40
39
|
@required_options = [:type, :resource_id, :key, :value, :ionoscloud_username, :ionoscloud_password]
|
41
40
|
end
|
42
41
|
|
43
42
|
def run
|
44
43
|
$stdout.sync = true
|
44
|
+
handle_extra_config
|
45
45
|
validate_required_params(@required_options, config)
|
46
46
|
|
47
47
|
label_api = Ionoscloud::LabelsApi.new(api_client)
|
@@ -22,18 +22,18 @@ class Chef
|
|
22
22
|
long: '--resource-id RESOURCE_ID',
|
23
23
|
description: 'ID of the resource.'
|
24
24
|
|
25
|
-
attr_reader :description, :required_options
|
26
|
-
|
27
25
|
def initialize(args = [])
|
28
26
|
super(args)
|
29
27
|
@description =
|
30
28
|
'List all Labels available to the user. Specify the type and required resource ID '\
|
31
29
|
'to list labels for a specific resource instead.'
|
30
|
+
@directory = 'compute-engine'
|
32
31
|
@required_options = [:ionoscloud_username, :ionoscloud_password]
|
33
32
|
end
|
34
33
|
|
35
34
|
def run
|
36
35
|
$stdout.sync = true
|
36
|
+
handle_extra_config
|
37
37
|
validate_required_params(@required_options, config)
|
38
38
|
|
39
39
|
label_api = Ionoscloud::LabelsApi.new(api_client)
|
@@ -22,17 +22,17 @@ class Chef
|
|
22
22
|
long: '--resource-id RESOURCE_ID',
|
23
23
|
description: 'ID of the resource.'
|
24
24
|
|
25
|
-
attr_reader :description, :required_options
|
26
|
-
|
27
25
|
def initialize(args = [])
|
28
26
|
super(args)
|
29
27
|
@description =
|
30
28
|
'Remove a Label from a Resource.'
|
29
|
+
@directory = 'compute-engine'
|
31
30
|
@required_options = [:type, :resource_id, :ionoscloud_username, :ionoscloud_password]
|
32
31
|
end
|
33
32
|
|
34
33
|
def run
|
35
34
|
$stdout.sync = true
|
35
|
+
handle_extra_config
|
36
36
|
validate_required_params(@required_options, config)
|
37
37
|
|
38
38
|
label_api = Ionoscloud::LabelsApi.new(api_client)
|
@@ -21,7 +21,6 @@ class Chef
|
|
21
21
|
short: '-p',
|
22
22
|
long: '--public',
|
23
23
|
boolean: true,
|
24
|
-
default: false,
|
25
24
|
description: 'Boolean indicating if the LAN faces the public ' \
|
26
25
|
'Internet or not; defaults to false'
|
27
26
|
|
@@ -29,46 +28,38 @@ class Chef
|
|
29
28
|
long: '--pcc PCC_ID',
|
30
29
|
description: 'ID of the PCC to connect the LAN to'
|
31
30
|
|
32
|
-
attr_reader :description, :required_options
|
33
|
-
|
34
31
|
def initialize(args = [])
|
35
32
|
super(args)
|
36
33
|
@description =
|
37
34
|
'Creates a new LAN under a data center.'
|
35
|
+
@directory = 'compute-engine'
|
38
36
|
@required_options = [:datacenter_id, :ionoscloud_username, :ionoscloud_password]
|
39
37
|
end
|
40
38
|
|
41
39
|
def run
|
42
40
|
$stdout.sync = true
|
41
|
+
handle_extra_config
|
43
42
|
validate_required_params(@required_options, config)
|
44
43
|
|
45
44
|
print "#{ui.color('Creating LAN...', :magenta)}"
|
46
45
|
|
47
|
-
lan_api = Ionoscloud::
|
46
|
+
lan_api = Ionoscloud::LANsApi.new(api_client)
|
48
47
|
|
49
48
|
lan, _, headers = lan_api.datacenters_lans_post_with_http_info(
|
50
49
|
config[:datacenter_id],
|
51
|
-
|
52
|
-
properties:
|
50
|
+
Ionoscloud::Lan.new(
|
51
|
+
properties: Ionoscloud::LanProperties.new(
|
53
52
|
name: config[:name],
|
54
53
|
public: config[:public],
|
55
54
|
pcc: config[:pcc],
|
56
|
-
|
57
|
-
|
55
|
+
),
|
56
|
+
),
|
58
57
|
)
|
59
58
|
|
60
59
|
dot = ui.color('.', :magenta)
|
61
60
|
api_client.wait_for { print dot; is_done? get_request_id headers }
|
62
61
|
|
63
|
-
|
64
|
-
|
65
|
-
puts "\n"
|
66
|
-
puts "#{ui.color('ID', :cyan)}: #{lan.id}"
|
67
|
-
puts "#{ui.color('Name', :cyan)}: #{lan.properties.name}"
|
68
|
-
puts "#{ui.color('Public', :cyan)}: #{lan.properties.public}"
|
69
|
-
puts "#{ui.color('PCC', :cyan)}: #{lan.properties.pcc}"
|
70
|
-
|
71
|
-
puts 'done'
|
62
|
+
print_lan(lan_api.datacenters_lans_find_by_id(config[:datacenter_id], lan.id))
|
72
63
|
end
|
73
64
|
end
|
74
65
|
end
|
@@ -12,20 +12,20 @@ class Chef
|
|
12
12
|
long: '--datacenter-id DATACENTER_ID',
|
13
13
|
description: 'Name of the data center'
|
14
14
|
|
15
|
-
attr_reader :description, :required_options
|
16
|
-
|
17
15
|
def initialize(args = [])
|
18
16
|
super(args)
|
19
17
|
@description =
|
20
18
|
'Deletes an existing LAN.'
|
19
|
+
@directory = 'compute-engine'
|
21
20
|
@required_options = [:datacenter_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
|
-
lan_api = Ionoscloud::
|
28
|
+
lan_api = Ionoscloud::LANsApi.new(api_client)
|
29
29
|
@name_args.each do |lan_id|
|
30
30
|
begin
|
31
31
|
lan = lan_api.datacenters_lans_find_by_id(config[:datacenter_id], lan_id)
|
@@ -35,9 +35,8 @@ class Chef
|
|
35
35
|
next
|
36
36
|
end
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
msg_pair('Public', lan.properties.public.to_s)
|
38
|
+
print_lan(lan)
|
39
|
+
puts "\n"
|
41
40
|
|
42
41
|
begin
|
43
42
|
confirm('Do you really want to delete this LAN')
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudLanGet < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud lan get (options)'
|
9
|
+
|
10
|
+
option :datacenter_id,
|
11
|
+
short: '-D DATACENTER_ID',
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
13
|
+
description: 'ID of the data center'
|
14
|
+
|
15
|
+
option :lan_id,
|
16
|
+
short: '-L LAN_ID',
|
17
|
+
long: '--lan-id LAN_ID',
|
18
|
+
description: 'ID of the LAN'
|
19
|
+
|
20
|
+
def initialize(args = [])
|
21
|
+
super(args)
|
22
|
+
@description =
|
23
|
+
'Retrieves information about a Ionoscloud LAN.'
|
24
|
+
@directory = 'compute-engine'
|
25
|
+
@required_options = [:datacenter_id, :lan_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_lan(Ionoscloud::LANsApi.new(api_client).datacenters_lans_find_by_id(config[:datacenter_id], config[:lan_id]))
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -12,27 +12,28 @@ class Chef
|
|
12
12
|
long: '--datacenter-id DATACENTER_ID',
|
13
13
|
description: 'The 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
|
'Lists all available LANs under a data center.'
|
19
|
+
@directory = 'compute-engine'
|
21
20
|
@required_options = [:datacenter_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
|
$stdout.sync = true
|
29
|
+
handle_extra_config
|
29
30
|
lan_list = [
|
30
31
|
ui.color('ID', :bold),
|
31
32
|
ui.color('Name', :bold),
|
32
33
|
ui.color('Public', :bold),
|
33
34
|
ui.color('PCC', :bold),
|
34
35
|
]
|
35
|
-
lan_api = Ionoscloud::
|
36
|
+
lan_api = Ionoscloud::LANsApi.new(api_client)
|
36
37
|
|
37
38
|
lan_api.datacenters_lans_get(config[:datacenter_id], { depth: 1 }).items.each do |lan|
|
38
39
|
lan_list << lan.id
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudLanUpdate < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud lan update (options)'
|
9
|
+
|
10
|
+
option :datacenter_id,
|
11
|
+
short: '-D DATACENTER_ID',
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
13
|
+
description: 'ID of the data center'
|
14
|
+
|
15
|
+
option :lan_id,
|
16
|
+
short: '-L LAN_ID',
|
17
|
+
long: '--lan-id LAN_ID',
|
18
|
+
description: 'ID of the LAN'
|
19
|
+
|
20
|
+
option :name,
|
21
|
+
short: '-n NAME',
|
22
|
+
long: '--name NAME',
|
23
|
+
description: 'Name of the server'
|
24
|
+
|
25
|
+
option :public,
|
26
|
+
short: '-p PUBLIC',
|
27
|
+
long: '--public PUBLIC',
|
28
|
+
boolean: true,
|
29
|
+
description: 'Boolean indicating if the LAN faces the public ' \
|
30
|
+
'Internet or not; defaults to false'
|
31
|
+
|
32
|
+
option :pcc,
|
33
|
+
long: '--pcc PCC_ID',
|
34
|
+
description: 'ID of the PCC to connect the LAN to'
|
35
|
+
|
36
|
+
def initialize(args = [])
|
37
|
+
super(args)
|
38
|
+
@description =
|
39
|
+
'Updates information about a Ionoscloud LAN.'
|
40
|
+
@directory = 'compute-engine'
|
41
|
+
@required_options = [:datacenter_id, :lan_id, :ionoscloud_username, :ionoscloud_password]
|
42
|
+
@updatable_fields = [:name, :public, :pcc, :description]
|
43
|
+
end
|
44
|
+
|
45
|
+
def run
|
46
|
+
$stdout.sync = true
|
47
|
+
handle_extra_config
|
48
|
+
validate_required_params(@required_options, config)
|
49
|
+
|
50
|
+
lan_api = Ionoscloud::LANsApi.new(api_client)
|
51
|
+
|
52
|
+
if @updatable_fields.map { |el| config[el] }.any?
|
53
|
+
print "#{ui.color('Updating LAN...', :magenta)}"
|
54
|
+
|
55
|
+
_, _, headers = lan_api.datacenters_lans_patch_with_http_info(
|
56
|
+
config[:datacenter_id],
|
57
|
+
config[:lan_id],
|
58
|
+
Ionoscloud::LanProperties.new(
|
59
|
+
name: config[:name],
|
60
|
+
public: (config.key?(:public) ? config[:public].to_s.downcase == 'true' : nil),
|
61
|
+
pcc: config[:pcc],
|
62
|
+
),
|
63
|
+
)
|
64
|
+
|
65
|
+
dot = ui.color('.', :magenta)
|
66
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
67
|
+
else
|
68
|
+
ui.warn("Nothing to update, please set one of the attributes #{@updatable_fields}.")
|
69
|
+
end
|
70
|
+
|
71
|
+
print_lan(lan_api.datacenters_lans_find_by_id(config[:datacenter_id], config[:lan_id]))
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -30,23 +30,24 @@ class Chef
|
|
30
30
|
long: '--nics NIC_ID [NIC_ID]',
|
31
31
|
description: 'An array of additional private NICs attached to worker nodes'
|
32
32
|
|
33
|
-
attr_reader :description, :required_options
|
34
|
-
|
35
33
|
def initialize(args = [])
|
36
34
|
super(args)
|
37
35
|
@description =
|
38
36
|
'Creates a load balancer within the VDC. Load balancers can be used for public or private IP traffic.'
|
37
|
+
@directory = 'compute-engine'
|
39
38
|
@required_options = [:datacenter_id, :name, :ionoscloud_username, :ionoscloud_password]
|
40
39
|
end
|
41
40
|
|
42
41
|
def run
|
43
42
|
$stdout.sync = true
|
43
|
+
handle_extra_config
|
44
44
|
validate_required_params(@required_options, config)
|
45
45
|
|
46
46
|
print "#{ui.color('Creating Load Balancer...', :magenta)}"
|
47
47
|
|
48
48
|
if config[:nics]
|
49
|
-
config[:nics] = config[:nics].split(',')
|
49
|
+
config[:nics] = config[:nics].split(',') if config[:nics].instance_of?(String)
|
50
|
+
config[:nics].map! { |nic| { id: nic } }
|
50
51
|
end
|
51
52
|
|
52
53
|
load_balancer_api = Ionoscloud::LoadBalancersApi.new(api_client)
|
@@ -62,25 +63,15 @@ class Chef
|
|
62
63
|
entities: Ionoscloud::LoadbalancerEntities.new(
|
63
64
|
balancednics: Ionoscloud::Nics.new(
|
64
65
|
items: config[:nics],
|
65
|
-
)
|
66
|
-
)
|
66
|
+
),
|
67
|
+
),
|
67
68
|
),
|
68
69
|
)
|
69
70
|
|
70
71
|
dot = ui.color('.', :magenta)
|
71
72
|
api_client.wait_for { print dot; is_done? get_request_id headers }
|
72
73
|
|
73
|
-
|
74
|
-
|
75
|
-
nics = load_balancer.entities.balancednics.items.map { |nic| nic.id }
|
76
|
-
|
77
|
-
puts "\n"
|
78
|
-
puts "#{ui.color('ID', :cyan)}: #{load_balancer.id}"
|
79
|
-
puts "#{ui.color('Name', :cyan)}: #{load_balancer.properties.name}"
|
80
|
-
puts "#{ui.color('IP address', :cyan)}: #{load_balancer.properties.ip}"
|
81
|
-
puts "#{ui.color('DHCP', :cyan)}: #{load_balancer.properties.dhcp}"
|
82
|
-
puts "#{ui.color('Balanced Nics', :cyan)}: #{nics.to_s}"
|
83
|
-
puts 'done'
|
74
|
+
print_load_balancer(load_balancer_api.datacenters_loadbalancers_find_by_id(config[:datacenter_id], load_balancer.id, { depth: 1 }))
|
84
75
|
end
|
85
76
|
end
|
86
77
|
end
|
@@ -12,17 +12,17 @@ class Chef
|
|
12
12
|
long: '--datacenter-id DATACENTER_ID',
|
13
13
|
description: 'Name of the data center'
|
14
14
|
|
15
|
-
attr_reader :description, :required_options
|
16
|
-
|
17
15
|
def initialize(args = [])
|
18
16
|
super(args)
|
19
17
|
@description =
|
20
18
|
'Deletes the specified load balancer.'
|
19
|
+
@directory = 'compute-engine'
|
21
20
|
@required_options = [:datacenter_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
|
load_balancer_api = Ionoscloud::LoadBalancersApi.new(api_client)
|
@@ -40,14 +40,7 @@ class Chef
|
|
40
40
|
next
|
41
41
|
end
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
msg_pair('ID', load_balancer.id)
|
46
|
-
msg_pair('Name', load_balancer.properties.name)
|
47
|
-
msg_pair('IP address', load_balancer.properties.ip)
|
48
|
-
msg_pair('DHCP', load_balancer.properties.dhcp)
|
49
|
-
msg_pair('Balanced Nics', nics.to_s)
|
50
|
-
|
43
|
+
print_load_balancer(load_balancer)
|
51
44
|
puts "\n"
|
52
45
|
|
53
46
|
begin
|
@@ -17,34 +17,24 @@ class Chef
|
|
17
17
|
long: '--loadbalancer-id LOADBALANCER_ID',
|
18
18
|
description: 'ID of the load balancer'
|
19
19
|
|
20
|
-
attr_reader :description, :required_options
|
21
|
-
|
22
20
|
def initialize(args = [])
|
23
21
|
super(args)
|
24
22
|
@description =
|
25
23
|
'Retrieves the attributes of a given load balancer. This will also retrieve a list of NICs associated with the load balancer.'
|
24
|
+
@directory = 'compute-engine'
|
26
25
|
@required_options = [:datacenter_id, :loadbalancer_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
|
load_balancer_api = Ionoscloud::LoadBalancersApi.new(api_client)
|
34
34
|
|
35
|
-
|
36
|
-
config[:datacenter_id],
|
37
|
-
config[:loadbalancer_id],
|
38
|
-
{ depth: 1 },
|
35
|
+
print_load_balancer(
|
36
|
+
load_balancer_api.datacenters_loadbalancers_find_by_id(config[:datacenter_id], config[:loadbalancer_id], depth: 1),
|
39
37
|
)
|
40
|
-
|
41
|
-
nics = load_balancer.entities.balancednics.items.map! { |el| el.id }
|
42
|
-
|
43
|
-
puts "#{ui.color('ID', :cyan)}: #{load_balancer.id}"
|
44
|
-
puts "#{ui.color('Name', :cyan)}: #{load_balancer.properties.name}"
|
45
|
-
puts "#{ui.color('IP address', :cyan)}: #{load_balancer.properties.ip}"
|
46
|
-
puts "#{ui.color('DHCP', :cyan)}: #{load_balancer.properties.dhcp}"
|
47
|
-
puts "#{ui.color('Balanced Nics', :cyan)}: #{nics.to_s}"
|
48
38
|
end
|
49
39
|
end
|
50
40
|
end
|
@@ -12,17 +12,17 @@ class Chef
|
|
12
12
|
long: '--datacenter-id DATACENTER_ID',
|
13
13
|
description: 'Name of the data center'
|
14
14
|
|
15
|
-
attr_reader :description, :required_options
|
16
|
-
|
17
15
|
def initialize(args = [])
|
18
16
|
super(args)
|
19
17
|
@description =
|
20
18
|
'Retrieve a list of load balancers within the virtual data center.'
|
19
|
+
@directory = 'compute-engine'
|
21
20
|
@required_options = [:datacenter_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
|
load_balancers_list = [
|
@@ -17,17 +17,17 @@ class Chef
|
|
17
17
|
long: '--loadbalancer-id LOADBALANCER_ID',
|
18
18
|
description: 'Name of the load balancer'
|
19
19
|
|
20
|
-
attr_reader :description, :required_options
|
21
|
-
|
22
20
|
def initialize(args = [])
|
23
21
|
super(args)
|
24
22
|
@description =
|
25
23
|
'Adds the association of a NIC with a load balancer.'
|
24
|
+
@directory = 'compute-engine'
|
26
25
|
@required_options = [:datacenter_id, :loadbalancer_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
|
load_balancer_api = Ionoscloud::LoadBalancersApi.new(api_client)
|
@@ -54,21 +54,9 @@ class Chef
|
|
54
54
|
|
55
55
|
request_ids_to_wait.each { |request_id| api_client.wait_for { is_done? request_id } }
|
56
56
|
|
57
|
-
|
58
|
-
config[:datacenter_id],
|
59
|
-
config[:loadbalancer_id],
|
60
|
-
{ depth: 1 },
|
57
|
+
print_load_balancer(
|
58
|
+
load_balancer_api.datacenters_loadbalancers_find_by_id(config[:datacenter_id], config[:loadbalancer_id], depth: 1),
|
61
59
|
)
|
62
|
-
|
63
|
-
nics = load_balancer.entities.balancednics.items.map! { |el| el.id }
|
64
|
-
|
65
|
-
puts "\n"
|
66
|
-
puts "#{ui.color('ID', :cyan)}: #{load_balancer.id}"
|
67
|
-
puts "#{ui.color('Name', :cyan)}: #{load_balancer.properties.name}"
|
68
|
-
puts "#{ui.color('IP address', :cyan)}: #{load_balancer.properties.ip}"
|
69
|
-
puts "#{ui.color('DHCP', :cyan)}: #{load_balancer.properties.dhcp}"
|
70
|
-
puts "#{ui.color('Balanced Nics', :cyan)}: #{nics.to_s}"
|
71
|
-
puts 'done'
|
72
60
|
end
|
73
61
|
end
|
74
62
|
end
|