knife-ionoscloud 5.1.2 → 6.0.0.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/publish.yml +1 -4
- data/docs/README.md +0 -19
- data/docs/docs_generator.rb +1 -1
- data/docs/subcommands/backupunit_create.md +2 -5
- data/docs/subcommands/backupunit_delete.md +1 -4
- data/docs/subcommands/backupunit_list.md +1 -4
- data/docs/subcommands/backupunit_ssourl.md +1 -4
- data/docs/subcommands/composite_server_create.md +1 -4
- data/docs/subcommands/contract_list.md +1 -4
- data/docs/subcommands/datacenter_create.md +1 -4
- data/docs/subcommands/datacenter_delete.md +1 -4
- data/docs/subcommands/datacenter_list.md +1 -4
- data/docs/subcommands/firewall_create.md +2 -5
- data/docs/subcommands/firewall_delete.md +0 -3
- data/docs/subcommands/firewall_list.md +1 -4
- data/docs/subcommands/group_create.md +1 -4
- data/docs/subcommands/group_delete.md +1 -4
- data/docs/subcommands/group_get.md +1 -4
- data/docs/subcommands/group_list.md +1 -4
- data/docs/subcommands/group_user_add.md +0 -3
- data/docs/subcommands/group_user_remove.md +0 -3
- data/docs/subcommands/image_list.md +1 -4
- data/docs/subcommands/ipblock_create.md +1 -4
- data/docs/subcommands/ipblock_delete.md +1 -4
- data/docs/subcommands/ipblock_list.md +1 -4
- data/docs/subcommands/ipfailover_add.md +1 -4
- data/docs/subcommands/ipfailover_remove.md +1 -4
- data/docs/subcommands/k8s_create.md +5 -11
- data/docs/subcommands/k8s_delete.md +1 -4
- data/docs/subcommands/k8s_list.md +1 -4
- data/docs/subcommands/kubeconfig_get.md +1 -4
- data/docs/subcommands/label_add.md +1 -4
- data/docs/subcommands/label_list.md +1 -4
- data/docs/subcommands/label_remove.md +0 -3
- data/docs/subcommands/lan_create.md +1 -4
- data/docs/subcommands/lan_delete.md +0 -3
- data/docs/subcommands/lan_list.md +1 -4
- data/docs/subcommands/loadbalancer_create.md +2 -5
- data/docs/subcommands/loadbalancer_delete.md +0 -3
- data/docs/subcommands/loadbalancer_get.md +1 -4
- data/docs/subcommands/loadbalancer_list.md +1 -4
- data/docs/subcommands/loadbalancer_nic_add.md +0 -3
- data/docs/subcommands/loadbalancer_nic_remove.md +0 -3
- data/docs/subcommands/location_list.md +1 -4
- data/docs/subcommands/nic_create.md +3 -6
- data/docs/subcommands/nic_delete.md +1 -4
- data/docs/subcommands/nic_list.md +1 -4
- data/docs/subcommands/node_delete.md +0 -3
- data/docs/subcommands/node_list.md +1 -4
- data/docs/subcommands/node_replace.md +0 -3
- data/docs/subcommands/nodepool_create.md +5 -17
- data/docs/subcommands/nodepool_delete.md +0 -3
- data/docs/subcommands/nodepool_list.md +1 -4
- data/docs/subcommands/pcc_create.md +1 -4
- data/docs/subcommands/pcc_delete.md +1 -4
- data/docs/subcommands/pcc_list.md +1 -4
- data/docs/subcommands/request_list.md +1 -4
- data/docs/subcommands/request_status.md +1 -4
- data/docs/subcommands/request_wait.md +1 -4
- data/docs/subcommands/resource_list.md +1 -4
- data/docs/subcommands/s3key_create.md +1 -4
- data/docs/subcommands/s3key_delete.md +0 -3
- data/docs/subcommands/s3key_list.md +1 -4
- data/docs/subcommands/server_create.md +1 -4
- data/docs/subcommands/server_delete.md +0 -3
- data/docs/subcommands/server_list.md +1 -4
- data/docs/subcommands/server_reboot.md +0 -3
- data/docs/subcommands/server_start.md +0 -3
- data/docs/subcommands/server_stop.md +0 -3
- data/docs/subcommands/share_create.md +2 -5
- data/docs/subcommands/share_delete.md +2 -5
- data/docs/subcommands/share_list.md +1 -4
- data/docs/subcommands/snapshot_create.md +1 -4
- data/docs/subcommands/snapshot_delete.md +1 -4
- data/docs/subcommands/snapshot_list.md +1 -4
- data/docs/subcommands/snapshot_restore.md +1 -4
- data/docs/subcommands/user_create.md +3 -12
- data/docs/subcommands/user_delete.md +1 -4
- data/docs/subcommands/user_list.md +1 -4
- data/docs/subcommands/user_ssourl.md +1 -4
- data/docs/subcommands/volume_attach.md +0 -3
- data/docs/subcommands/volume_create.md +1 -28
- data/docs/subcommands/volume_delete.md +0 -3
- data/docs/subcommands/volume_detach.md +0 -3
- data/docs/subcommands/volume_list.md +1 -4
- data/docs/summary.md +0 -33
- data/knife-ionoscloud.gemspec +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_create.rb +16 -12
- data/lib/chef/knife/ionoscloud_backupunit_delete.rb +5 -3
- data/lib/chef/knife/ionoscloud_backupunit_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_backupunit_ssourl.rb +1 -2
- data/lib/chef/knife/ionoscloud_base.rb +6 -259
- data/lib/chef/knife/ionoscloud_composite_server_create.rb +38 -9
- data/lib/chef/knife/ionoscloud_contract_list.rb +32 -24
- data/lib/chef/knife/ionoscloud_cube_server_create.rb +215 -0
- data/lib/chef/knife/ionoscloud_datacenter_create.rb +14 -12
- data/lib/chef/knife/ionoscloud_datacenter_delete.rb +8 -3
- data/lib/chef/knife/ionoscloud_datacenter_list.rb +3 -4
- data/lib/chef/knife/ionoscloud_firewall_create.rb +24 -7
- data/lib/chef/knife/ionoscloud_firewall_delete.rb +14 -6
- data/lib/chef/knife/ionoscloud_firewall_list.rb +5 -4
- data/lib/chef/knife/ionoscloud_flowlog_create.rb +121 -0
- data/lib/chef/knife/ionoscloud_flowlog_delete.rb +106 -0
- data/lib/chef/knife/ionoscloud_flowlog_list.rb +100 -0
- data/lib/chef/knife/ionoscloud_group_create.rb +46 -16
- data/lib/chef/knife/ionoscloud_group_delete.rb +18 -2
- data/lib/chef/knife/ionoscloud_group_get.rb +17 -2
- data/lib/chef/knife/ionoscloud_group_list.rb +7 -2
- data/lib/chef/knife/ionoscloud_group_user_add.rb +13 -2
- data/lib/chef/knife/ionoscloud_group_user_remove.rb +13 -2
- data/lib/chef/knife/ionoscloud_image_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_ipblock_create.rb +13 -11
- data/lib/chef/knife/ionoscloud_ipblock_delete.rb +4 -3
- data/lib/chef/knife/ionoscloud_ipblock_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_ipfailover_add.rb +15 -9
- data/lib/chef/knife/ionoscloud_ipfailover_remove.rb +9 -3
- data/lib/chef/knife/ionoscloud_k8s_create.rb +30 -28
- data/lib/chef/knife/ionoscloud_k8s_delete.rb +9 -2
- data/lib/chef/knife/ionoscloud_k8s_list.rb +0 -1
- data/lib/chef/knife/ionoscloud_kubeconfig_get.rb +0 -1
- data/lib/chef/knife/ionoscloud_label_add.rb +1 -2
- data/lib/chef/knife/ionoscloud_label_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_label_remove.rb +1 -2
- data/lib/chef/knife/ionoscloud_lan_create.rb +14 -7
- data/lib/chef/knife/ionoscloud_lan_delete.rb +4 -4
- data/lib/chef/knife/ionoscloud_lan_list.rb +2 -5
- data/lib/chef/knife/ionoscloud_loadbalancer_create.rb +16 -7
- data/lib/chef/knife/ionoscloud_loadbalancer_delete.rb +10 -3
- data/lib/chef/knife/ionoscloud_loadbalancer_get.rb +13 -4
- data/lib/chef/knife/ionoscloud_loadbalancer_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_add.rb +14 -5
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_remove.rb +14 -5
- data/lib/chef/knife/ionoscloud_location_list.rb +5 -4
- data/lib/chef/knife/ionoscloud_natgateway_create.rb +71 -0
- data/lib/chef/knife/ionoscloud_natgateway_delete.rb +69 -0
- data/lib/chef/knife/ionoscloud_natgateway_lan_add.rb +82 -0
- data/lib/chef/knife/ionoscloud_natgateway_lan_remove.rb +58 -0
- data/lib/chef/knife/ionoscloud_natgateway_list.rb +49 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_add.rb +124 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_list.rb +63 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_remove.rb +72 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_create.rb +95 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_delete.rb +81 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_list.rb +56 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_add.rb +150 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_list.rb +63 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_remove.rb +78 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_add.rb +141 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_list.rb +68 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove.rb +105 -0
- data/lib/chef/knife/ionoscloud_nic_create.rb +38 -19
- data/lib/chef/knife/ionoscloud_nic_delete.rb +11 -5
- data/lib/chef/knife/ionoscloud_nic_list.rb +9 -6
- data/lib/chef/knife/ionoscloud_node_delete.rb +6 -2
- data/lib/chef/knife/ionoscloud_node_list.rb +0 -2
- data/lib/chef/knife/ionoscloud_node_replace.rb +0 -1
- data/lib/chef/knife/ionoscloud_nodepool_create.rb +60 -38
- data/lib/chef/knife/ionoscloud_nodepool_delete.rb +32 -2
- data/lib/chef/knife/ionoscloud_nodepool_lan_add.rb +130 -0
- data/lib/chef/knife/ionoscloud_nodepool_lan_remove.rb +96 -0
- data/lib/chef/knife/ionoscloud_nodepool_list.rb +3 -2
- data/lib/chef/knife/ionoscloud_pcc_create.rb +18 -13
- data/lib/chef/knife/ionoscloud_pcc_delete.rb +10 -3
- data/lib/chef/knife/ionoscloud_pcc_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_request_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_request_status.rb +1 -2
- data/lib/chef/knife/ionoscloud_request_wait.rb +0 -1
- data/lib/chef/knife/ionoscloud_resource_list.rb +0 -1
- data/lib/chef/knife/ionoscloud_s3key_create.rb +7 -4
- data/lib/chef/knife/ionoscloud_s3key_delete.rb +7 -5
- data/lib/chef/knife/ionoscloud_s3key_list.rb +2 -3
- data/lib/chef/knife/{ionoscloud_server_get.rb → ionoscloud_server_console.rb} +11 -10
- data/lib/chef/knife/ionoscloud_server_create.rb +26 -15
- data/lib/chef/knife/ionoscloud_server_delete.rb +10 -3
- data/lib/chef/knife/ionoscloud_server_list.rb +16 -6
- data/lib/chef/knife/ionoscloud_server_reboot.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_resume.rb +43 -0
- data/lib/chef/knife/ionoscloud_server_start.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_stop.rb +1 -2
- data/lib/chef/knife/ionoscloud_server_suspend.rb +44 -0
- data/lib/chef/knife/ionoscloud_server_token.rb +42 -0
- data/lib/chef/knife/ionoscloud_server_upgrade.rb +44 -0
- data/lib/chef/knife/ionoscloud_share_create.rb +12 -8
- data/lib/chef/knife/ionoscloud_share_delete.rb +4 -3
- data/lib/chef/knife/ionoscloud_share_list.rb +0 -1
- data/lib/chef/knife/ionoscloud_snapshot_create.rb +10 -3
- data/lib/chef/knife/ionoscloud_snapshot_delete.rb +7 -3
- data/lib/chef/knife/ionoscloud_snapshot_list.rb +1 -2
- data/lib/chef/knife/ionoscloud_snapshot_restore.rb +2 -3
- data/lib/chef/knife/ionoscloud_template_list.rb +46 -0
- data/lib/chef/knife/ionoscloud_user_create.rb +20 -25
- data/lib/chef/knife/ionoscloud_user_delete.rb +7 -2
- data/lib/chef/knife/ionoscloud_user_list.rb +0 -1
- data/lib/chef/knife/ionoscloud_user_ssourl.rb +1 -2
- data/lib/chef/knife/ionoscloud_volume_attach.rb +1 -2
- data/lib/chef/knife/ionoscloud_volume_create.rb +31 -57
- data/lib/chef/knife/ionoscloud_volume_delete.rb +9 -3
- data/lib/chef/knife/ionoscloud_volume_detach.rb +9 -3
- data/lib/chef/knife/ionoscloud_volume_list.rb +2 -3
- data/lib/knife-ionoscloud/version.rb +1 -1
- data/spec/chef/knife/ionoscloud_backupunit_create_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_backupunit_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_backupunit_list_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_backupunit_ssourl_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_base_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_composite_server_create_spec.rb +11 -8
- data/spec/chef/knife/ionoscloud_contract_list_spec.rb +32 -27
- data/spec/chef/knife/ionoscloud_cube_server_create_spec.rb +249 -0
- data/spec/chef/knife/ionoscloud_datacenter_create_spec.rb +3 -12
- data/spec/chef/knife/ionoscloud_datacenter_delete_spec.rb +5 -8
- data/spec/chef/knife/ionoscloud_datacenter_list_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_firewall_create_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_firewall_delete_spec.rb +6 -5
- data/spec/chef/knife/ionoscloud_firewall_list_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_flowlog_create_spec.rb +254 -0
- data/spec/chef/knife/ionoscloud_flowlog_delete_spec.rb +360 -0
- data/spec/chef/knife/ionoscloud_flowlog_list_spec.rb +264 -0
- data/spec/chef/knife/ionoscloud_group_create_spec.rb +6 -7
- data/spec/chef/knife/ionoscloud_group_delete_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_group_get_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_group_list_spec.rb +11 -2
- data/spec/chef/knife/ionoscloud_group_user_add_spec.rb +0 -3
- data/spec/chef/knife/ionoscloud_group_user_remove_spec.rb +0 -3
- data/spec/chef/knife/ionoscloud_image_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_ipblock_delete_spec.rb +0 -2
- data/spec/chef/knife/ionoscloud_ipblock_list_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_ipfailover_add_spec.rb +4 -5
- data/spec/chef/knife/ionoscloud_ipfailover_remove_spec.rb +7 -8
- data/spec/chef/knife/ionoscloud_k8s_create_spec.rb +0 -8
- data/spec/chef/knife/ionoscloud_k8s_delete_spec.rb +1 -7
- data/spec/chef/knife/ionoscloud_kubeconfig_get_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_label_add_spec.rb +10 -10
- data/spec/chef/knife/ionoscloud_label_list_spec.rb +14 -14
- data/spec/chef/knife/ionoscloud_label_remove_spec.rb +20 -20
- data/spec/chef/knife/ionoscloud_lan_create_spec.rb +3 -4
- data/spec/chef/knife/ionoscloud_lan_delete_spec.rb +5 -7
- data/spec/chef/knife/ionoscloud_lan_list_spec.rb +3 -5
- data/spec/chef/knife/ionoscloud_loadbalancer_create_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_loadbalancer_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_loadbalancer_get_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_loadbalancer_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_loadbalancer_nic_add_spec.rb +6 -6
- data/spec/chef/knife/ionoscloud_loadbalancer_nic_remove_spec.rb +6 -6
- data/spec/chef/knife/ionoscloud_location_list_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_natgateway_create_spec.rb +77 -0
- data/spec/chef/knife/ionoscloud_natgateway_delete_spec.rb +118 -0
- data/spec/chef/knife/ionoscloud_natgateway_lan_add_spec.rb +143 -0
- data/spec/chef/knife/ionoscloud_natgateway_lan_remove_spec.rb +194 -0
- data/spec/chef/knife/ionoscloud_natgateway_list_spec.rb +79 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_add_spec.rb +98 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_list_spec.rb +92 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_remove_spec.rb +77 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_create_spec.rb +80 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_delete_spec.rb +119 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_list_spec.rb +88 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_add_spec.rb +104 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_list_spec.rb +89 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_remove_spec.rb +124 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_add_spec.rb +109 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_list_spec.rb +85 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove_spec.rb +263 -0
- data/spec/chef/knife/ionoscloud_nic_create_spec.rb +9 -5
- data/spec/chef/knife/ionoscloud_nic_delete_spec.rb +8 -6
- data/spec/chef/knife/ionoscloud_nic_list_spec.rb +12 -6
- data/spec/chef/knife/ionoscloud_nodepool_create_spec.rb +20 -13
- data/spec/chef/knife/ionoscloud_nodepool_delete_spec.rb +13 -27
- data/spec/chef/knife/ionoscloud_nodepool_lan_add_spec.rb +226 -0
- data/spec/chef/knife/ionoscloud_nodepool_lan_remove.rb +199 -0
- data/spec/chef/knife/ionoscloud_nodepool_list_spec.rb +3 -1
- data/spec/chef/knife/ionoscloud_pcc_create_spec.rb +8 -11
- data/spec/chef/knife/ionoscloud_pcc_delete_spec.rb +6 -6
- data/spec/chef/knife/ionoscloud_pcc_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_request_list_spec.rb +24 -25
- data/spec/chef/knife/ionoscloud_request_status_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_s3key_create_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_s3key_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_s3key_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_server_console_spec.rb +97 -0
- data/spec/chef/knife/ionoscloud_server_create_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_server_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_server_list_spec.rb +63 -5
- data/spec/chef/knife/ionoscloud_server_reboot_spec.rb +3 -5
- data/spec/chef/knife/ionoscloud_server_resume_spec.rb +93 -0
- data/spec/chef/knife/ionoscloud_server_start_spec.rb +3 -5
- data/spec/chef/knife/ionoscloud_server_stop_spec.rb +3 -5
- data/spec/chef/knife/ionoscloud_server_suspend_spec.rb +93 -0
- data/spec/chef/knife/ionoscloud_server_token_spec.rb +97 -0
- data/spec/chef/knife/ionoscloud_server_upgrade_spec.rb +96 -0
- data/spec/chef/knife/ionoscloud_snapshot_create_spec.rb +3 -16
- data/spec/chef/knife/ionoscloud_snapshot_delete_spec.rb +5 -17
- data/spec/chef/knife/ionoscloud_snapshot_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_snapshot_restore_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_template_list_spec.rb +78 -0
- data/spec/chef/knife/ionoscloud_user_create_spec.rb +1 -3
- data/spec/chef/knife/ionoscloud_user_delete_spec.rb +2 -4
- data/spec/chef/knife/ionoscloud_user_ssourl_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_volume_attach_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_volume_create_spec.rb +6 -15
- data/spec/chef/knife/ionoscloud_volume_delete_spec.rb +5 -14
- data/spec/chef/knife/ionoscloud_volume_detach_spec.rb +5 -14
- data/spec/chef/knife/ionoscloud_volume_list_spec.rb +4 -4
- data/spec/spec_helper.rb +270 -116
- metadata +93 -138
- data/docs/subcommands/backupunit_get.md +0 -35
- data/docs/subcommands/backupunit_update.md +0 -41
- data/docs/subcommands/datacenter_get.md +0 -35
- data/docs/subcommands/datacenter_update.md +0 -44
- data/docs/subcommands/firewall_get.md +0 -47
- data/docs/subcommands/firewall_update.md +0 -71
- data/docs/subcommands/group_update.md +0 -65
- data/docs/subcommands/ipblock_get.md +0 -35
- data/docs/subcommands/ipblock_update.md +0 -38
- data/docs/subcommands/k8s_get.md +0 -35
- data/docs/subcommands/k8s_update.md +0 -53
- data/docs/subcommands/lan_get.md +0 -39
- data/docs/subcommands/lan_update.md +0 -51
- data/docs/subcommands/loadbalancer_update.md +0 -48
- data/docs/subcommands/nic_get.md +0 -43
- data/docs/subcommands/nic_update.md +0 -58
- data/docs/subcommands/node_get.md +0 -43
- data/docs/subcommands/nodepool_get.md +0 -39
- data/docs/subcommands/nodepool_update.md +0 -69
- data/docs/subcommands/pcc_get.md +0 -35
- data/docs/subcommands/pcc_update.md +0 -41
- data/docs/subcommands/request_get.md +0 -35
- data/docs/subcommands/s3key_get.md +0 -39
- data/docs/subcommands/server_get.md +0 -39
- data/docs/subcommands/server_update.md +0 -60
- data/docs/subcommands/share_get.md +0 -39
- data/docs/subcommands/share_update.md +0 -45
- data/docs/subcommands/snapshot_get.md +0 -35
- data/docs/subcommands/snapshot_update.md +0 -77
- data/docs/subcommands/user_get.md +0 -35
- data/docs/subcommands/user_update.md +0 -56
- data/docs/subcommands/volume_get.md +0 -39
- data/docs/subcommands/volume_update.md +0 -66
- data/lib/chef/knife/ionoscloud_backupunit_get.rb +0 -33
- data/lib/chef/knife/ionoscloud_backupunit_update.rb +0 -62
- data/lib/chef/knife/ionoscloud_datacenter_get.rb +0 -33
- data/lib/chef/knife/ionoscloud_datacenter_update.rb +0 -67
- data/lib/chef/knife/ionoscloud_firewall_get.rb +0 -50
- data/lib/chef/knife/ionoscloud_firewall_update.rb +0 -131
- data/lib/chef/knife/ionoscloud_group_update.rb +0 -114
- data/lib/chef/knife/ionoscloud_ipblock_get.rb +0 -33
- data/lib/chef/knife/ionoscloud_ipblock_update.rb +0 -57
- data/lib/chef/knife/ionoscloud_k8s_get.rb +0 -33
- data/lib/chef/knife/ionoscloud_k8s_update.rb +0 -99
- data/lib/chef/knife/ionoscloud_lan_get.rb +0 -38
- data/lib/chef/knife/ionoscloud_lan_update.rb +0 -87
- data/lib/chef/knife/ionoscloud_loadbalancer_update.rb +0 -73
- data/lib/chef/knife/ionoscloud_nic_get.rb +0 -47
- data/lib/chef/knife/ionoscloud_nic_update.rb +0 -93
- data/lib/chef/knife/ionoscloud_node_get.rb +0 -47
- data/lib/chef/knife/ionoscloud_nodepool_get.rb +0 -41
- data/lib/chef/knife/ionoscloud_nodepool_update.rb +0 -124
- data/lib/chef/knife/ionoscloud_pcc_get.rb +0 -33
- data/lib/chef/knife/ionoscloud_pcc_update.rb +0 -63
- data/lib/chef/knife/ionoscloud_request_get.rb +0 -40
- data/lib/chef/knife/ionoscloud_s3key_get.rb +0 -38
- data/lib/chef/knife/ionoscloud_server_update.rb +0 -97
- data/lib/chef/knife/ionoscloud_share_get.rb +0 -38
- data/lib/chef/knife/ionoscloud_share_update.rb +0 -70
- data/lib/chef/knife/ionoscloud_snapshot_get.rb +0 -32
- data/lib/chef/knife/ionoscloud_snapshot_update.rb +0 -126
- data/lib/chef/knife/ionoscloud_user_get.rb +0 -32
- data/lib/chef/knife/ionoscloud_user_update.rb +0 -92
- data/lib/chef/knife/ionoscloud_volume_get.rb +0 -36
- data/lib/chef/knife/ionoscloud_volume_update.rb +0 -106
- data/spec/chef/knife/ionoscloud_backupunit_get_spec.rb +0 -65
- data/spec/chef/knife/ionoscloud_backupunit_update_spec.rb +0 -78
- data/spec/chef/knife/ionoscloud_datacenter_get_spec.rb +0 -69
- data/spec/chef/knife/ionoscloud_datacenter_update_spec.rb +0 -82
- data/spec/chef/knife/ionoscloud_firewall_get_spec.rb +0 -76
- data/spec/chef/knife/ionoscloud_firewall_update_spec.rb +0 -116
- data/spec/chef/knife/ionoscloud_group_update_spec.rb +0 -109
- data/spec/chef/knife/ionoscloud_ipblock_get_spec.rb +0 -66
- data/spec/chef/knife/ionoscloud_ipblock_update_spec.rb +0 -79
- data/spec/chef/knife/ionoscloud_k8s_get_spec.rb +0 -73
- data/spec/chef/knife/ionoscloud_k8s_update_spec.rb +0 -115
- data/spec/chef/knife/ionoscloud_lan_get_spec.rb +0 -68
- data/spec/chef/knife/ionoscloud_lan_update_spec.rb +0 -91
- data/spec/chef/knife/ionoscloud_loadbalancer_update_spec.rb +0 -89
- data/spec/chef/knife/ionoscloud_nic_get_spec.rb +0 -70
- data/spec/chef/knife/ionoscloud_nic_update_spec.rb +0 -92
- data/spec/chef/knife/ionoscloud_node_get_spec.rb +0 -70
- data/spec/chef/knife/ionoscloud_nodepool_get_spec.rb +0 -83
- data/spec/chef/knife/ionoscloud_nodepool_update_spec.rb +0 -130
- data/spec/chef/knife/ionoscloud_pcc_get_spec.rb +0 -71
- data/spec/chef/knife/ionoscloud_pcc_update_spec.rb +0 -83
- data/spec/chef/knife/ionoscloud_request_get_spec.rb +0 -69
- data/spec/chef/knife/ionoscloud_s3key_get_spec.rb +0 -66
- data/spec/chef/knife/ionoscloud_server_get_spec.rb +0 -71
- data/spec/chef/knife/ionoscloud_server_update_spec.rb +0 -102
- data/spec/chef/knife/ionoscloud_share_get_spec.rb +0 -66
- data/spec/chef/knife/ionoscloud_share_update_spec.rb +0 -91
- data/spec/chef/knife/ionoscloud_snapshot_get_spec.rb +0 -79
- data/spec/chef/knife/ionoscloud_snapshot_update_spec.rb +0 -113
- data/spec/chef/knife/ionoscloud_user_get_spec.rb +0 -70
- data/spec/chef/knife/ionoscloud_user_update_spec.rb +0 -110
- data/spec/chef/knife/ionoscloud_volume_get_spec.rb +0 -80
- data/spec/chef/knife/ionoscloud_volume_update_spec.rb +0 -115
@@ -0,0 +1,69 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNatgatewayDelete < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud natgateway delete NATGATEWAY_ID [NATGATEWAY_ID] (options)'
|
9
|
+
|
10
|
+
option :datacenter_id,
|
11
|
+
short: '-D DATACENTER_ID',
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
13
|
+
description: 'Name of the data center'
|
14
|
+
|
15
|
+
attr_reader :description, :required_options
|
16
|
+
|
17
|
+
def initialize(args = [])
|
18
|
+
super(args)
|
19
|
+
@description =
|
20
|
+
'Deletes an existing NAT Gateway.'
|
21
|
+
@required_options = [:datacenter_id, :ionoscloud_username, :ionoscloud_password]
|
22
|
+
end
|
23
|
+
|
24
|
+
def run
|
25
|
+
$stdout.sync = true
|
26
|
+
validate_required_params(@required_options, config)
|
27
|
+
|
28
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
29
|
+
@name_args.each do |natgateway_id|
|
30
|
+
begin
|
31
|
+
natgateway = natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], natgateway_id, depth: 2)
|
32
|
+
rescue Ionoscloud::ApiError => err
|
33
|
+
raise err unless err.code == 404
|
34
|
+
ui.error("NAT Gateway ID #{natgateway_id} not found. Skipping.")
|
35
|
+
next
|
36
|
+
end
|
37
|
+
|
38
|
+
msg_pair('ID', natgateway.id)
|
39
|
+
msg_pair('Name', natgateway.properties.name)
|
40
|
+
msg_pair('IPS', natgateway.properties.public_ips)
|
41
|
+
msg_pair('LANS', natgateway.properties.lans.map { |el| { id: el.id, gateway_ips: el.gateway_ips } })
|
42
|
+
msg_pair('Rules', natgateway.entities.rules.items.map do |el|
|
43
|
+
{
|
44
|
+
id: el.id,
|
45
|
+
name: el.properties.name,
|
46
|
+
type: el.properties.type,
|
47
|
+
protocol: el.properties.protocol,
|
48
|
+
public_ip: el.properties.public_ip,
|
49
|
+
source_subnet: el.properties.source_subnet,
|
50
|
+
target_subnet: el.properties.target_subnet,
|
51
|
+
target_port_range_start: el.properties.target_port_range ? el.properties.target_port_range.start : '',
|
52
|
+
target_port_range_end: el.properties.target_port_range ? el.properties.target_port_range._end : '',
|
53
|
+
}
|
54
|
+
end
|
55
|
+
)
|
56
|
+
|
57
|
+
begin
|
58
|
+
confirm('Do you really want to delete this NAT Gateway')
|
59
|
+
rescue SystemExit => exc
|
60
|
+
next
|
61
|
+
end
|
62
|
+
|
63
|
+
_, _, headers = natgateways_api.datacenters_natgateways_delete_with_http_info(config[:datacenter_id], natgateway.id)
|
64
|
+
ui.warn("Deleted NAT Gateway #{natgateway.id}. Request ID: #{get_request_id headers}")
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNatgatewayLanAdd < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud natgateway lan add (options)'
|
9
|
+
|
10
|
+
option :datacenter_id,
|
11
|
+
short: '-D DATACENTER_ID',
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
13
|
+
description: 'Name of the data center'
|
14
|
+
|
15
|
+
option :natgateway_id,
|
16
|
+
short: '-G NATGATEWAY_ID',
|
17
|
+
long: '--natgateway-id NATGATEWAY_ID',
|
18
|
+
description: 'ID of the NAT Gateway'
|
19
|
+
|
20
|
+
option :lan_id,
|
21
|
+
short: '-L LAN_ID',
|
22
|
+
long: '--lan LAN_ID',
|
23
|
+
description: 'ID of the LAN'
|
24
|
+
|
25
|
+
option :gateway_ips,
|
26
|
+
short: '-i IP[,IP,...]',
|
27
|
+
long: '--ips IP[,IP,...]',
|
28
|
+
description: 'Collection of gateway IP addresses of the NAT gateway. '\
|
29
|
+
'Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN'
|
30
|
+
|
31
|
+
attr_reader :description, :required_options
|
32
|
+
|
33
|
+
def initialize(args = [])
|
34
|
+
super(args)
|
35
|
+
@description =
|
36
|
+
'Adds a LAN to a Nat Gateway under a data center.'
|
37
|
+
@required_options = [:datacenter_id, :natgateway_id, :lan_id, :ionoscloud_username, :ionoscloud_password]
|
38
|
+
end
|
39
|
+
|
40
|
+
def run
|
41
|
+
$stdout.sync = true
|
42
|
+
validate_required_params(@required_options, config)
|
43
|
+
|
44
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
45
|
+
|
46
|
+
if config[:gateway_ips]
|
47
|
+
config[:gateway_ips] = config[:gateway_ips].split(',')
|
48
|
+
end
|
49
|
+
|
50
|
+
natgateway = natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], config[:natgateway_id])
|
51
|
+
|
52
|
+
existing_lan = natgateway.properties.lans.find { |lan| lan.id == Integer(config[:lan_id]) }
|
53
|
+
|
54
|
+
if existing_lan
|
55
|
+
existing_lan.gateway_ips = config[:gateway_ips]
|
56
|
+
else
|
57
|
+
natgateway.properties.lans.append(
|
58
|
+
Ionoscloud::NatGatewayLanProperties.new(
|
59
|
+
id: Integer(config[:lan_id]),
|
60
|
+
gateway_ips: config[:gateway_ips],
|
61
|
+
),
|
62
|
+
)
|
63
|
+
end
|
64
|
+
|
65
|
+
_, _, headers = natgateways_api.datacenters_natgateways_patch_with_http_info(config[:datacenter_id], config[:natgateway_id], natgateway.properties)
|
66
|
+
|
67
|
+
print "#{ui.color('Adding the LAN to the Nat Gateway...', :magenta)}"
|
68
|
+
dot = ui.color('.', :magenta)
|
69
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
70
|
+
|
71
|
+
natgateway = natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], config[:natgateway_id])
|
72
|
+
|
73
|
+
puts "\n"
|
74
|
+
puts "#{ui.color('ID', :cyan)}: #{natgateway.id}"
|
75
|
+
puts "#{ui.color('Name', :cyan)}: #{natgateway.properties.name}"
|
76
|
+
puts "#{ui.color('IPS', :cyan)}: #{natgateway.properties.public_ips}"
|
77
|
+
puts "#{ui.color('LANS', :cyan)}: #{natgateway.properties.lans.map { |el| { id: el.id, gateway_ips: el.gateway_ips } }}"
|
78
|
+
puts 'done'
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNatgatewayLanRemove < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud natgateway lan remove LAN_ID [LAN_ID] (options)'
|
9
|
+
|
10
|
+
option :datacenter_id,
|
11
|
+
short: '-D DATACENTER_ID',
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
13
|
+
description: 'Name of the data center'
|
14
|
+
|
15
|
+
option :natgateway_id,
|
16
|
+
short: '-G NATGATEWAY_ID',
|
17
|
+
long: '--natgateway-id NATGATEWAY_ID',
|
18
|
+
description: 'ID of the NAT Gateway'
|
19
|
+
|
20
|
+
attr_reader :description, :required_options
|
21
|
+
|
22
|
+
def initialize(args = [])
|
23
|
+
super(args)
|
24
|
+
@description =
|
25
|
+
'Removes the specified LANS from a Nat Gateway under a data center.'
|
26
|
+
@required_options = [:datacenter_id, :natgateway_id, :ionoscloud_username, :ionoscloud_password]
|
27
|
+
end
|
28
|
+
|
29
|
+
def run
|
30
|
+
$stdout.sync = true
|
31
|
+
validate_required_params(@required_options, config)
|
32
|
+
|
33
|
+
return unless @name_args.length > 0
|
34
|
+
|
35
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
36
|
+
|
37
|
+
natgateway = natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], config[:natgateway_id])
|
38
|
+
|
39
|
+
natgateway.properties.lans = natgateway.properties.lans.reject { |lan| @name_args.map { |el| Integer(el) }.include? lan.id }
|
40
|
+
|
41
|
+
natgateway, _, headers = natgateways_api.datacenters_natgateways_patch_with_http_info(config[:datacenter_id], config[:natgateway_id], natgateway.properties)
|
42
|
+
|
43
|
+
print "#{ui.color("Removing LANS #{@name_args} from the NAT Gateway...", :magenta)}"
|
44
|
+
dot = ui.color('.', :magenta)
|
45
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
46
|
+
|
47
|
+
natgateway = natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], natgateway.id)
|
48
|
+
|
49
|
+
puts "\n"
|
50
|
+
puts "#{ui.color('ID', :cyan)}: #{natgateway.id}"
|
51
|
+
puts "#{ui.color('Name', :cyan)}: #{natgateway.properties.name}"
|
52
|
+
puts "#{ui.color('IPS', :cyan)}: #{natgateway.properties.public_ips}"
|
53
|
+
puts "#{ui.color('LANS', :cyan)}: #{natgateway.properties.lans.map { |el| { id: el.id, gateway_ips: el.gateway_ips } }}"
|
54
|
+
puts 'done'
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNatgatewayList < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud natgateway list (options)'
|
9
|
+
|
10
|
+
option :datacenter_id,
|
11
|
+
short: '-D DATACENTER_ID',
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
13
|
+
description: 'The ID of the data center'
|
14
|
+
|
15
|
+
attr_reader :description, :required_options
|
16
|
+
|
17
|
+
def initialize(args = [])
|
18
|
+
super(args)
|
19
|
+
@description =
|
20
|
+
'Lists all available NAT Gateways under a data center.'
|
21
|
+
@required_options = [:datacenter_id, :ionoscloud_username, :ionoscloud_password]
|
22
|
+
end
|
23
|
+
|
24
|
+
def run
|
25
|
+
$stdout.sync = true
|
26
|
+
validate_required_params(@required_options, config)
|
27
|
+
|
28
|
+
$stdout.sync = true
|
29
|
+
natgateway_list = [
|
30
|
+
ui.color('ID', :bold),
|
31
|
+
ui.color('Name', :bold),
|
32
|
+
ui.color('IPS', :bold),
|
33
|
+
ui.color('LANS', :bold),
|
34
|
+
ui.color('Rules Count', :bold),
|
35
|
+
]
|
36
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
37
|
+
|
38
|
+
natgateways_api.datacenters_natgateways_get(config[:datacenter_id], { depth: 3 }).items.each do |natgateway|
|
39
|
+
natgateway_list << natgateway.id
|
40
|
+
natgateway_list << natgateway.properties.name
|
41
|
+
natgateway_list << natgateway.properties.public_ips
|
42
|
+
natgateway_list << natgateway.properties.lans.map { |el| { id: el.id, gateway_ips: el.gateway_ips } }
|
43
|
+
natgateway_list << natgateway.entities.rules.items.length
|
44
|
+
end
|
45
|
+
puts ui.list(natgateway_list, :uneven_columns_across, 5)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,124 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNatgatewayRuleAdd < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud natgateway rule add (options)'
|
9
|
+
|
10
|
+
option :datacenter_id,
|
11
|
+
short: '-D DATACENTER_ID',
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
13
|
+
description: 'Name of the data center'
|
14
|
+
|
15
|
+
option :natgateway_id,
|
16
|
+
short: '-G NATGATEWAY_ID',
|
17
|
+
long: '--natgateway-id NATGATEWAY_ID',
|
18
|
+
description: 'ID of the NAT Gateway'
|
19
|
+
|
20
|
+
option :name,
|
21
|
+
short: '-n NAME',
|
22
|
+
long: '--name NAME',
|
23
|
+
description: 'Name of the NAT gateway rule'
|
24
|
+
|
25
|
+
option :type,
|
26
|
+
short: '-t TYPE',
|
27
|
+
long: '--type TYPE',
|
28
|
+
description: 'Type of the NAT gateway rule',
|
29
|
+
default: 'SNAT'
|
30
|
+
|
31
|
+
option :protocol,
|
32
|
+
short: '-p PROTOCOL',
|
33
|
+
long: '--protocol PROTOCOL',
|
34
|
+
description: "Protocol of the NAT gateway rule. Defaults to ALL. If protocol is "\
|
35
|
+
"'ICMP' then target_port_range start and end cannot be set.",
|
36
|
+
default: 'ALL'
|
37
|
+
|
38
|
+
option :source_subnet,
|
39
|
+
long: '--source SOURCE_SUBNET',
|
40
|
+
description: 'Source subnet of the NAT gateway rule. For SNAT rules it specifies '\
|
41
|
+
'which packets this translation rule applies to based on the packets source IP address.'
|
42
|
+
|
43
|
+
option :public_ip,
|
44
|
+
short: '-i PUBLIC_IP',
|
45
|
+
long: '--ip PUBLIC_IP',
|
46
|
+
description: 'Public IP address of the NAT gateway rule. Specifies the address used for masking outgoing '\
|
47
|
+
'packets source address field. Should be one of the customer reserved IP address already configured on the NAT gateway resource'
|
48
|
+
|
49
|
+
option :target_subnet,
|
50
|
+
long: '--target TARGET_SUBNET',
|
51
|
+
description: 'Target or destination subnet of the NAT gateway rule. For SNAT rules it specifies which packets '\
|
52
|
+
'this translation rule applies to based on the packets destination IP address. If none is provided, rule will match any address'
|
53
|
+
|
54
|
+
option :target_port_range_start,
|
55
|
+
long: '--port-start PORT_RANGE_START',
|
56
|
+
description: 'Target port range start associated with the NAT gateway rule'
|
57
|
+
|
58
|
+
option :target_port_range_end,
|
59
|
+
long: '--port-end PORT_RANGE_START',
|
60
|
+
description: 'Target port range end associated with the NAT gateway rule'
|
61
|
+
|
62
|
+
attr_reader :description, :required_options
|
63
|
+
|
64
|
+
def initialize(args = [])
|
65
|
+
super(args)
|
66
|
+
@description =
|
67
|
+
'Adds a LAN to a Nat Gateway under a data center.'
|
68
|
+
@required_options = [:datacenter_id, :natgateway_id, :name, :source_subnet, :public_ip, :ionoscloud_username, :ionoscloud_password]
|
69
|
+
end
|
70
|
+
|
71
|
+
def run
|
72
|
+
$stdout.sync = true
|
73
|
+
validate_required_params(@required_options, config)
|
74
|
+
|
75
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
76
|
+
|
77
|
+
natgateway_rule = Ionoscloud::NatGatewayRule.new(
|
78
|
+
properties: Ionoscloud::NatGatewayRuleProperties.new(
|
79
|
+
name: config[:name],
|
80
|
+
type: config[:type],
|
81
|
+
protocol: config[:protocol],
|
82
|
+
public_ip: config[:public_ip],
|
83
|
+
source_subnet: config[:source_subnet],
|
84
|
+
target_subnet: config[:target_subnet],
|
85
|
+
target_port_range: Ionoscloud::TargetPortRange.new(
|
86
|
+
start: config[:target_port_range_start],
|
87
|
+
_end: config[:target_port_range_end],
|
88
|
+
),
|
89
|
+
),
|
90
|
+
)
|
91
|
+
|
92
|
+
_, _, headers = natgateways_api.datacenters_natgateways_rules_post_with_http_info(
|
93
|
+
config[:datacenter_id], config[:natgateway_id], natgateway_rule,
|
94
|
+
)
|
95
|
+
|
96
|
+
print "#{ui.color('Adding the rule to the Nat Gateway...', :magenta)}"
|
97
|
+
dot = ui.color('.', :magenta)
|
98
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
99
|
+
|
100
|
+
natgateway = natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], config[:natgateway_id], depth: 2)
|
101
|
+
|
102
|
+
puts "\n"
|
103
|
+
puts "#{ui.color('ID', :cyan)}: #{natgateway.id}"
|
104
|
+
puts "#{ui.color('Name', :cyan)}: #{natgateway.properties.name}"
|
105
|
+
puts "#{ui.color('IPS', :cyan)}: #{natgateway.properties.public_ips}"
|
106
|
+
puts "#{ui.color('LANS', :cyan)}: #{natgateway.properties.lans.map { |el| { id: el.id, gateway_ips: el.gateway_ips } }}"
|
107
|
+
puts "#{ui.color('Rules', :cyan)}: #{natgateway.entities.rules.items.map do |el|
|
108
|
+
{
|
109
|
+
id: el.id,
|
110
|
+
name: el.properties.name,
|
111
|
+
type: el.properties.type,
|
112
|
+
protocol: el.properties.protocol,
|
113
|
+
public_ip: el.properties.public_ip,
|
114
|
+
source_subnet: el.properties.source_subnet,
|
115
|
+
target_subnet: el.properties.target_subnet,
|
116
|
+
target_port_range_start: el.properties.target_port_range ? el.properties.target_port_range.start : '',
|
117
|
+
target_port_range_end: el.properties.target_port_range ? el.properties.target_port_range._end : '',
|
118
|
+
}
|
119
|
+
end}"
|
120
|
+
puts 'done'
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNatgatewayRuleList < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud natgateway rule list (options)'
|
9
|
+
|
10
|
+
option :datacenter_id,
|
11
|
+
short: '-D DATACENTER_ID',
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
13
|
+
description: 'The ID of the data center'
|
14
|
+
|
15
|
+
option :natgateway_id,
|
16
|
+
short: '-G NATGATEWAY_ID',
|
17
|
+
long: '--natgateway-id NATGATEWAY_ID',
|
18
|
+
description: 'ID of the NAT Gateway'
|
19
|
+
|
20
|
+
attr_reader :description, :required_options
|
21
|
+
|
22
|
+
def initialize(args = [])
|
23
|
+
super(args)
|
24
|
+
@description =
|
25
|
+
'Lists all available rules in a NAT Gateways under a data center.'
|
26
|
+
@required_options = [:datacenter_id, :ionoscloud_username, :ionoscloud_password]
|
27
|
+
end
|
28
|
+
|
29
|
+
def run
|
30
|
+
$stdout.sync = true
|
31
|
+
validate_required_params(@required_options, config)
|
32
|
+
|
33
|
+
$stdout.sync = true
|
34
|
+
natgateway_rules_list = [
|
35
|
+
ui.color('ID', :bold),
|
36
|
+
ui.color('Name', :bold),
|
37
|
+
ui.color('Type', :bold),
|
38
|
+
ui.color('Protocol', :bold),
|
39
|
+
ui.color('Public IP', :bold),
|
40
|
+
ui.color('Source Subnet', :bold),
|
41
|
+
ui.color('Target Subnet', :bold),
|
42
|
+
ui.color('Target Port Range Start', :bold),
|
43
|
+
ui.color('Target Port Range End', :bold),
|
44
|
+
]
|
45
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
46
|
+
|
47
|
+
natgateways_api.datacenters_natgateways_rules_get(config[:datacenter_id], config[:natgateway_id], { depth: 1 }).items.each do |natgateway_rule|
|
48
|
+
natgateway_rules_list << natgateway_rule.id
|
49
|
+
natgateway_rules_list << natgateway_rule.properties.name
|
50
|
+
natgateway_rules_list << natgateway_rule.properties.type
|
51
|
+
natgateway_rules_list << natgateway_rule.properties.protocol
|
52
|
+
natgateway_rules_list << natgateway_rule.properties.public_ip
|
53
|
+
natgateway_rules_list << natgateway_rule.properties.source_subnet
|
54
|
+
natgateway_rules_list << natgateway_rule.properties.target_subnet
|
55
|
+
natgateway_rules_list << (natgateway_rule.properties.target_port_range ? natgateway_rule.properties.target_port_range.start : '')
|
56
|
+
natgateway_rules_list << (natgateway_rule.properties.target_port_range ? natgateway_rule.properties.target_port_range._end : '')
|
57
|
+
end
|
58
|
+
|
59
|
+
puts ui.list(natgateway_rules_list, :uneven_columns_across, 9)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNatgatewayRuleRemove < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud natgateway rule remove RULE_ID [RULE_ID] (options)'
|
9
|
+
|
10
|
+
option :datacenter_id,
|
11
|
+
short: '-D DATACENTER_ID',
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
13
|
+
description: 'Name of the data center'
|
14
|
+
|
15
|
+
option :natgateway_id,
|
16
|
+
short: '-G NATGATEWAY_ID',
|
17
|
+
long: '--natgateway-id NATGATEWAY_ID',
|
18
|
+
description: 'ID of the NAT Gateway'
|
19
|
+
|
20
|
+
attr_reader :description, :required_options
|
21
|
+
|
22
|
+
def initialize(args = [])
|
23
|
+
super(args)
|
24
|
+
@description =
|
25
|
+
'Removes the specified rules from a Nat Gateway under a data center.'
|
26
|
+
@required_options = [:datacenter_id, :natgateway_id, :ionoscloud_username, :ionoscloud_password]
|
27
|
+
end
|
28
|
+
|
29
|
+
def run
|
30
|
+
$stdout.sync = true
|
31
|
+
validate_required_params(@required_options, config)
|
32
|
+
|
33
|
+
return unless @name_args.length > 0
|
34
|
+
|
35
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
36
|
+
|
37
|
+
headers_to_wait = []
|
38
|
+
@name_args.each do |rule_id|
|
39
|
+
_, _, headers = natgateways_api.datacenters_natgateways_rules_delete_with_http_info(config[:datacenter_id], config[:natgateway_id], rule_id)
|
40
|
+
headers_to_wait << headers
|
41
|
+
end
|
42
|
+
|
43
|
+
print "#{ui.color("Removing rules #{@name_args} from the NAT Gateway...", :magenta)}"
|
44
|
+
dot = ui.color('.', :magenta)
|
45
|
+
|
46
|
+
headers_to_wait.each { |headers| api_client.wait_for { print dot; is_done? get_request_id headers } }
|
47
|
+
|
48
|
+
natgateway = natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], config[:natgateway_id], depth: 2)
|
49
|
+
|
50
|
+
puts "\n"
|
51
|
+
puts "#{ui.color('ID', :cyan)}: #{natgateway.id}"
|
52
|
+
puts "#{ui.color('Name', :cyan)}: #{natgateway.properties.name}"
|
53
|
+
puts "#{ui.color('IPS', :cyan)}: #{natgateway.properties.public_ips}"
|
54
|
+
puts "#{ui.color('LANS', :cyan)}: #{natgateway.properties.lans.map { |el| { id: el.id, gateway_ips: el.gateway_ips } }}"
|
55
|
+
puts "#{ui.color('Rules', :cyan)}: #{natgateway.entities.rules.items.map do |el|
|
56
|
+
{
|
57
|
+
id: el.id,
|
58
|
+
name: el.properties.name,
|
59
|
+
type: el.properties.type,
|
60
|
+
protocol: el.properties.protocol,
|
61
|
+
public_ip: el.properties.public_ip,
|
62
|
+
source_subnet: el.properties.source_subnet,
|
63
|
+
target_subnet: el.properties.target_subnet,
|
64
|
+
target_port_range_start: el.properties.target_port_range ? el.properties.target_port_range.start : '',
|
65
|
+
target_port_range_end: el.properties.target_port_range ? el.properties.target_port_range._end : '',
|
66
|
+
}
|
67
|
+
end}"
|
68
|
+
puts 'done'
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNetworkloadbalancerCreate < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud networkloadbalancer create (options)'
|
9
|
+
|
10
|
+
option :datacenter_id,
|
11
|
+
short: '-D DATACENTER_ID',
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
13
|
+
description: 'Name of the data center'
|
14
|
+
|
15
|
+
option :name,
|
16
|
+
short: '-n NAME',
|
17
|
+
long: '--name NAME',
|
18
|
+
description: 'Name of the load balancer'
|
19
|
+
|
20
|
+
option :listener_lan,
|
21
|
+
short: '-l LISTENER_LAN_ID',
|
22
|
+
long: '--listener-lan LISTENER_LAN_ID',
|
23
|
+
description: 'Id of the listening LAN. (inbound)'
|
24
|
+
|
25
|
+
option :target_lan,
|
26
|
+
short: '-t TARGET_LAN_ID',
|
27
|
+
long: '--target-lan TARGET_LAN_ID',
|
28
|
+
description: 'Id of the balanced private target LAN. (outbound)'
|
29
|
+
|
30
|
+
option :ips,
|
31
|
+
short: '-i IP[,IP,...]',
|
32
|
+
long: '--ips IP[,IP,...]',
|
33
|
+
description: 'Collection of IP addresses of the Network Load Balancer. (inbound and outbound) '\
|
34
|
+
'IP of the listenerLan must be a customer reserved IP for the public load balancer '\
|
35
|
+
'and private IP for the private load balancer.'
|
36
|
+
|
37
|
+
option :lb_private_ips,
|
38
|
+
long: '--private-ips IP[,IP,...]',
|
39
|
+
description: 'Collection of private IP addresses with subnet mask of the Network Load Balancer. '\
|
40
|
+
'IPs must contain valid subnet mask. If user will not provide any IP then the system '\
|
41
|
+
'will generate one IP with /24 subnet.'
|
42
|
+
|
43
|
+
attr_reader :description, :required_options
|
44
|
+
|
45
|
+
def initialize(args = [])
|
46
|
+
super(args)
|
47
|
+
@description =
|
48
|
+
'Creates an Network Load Balancer within the datacenter.'
|
49
|
+
@required_options = [:datacenter_id, :name, :listener_lan, :target_lan, :ips, :ionoscloud_username, :ionoscloud_password]
|
50
|
+
end
|
51
|
+
|
52
|
+
def run
|
53
|
+
$stdout.sync = true
|
54
|
+
validate_required_params(@required_options, config)
|
55
|
+
|
56
|
+
print "#{ui.color('Creating Network Load Balancer...', :magenta)}"
|
57
|
+
|
58
|
+
config[:ips] = config[:ips].split(',') if config[:ips]
|
59
|
+
config[:lb_private_ips] = config[:lb_private_ips].split(',') if config[:lb_private_ips]
|
60
|
+
|
61
|
+
network_load_balancers_api = Ionoscloud::NetworkLoadBalancersApi.new(api_client)
|
62
|
+
|
63
|
+
network_load_balancer, _, headers = network_load_balancers_api.datacenters_networkloadbalancers_post_with_http_info(
|
64
|
+
config[:datacenter_id],
|
65
|
+
Ionoscloud::NetworkLoadBalancer.new(
|
66
|
+
properties: Ionoscloud::NetworkLoadBalancerProperties.new({
|
67
|
+
name: config[:name],
|
68
|
+
ips: config[:ips],
|
69
|
+
listener_lan: config[:listener_lan],
|
70
|
+
target_lan: config[:target_lan],
|
71
|
+
lb_private_ips: config[:lb_private_ips],
|
72
|
+
}.compact),
|
73
|
+
),
|
74
|
+
)
|
75
|
+
|
76
|
+
|
77
|
+
dot = ui.color('.', :magenta)
|
78
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
79
|
+
|
80
|
+
network_load_balancer = network_load_balancers_api.datacenters_networkloadbalancers_find_by_network_load_balancer_id(
|
81
|
+
config[:datacenter_id], network_load_balancer.id,
|
82
|
+
)
|
83
|
+
|
84
|
+
puts "\n"
|
85
|
+
puts "#{ui.color('ID', :cyan)}: #{network_load_balancer.id}"
|
86
|
+
puts "#{ui.color('Name', :cyan)}: #{network_load_balancer.properties.name}"
|
87
|
+
puts "#{ui.color('Listener LAN', :cyan)}: #{network_load_balancer.properties.listener_lan}"
|
88
|
+
puts "#{ui.color('IPS', :cyan)}: #{network_load_balancer.properties.ips}"
|
89
|
+
puts "#{ui.color('Target LAN', :cyan)}: #{network_load_balancer.properties.target_lan}"
|
90
|
+
puts "#{ui.color('Private IPS', :cyan)}: #{network_load_balancer.properties.lb_private_ips}"
|
91
|
+
puts 'done'
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|