knife-ionoscloud 5.1.2 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/README.md +16 -4
- data/docs/subcommands/backupunit_create.md +6 -3
- data/docs/subcommands/backupunit_delete.md +6 -3
- data/docs/subcommands/backupunit_get.md +6 -3
- data/docs/subcommands/backupunit_list.md +6 -3
- data/docs/subcommands/backupunit_ssourl.md +6 -3
- data/docs/subcommands/backupunit_update.md +6 -3
- data/docs/subcommands/composite_server_create.md +6 -3
- data/docs/subcommands/contract_list.md +6 -3
- data/docs/subcommands/cube_server_create.md +94 -0
- data/docs/subcommands/datacenter_create.md +6 -3
- data/docs/subcommands/datacenter_delete.md +6 -3
- data/docs/subcommands/datacenter_get.md +6 -3
- data/docs/subcommands/datacenter_list.md +6 -3
- data/docs/subcommands/datacenter_update.md +6 -3
- data/docs/subcommands/firewall_create.md +6 -3
- data/docs/subcommands/firewall_delete.md +5 -2
- data/docs/subcommands/firewall_get.md +6 -3
- data/docs/subcommands/firewall_list.md +6 -3
- data/docs/subcommands/firewall_update.md +6 -3
- data/docs/subcommands/flowlog_create.md +66 -0
- data/docs/subcommands/flowlog_delete.md +54 -0
- data/docs/subcommands/flowlog_get.md +58 -0
- data/docs/subcommands/flowlog_list.md +54 -0
- data/docs/subcommands/flowlog_update.md +70 -0
- data/docs/subcommands/group_create.md +6 -3
- data/docs/subcommands/group_delete.md +6 -3
- data/docs/subcommands/group_get.md +6 -3
- data/docs/subcommands/group_list.md +6 -3
- data/docs/subcommands/group_update.md +6 -3
- data/docs/subcommands/group_user_add.md +5 -2
- data/docs/subcommands/group_user_remove.md +5 -2
- data/docs/subcommands/image_list.md +6 -3
- data/docs/subcommands/ipblock_create.md +6 -3
- data/docs/subcommands/ipblock_delete.md +6 -3
- data/docs/subcommands/ipblock_get.md +6 -3
- data/docs/subcommands/ipblock_list.md +6 -3
- data/docs/subcommands/ipblock_update.md +6 -3
- data/docs/subcommands/ipfailover_add.md +6 -3
- data/docs/subcommands/ipfailover_remove.md +6 -3
- data/docs/subcommands/k8s_create.md +6 -6
- data/docs/subcommands/k8s_delete.md +6 -3
- data/docs/subcommands/k8s_get.md +6 -3
- data/docs/subcommands/k8s_list.md +6 -3
- data/docs/subcommands/k8s_update.md +6 -3
- data/docs/subcommands/kubeconfig_get.md +6 -3
- data/docs/subcommands/label_add.md +6 -3
- data/docs/subcommands/label_list.md +6 -3
- data/docs/subcommands/label_remove.md +5 -2
- data/docs/subcommands/lan_create.md +6 -3
- data/docs/subcommands/lan_delete.md +5 -2
- data/docs/subcommands/lan_get.md +6 -3
- data/docs/subcommands/lan_list.md +6 -3
- data/docs/subcommands/lan_update.md +6 -3
- data/docs/subcommands/loadbalancer_create.md +6 -3
- data/docs/subcommands/loadbalancer_delete.md +5 -2
- data/docs/subcommands/loadbalancer_get.md +6 -3
- data/docs/subcommands/loadbalancer_list.md +6 -3
- data/docs/subcommands/loadbalancer_nic_add.md +5 -2
- data/docs/subcommands/loadbalancer_nic_remove.md +5 -2
- data/docs/subcommands/loadbalancer_update.md +6 -3
- data/docs/subcommands/location_list.md +6 -3
- data/docs/subcommands/natgateway_create.md +44 -0
- data/docs/subcommands/natgateway_delete.md +38 -0
- data/docs/subcommands/natgateway_get.md +42 -0
- data/docs/subcommands/natgateway_lan_add.md +49 -0
- data/docs/subcommands/natgateway_lan_remove.md +42 -0
- data/docs/subcommands/natgateway_list.md +38 -0
- data/docs/subcommands/natgateway_rule_add.md +69 -0
- data/docs/subcommands/natgateway_rule_list.md +41 -0
- data/docs/subcommands/natgateway_rule_remove.md +42 -0
- data/docs/subcommands/natgateway_rule_update.md +69 -0
- data/docs/subcommands/natgateway_update.md +51 -0
- data/docs/subcommands/networkloadbalancer_create.md +57 -0
- data/docs/subcommands/networkloadbalancer_delete.md +38 -0
- data/docs/subcommands/networkloadbalancer_get.md +42 -0
- data/docs/subcommands/networkloadbalancer_list.md +38 -0
- data/docs/subcommands/networkloadbalancer_rule_add.md +75 -0
- data/docs/subcommands/networkloadbalancer_rule_list.md +42 -0
- data/docs/subcommands/networkloadbalancer_rule_remove.md +42 -0
- data/docs/subcommands/networkloadbalancer_rule_target_add.md +67 -0
- data/docs/subcommands/networkloadbalancer_rule_target_list.md +46 -0
- data/docs/subcommands/networkloadbalancer_rule_target_remove.md +54 -0
- data/docs/subcommands/networkloadbalancer_rule_update.md +75 -0
- data/docs/subcommands/networkloadbalancer_update.md +57 -0
- data/docs/subcommands/nic_create.md +6 -3
- data/docs/subcommands/nic_delete.md +5 -2
- data/docs/subcommands/nic_get.md +6 -3
- data/docs/subcommands/nic_list.md +6 -3
- data/docs/subcommands/nic_update.md +6 -3
- data/docs/subcommands/node_delete.md +5 -2
- data/docs/subcommands/node_get.md +6 -3
- data/docs/subcommands/node_list.md +6 -3
- data/docs/subcommands/node_replace.md +5 -2
- data/docs/subcommands/nodepool_create.md +6 -3
- data/docs/subcommands/nodepool_delete.md +5 -2
- data/docs/subcommands/nodepool_get.md +6 -3
- data/docs/subcommands/nodepool_lan_add.md +52 -0
- data/docs/subcommands/nodepool_lan_remove.md +42 -0
- data/docs/subcommands/nodepool_list.md +6 -3
- data/docs/subcommands/nodepool_update.md +6 -3
- data/docs/subcommands/pcc_create.md +6 -3
- data/docs/subcommands/pcc_delete.md +6 -3
- data/docs/subcommands/pcc_get.md +6 -3
- data/docs/subcommands/pcc_list.md +6 -3
- data/docs/subcommands/pcc_update.md +6 -3
- data/docs/subcommands/request_get.md +6 -3
- data/docs/subcommands/request_list.md +6 -3
- data/docs/subcommands/request_status.md +6 -3
- data/docs/subcommands/request_wait.md +6 -3
- data/docs/subcommands/resource_list.md +6 -3
- data/docs/subcommands/s3key_create.md +6 -3
- data/docs/subcommands/s3key_delete.md +5 -2
- data/docs/subcommands/s3key_get.md +6 -3
- data/docs/subcommands/s3key_list.md +6 -3
- data/docs/subcommands/server_console.md +42 -0
- data/docs/subcommands/server_create.md +6 -3
- data/docs/subcommands/server_delete.md +5 -2
- data/docs/subcommands/server_get.md +6 -3
- data/docs/subcommands/server_list.md +6 -3
- data/docs/subcommands/server_reboot.md +5 -2
- data/docs/subcommands/server_resume.md +38 -0
- data/docs/subcommands/server_start.md +5 -2
- data/docs/subcommands/server_stop.md +5 -2
- data/docs/subcommands/server_suspend.md +38 -0
- data/docs/subcommands/server_token.md +42 -0
- data/docs/subcommands/server_update.md +6 -3
- data/docs/subcommands/server_upgrade.md +42 -0
- data/docs/subcommands/share_create.md +6 -3
- data/docs/subcommands/share_delete.md +5 -2
- data/docs/subcommands/share_get.md +6 -3
- data/docs/subcommands/share_list.md +6 -3
- data/docs/subcommands/share_update.md +6 -3
- data/docs/subcommands/snapshot_create.md +6 -3
- data/docs/subcommands/snapshot_delete.md +6 -3
- data/docs/subcommands/snapshot_get.md +6 -3
- data/docs/subcommands/snapshot_list.md +6 -3
- data/docs/subcommands/snapshot_restore.md +6 -3
- data/docs/subcommands/snapshot_update.md +16 -13
- data/docs/subcommands/template_list.md +34 -0
- data/docs/subcommands/user_create.md +6 -3
- data/docs/subcommands/user_delete.md +6 -3
- data/docs/subcommands/user_get.md +6 -3
- data/docs/subcommands/user_list.md +6 -3
- data/docs/subcommands/user_ssourl.md +6 -3
- data/docs/subcommands/user_update.md +6 -3
- data/docs/subcommands/volume_attach.md +5 -2
- data/docs/subcommands/volume_create.md +6 -3
- data/docs/subcommands/volume_delete.md +5 -2
- data/docs/subcommands/volume_detach.md +5 -2
- data/docs/subcommands/volume_get.md +6 -3
- data/docs/subcommands/volume_list.md +6 -3
- data/docs/subcommands/volume_update.md +6 -3
- data/docs/summary.md +37 -0
- data/knife-ionoscloud.gemspec +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_create.rb +2 -1
- data/lib/chef/knife/ionoscloud_backupunit_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_get.rb +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_ssourl.rb +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_update.rb +2 -2
- data/lib/chef/knife/ionoscloud_base.rb +111 -5
- data/lib/chef/knife/ionoscloud_composite_server_create.rb +37 -11
- data/lib/chef/knife/ionoscloud_contract_list.rb +32 -23
- data/lib/chef/knife/ionoscloud_cube_server_create.rb +212 -0
- data/lib/chef/knife/ionoscloud_datacenter_create.rb +2 -2
- data/lib/chef/knife/ionoscloud_datacenter_delete.rb +2 -1
- data/lib/chef/knife/ionoscloud_datacenter_get.rb +1 -1
- data/lib/chef/knife/ionoscloud_datacenter_list.rb +3 -3
- data/lib/chef/knife/ionoscloud_datacenter_update.rb +1 -1
- data/lib/chef/knife/ionoscloud_firewall_create.rb +16 -12
- data/lib/chef/knife/ionoscloud_firewall_delete.rb +3 -3
- data/lib/chef/knife/ionoscloud_firewall_get.rb +5 -3
- data/lib/chef/knife/ionoscloud_firewall_list.rb +5 -3
- data/lib/chef/knife/ionoscloud_firewall_update.rb +7 -6
- data/lib/chef/knife/ionoscloud_flowlog_create.rb +114 -0
- data/lib/chef/knife/ionoscloud_flowlog_delete.rb +103 -0
- data/lib/chef/knife/ionoscloud_flowlog_get.rb +84 -0
- data/lib/chef/knife/ionoscloud_flowlog_list.rb +101 -0
- data/lib/chef/knife/ionoscloud_flowlog_update.rb +125 -0
- data/lib/chef/knife/ionoscloud_group_create.rb +31 -15
- data/lib/chef/knife/ionoscloud_group_get.rb +1 -3
- data/lib/chef/knife/ionoscloud_group_list.rb +7 -1
- data/lib/chef/knife/ionoscloud_group_update.rb +17 -0
- data/lib/chef/knife/ionoscloud_group_user_add.rb +1 -6
- data/lib/chef/knife/ionoscloud_group_user_remove.rb +1 -6
- data/lib/chef/knife/ionoscloud_image_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_ipblock_delete.rb +0 -1
- data/lib/chef/knife/ionoscloud_ipblock_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_ipfailover_add.rb +15 -8
- data/lib/chef/knife/ionoscloud_ipfailover_remove.rb +9 -2
- data/lib/chef/knife/ionoscloud_k8s_create.rb +13 -18
- data/lib/chef/knife/ionoscloud_label_add.rb +1 -1
- data/lib/chef/knife/ionoscloud_label_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_label_remove.rb +1 -1
- data/lib/chef/knife/ionoscloud_lan_create.rb +1 -2
- data/lib/chef/knife/ionoscloud_lan_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_lan_get.rb +1 -1
- data/lib/chef/knife/ionoscloud_lan_list.rb +3 -4
- data/lib/chef/knife/ionoscloud_lan_update.rb +2 -13
- data/lib/chef/knife/ionoscloud_loadbalancer_create.rb +2 -1
- data/lib/chef/knife/ionoscloud_loadbalancer_delete.rb +2 -1
- data/lib/chef/knife/ionoscloud_loadbalancer_get.rb +5 -5
- data/lib/chef/knife/ionoscloud_loadbalancer_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_add.rb +4 -6
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_remove.rb +4 -7
- data/lib/chef/knife/ionoscloud_loadbalancer_update.rb +1 -1
- data/lib/chef/knife/ionoscloud_location_list.rb +5 -3
- data/lib/chef/knife/ionoscloud_natgateway_create.rb +60 -0
- data/lib/chef/knife/ionoscloud_natgateway_delete.rb +54 -0
- data/lib/chef/knife/ionoscloud_natgateway_get.rb +42 -0
- data/lib/chef/knife/ionoscloud_natgateway_lan_add.rb +74 -0
- data/lib/chef/knife/ionoscloud_natgateway_lan_remove.rb +52 -0
- data/lib/chef/knife/ionoscloud_natgateway_list.rb +51 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_add.rb +105 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_list.rb +65 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_remove.rb +55 -0
- data/lib/chef/knife/ionoscloud_natgateway_rule_update.rb +116 -0
- data/lib/chef/knife/ionoscloud_natgateway_update.rb +84 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_create.rb +89 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_delete.rb +62 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_get.rb +42 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_list.rb +57 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_add.rb +135 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_list.rb +65 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_remove.rb +68 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_add.rb +123 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_list.rb +70 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove.rb +88 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_update.rb +148 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_update.rb +98 -0
- data/lib/chef/knife/ionoscloud_nic_create.rb +25 -19
- data/lib/chef/knife/ionoscloud_nic_delete.rb +3 -2
- data/lib/chef/knife/ionoscloud_nic_get.rb +7 -5
- data/lib/chef/knife/ionoscloud_nic_list.rb +9 -5
- data/lib/chef/knife/ionoscloud_nic_update.rb +8 -5
- data/lib/chef/knife/ionoscloud_node_delete.rb +6 -1
- data/lib/chef/knife/ionoscloud_node_get.rb +7 -5
- data/lib/chef/knife/ionoscloud_node_list.rb +0 -1
- data/lib/chef/knife/ionoscloud_nodepool_create.rb +12 -21
- data/lib/chef/knife/ionoscloud_nodepool_get.rb +6 -4
- data/lib/chef/knife/ionoscloud_nodepool_lan_add.rb +103 -0
- data/lib/chef/knife/ionoscloud_nodepool_lan_remove.rb +72 -0
- data/lib/chef/knife/ionoscloud_nodepool_list.rb +3 -1
- data/lib/chef/knife/ionoscloud_pcc_create.rb +4 -4
- data/lib/chef/knife/ionoscloud_pcc_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_pcc_get.rb +1 -1
- data/lib/chef/knife/ionoscloud_pcc_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_pcc_update.rb +1 -1
- data/lib/chef/knife/ionoscloud_request_get.rb +1 -1
- data/lib/chef/knife/ionoscloud_request_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_request_status.rb +1 -1
- data/lib/chef/knife/ionoscloud_s3key_create.rb +2 -2
- data/lib/chef/knife/ionoscloud_s3key_delete.rb +3 -3
- data/lib/chef/knife/ionoscloud_s3key_get.rb +1 -1
- data/lib/chef/knife/ionoscloud_s3key_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_console.rb +43 -0
- data/lib/chef/knife/ionoscloud_server_create.rb +5 -7
- data/lib/chef/knife/ionoscloud_server_delete.rb +3 -1
- data/lib/chef/knife/ionoscloud_server_get.rb +8 -6
- data/lib/chef/knife/ionoscloud_server_list.rb +16 -5
- data/lib/chef/knife/ionoscloud_server_reboot.rb +1 -1
- data/lib/chef/knife/ionoscloud_server_resume.rb +44 -0
- data/lib/chef/knife/ionoscloud_server_start.rb +1 -1
- data/lib/chef/knife/ionoscloud_server_stop.rb +1 -1
- data/lib/chef/knife/ionoscloud_server_suspend.rb +45 -0
- data/lib/chef/knife/ionoscloud_server_token.rb +43 -0
- data/lib/chef/knife/ionoscloud_server_update.rb +1 -1
- data/lib/chef/knife/ionoscloud_server_upgrade.rb +45 -0
- data/lib/chef/knife/ionoscloud_share_create.rb +1 -0
- data/lib/chef/knife/ionoscloud_share_delete.rb +2 -1
- data/lib/chef/knife/ionoscloud_snapshot_create.rb +2 -2
- data/lib/chef/knife/ionoscloud_snapshot_delete.rb +1 -1
- data/lib/chef/knife/ionoscloud_snapshot_get.rb +1 -1
- data/lib/chef/knife/ionoscloud_snapshot_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_snapshot_restore.rb +3 -14
- data/lib/chef/knife/ionoscloud_snapshot_update.rb +1 -1
- data/lib/chef/knife/ionoscloud_template_list.rb +47 -0
- data/lib/chef/knife/ionoscloud_user_create.rb +12 -23
- data/lib/chef/knife/ionoscloud_user_delete.rb +1 -0
- data/lib/chef/knife/ionoscloud_user_ssourl.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_attach.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_create.rb +18 -54
- data/lib/chef/knife/ionoscloud_volume_delete.rb +2 -1
- data/lib/chef/knife/ionoscloud_volume_detach.rb +9 -2
- data/lib/chef/knife/ionoscloud_volume_get.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_volume_update.rb +3 -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_get_spec.rb +2 -2
- 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_backupunit_update_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 -9
- data/spec/chef/knife/ionoscloud_datacenter_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_datacenter_get_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_datacenter_list_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_datacenter_update_spec.rb +3 -3
- 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_get_spec.rb +3 -2
- data/spec/chef/knife/ionoscloud_firewall_list_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_firewall_update_spec.rb +4 -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_get_spec.rb +171 -0
- data/spec/chef/knife/ionoscloud_flowlog_list_spec.rb +264 -0
- data/spec/chef/knife/ionoscloud_flowlog_update_spec.rb +244 -0
- data/spec/chef/knife/ionoscloud_group_create_spec.rb +9 -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_update_spec.rb +24 -12
- data/spec/chef/knife/ionoscloud_group_user_add_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_group_user_remove_spec.rb +3 -0
- 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 +3 -4
- data/spec/chef/knife/ionoscloud_ipfailover_remove_spec.rb +4 -5
- data/spec/chef/knife/ionoscloud_k8s_create_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_k8s_delete_spec.rb +15 -16
- data/spec/chef/knife/ionoscloud_k8s_get_spec.rb +0 -1
- data/spec/chef/knife/ionoscloud_k8s_update_spec.rb +0 -1
- 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 -3
- data/spec/chef/knife/ionoscloud_lan_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_lan_get_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_lan_list_spec.rb +3 -5
- data/spec/chef/knife/ionoscloud_lan_update_spec.rb +4 -8
- 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_loadbalancer_update_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_location_list_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_natgateway_create_spec.rb +92 -0
- data/spec/chef/knife/ionoscloud_natgateway_delete_spec.rb +118 -0
- data/spec/chef/knife/ionoscloud_natgateway_get_spec.rb +81 -0
- data/spec/chef/knife/ionoscloud_natgateway_lan_add_spec.rb +158 -0
- data/spec/chef/knife/ionoscloud_natgateway_lan_remove_spec.rb +209 -0
- data/spec/chef/knife/ionoscloud_natgateway_list_spec.rb +79 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_add_spec.rb +99 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_list_spec.rb +92 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_remove_spec.rb +78 -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 +93 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_delete_spec.rb +120 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_get_spec.rb +82 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_list_spec.rb +88 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_add_spec.rb +105 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_list_spec.rb +89 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_remove_spec.rb +150 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_add_spec.rb +113 -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 +281 -0
- 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_create_spec.rb +9 -5
- data/spec/chef/knife/ionoscloud_nic_delete_spec.rb +8 -6
- data/spec/chef/knife/ionoscloud_nic_get_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_nic_list_spec.rb +12 -6
- data/spec/chef/knife/ionoscloud_nic_update_spec.rb +10 -5
- data/spec/chef/knife/ionoscloud_nodepool_create_spec.rb +9 -11
- data/spec/chef/knife/ionoscloud_nodepool_delete_spec.rb +25 -25
- data/spec/chef/knife/ionoscloud_nodepool_get_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_nodepool_lan_add_spec.rb +222 -0
- data/spec/chef/knife/ionoscloud_nodepool_lan_remove.rb +196 -0
- data/spec/chef/knife/ionoscloud_nodepool_list_spec.rb +3 -1
- data/spec/chef/knife/ionoscloud_nodepool_update_spec.rb +5 -1
- data/spec/chef/knife/ionoscloud_pcc_create_spec.rb +7 -7
- data/spec/chef/knife/ionoscloud_pcc_delete_spec.rb +6 -6
- data/spec/chef/knife/ionoscloud_pcc_get_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_pcc_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_pcc_update_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_request_get_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_get_spec.rb +2 -2
- 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 +6 -3
- data/spec/chef/knife/ionoscloud_server_delete_spec.rb +8 -5
- data/spec/chef/knife/ionoscloud_server_get_spec.rb +5 -2
- 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_update_spec.rb +6 -3
- data/spec/chef/knife/ionoscloud_server_upgrade_spec.rb +96 -0
- data/spec/chef/knife/ionoscloud_snapshot_create_spec.rb +3 -4
- data/spec/chef/knife/ionoscloud_snapshot_delete_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_snapshot_get_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_snapshot_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_snapshot_restore_spec.rb +12 -3
- data/spec/chef/knife/ionoscloud_snapshot_update_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_template_list_spec.rb +78 -0
- 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 +12 -11
- data/spec/chef/knife/ionoscloud_volume_delete_spec.rb +6 -5
- data/spec/chef/knife/ionoscloud_volume_detach_spec.rb +5 -14
- data/spec/chef/knife/ionoscloud_volume_get_spec.rb +3 -2
- data/spec/chef/knife/ionoscloud_volume_list_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_volume_update_spec.rb +4 -3
- data/spec/spec_helper.rb +268 -96
- metadata +152 -4
@@ -34,7 +34,7 @@ class Chef
|
|
34
34
|
ui.color('NICs count', :bold),
|
35
35
|
]
|
36
36
|
|
37
|
-
load_balancer_api = Ionoscloud::
|
37
|
+
load_balancer_api = Ionoscloud::LoadBalancersApi.new(api_client)
|
38
38
|
|
39
39
|
load_balancer_api.datacenters_loadbalancers_get(config[:datacenter_id], { depth: 2 }).items.each do |load_balancer|
|
40
40
|
load_balancers_list << load_balancer.id
|
@@ -31,7 +31,7 @@ class Chef
|
|
31
31
|
handle_extra_config
|
32
32
|
validate_required_params(@required_options, config)
|
33
33
|
|
34
|
-
load_balancer_api = Ionoscloud::
|
34
|
+
load_balancer_api = Ionoscloud::LoadBalancersApi.new(api_client)
|
35
35
|
|
36
36
|
request_ids_to_wait = []
|
37
37
|
|
@@ -55,11 +55,9 @@ class Chef
|
|
55
55
|
|
56
56
|
request_ids_to_wait.each { |request_id| api_client.wait_for { is_done? request_id } }
|
57
57
|
|
58
|
-
print_load_balancer(
|
59
|
-
|
60
|
-
|
61
|
-
{ depth: 1 },
|
62
|
-
))
|
58
|
+
print_load_balancer(
|
59
|
+
load_balancer_api.datacenters_loadbalancers_find_by_id(config[:datacenter_id], config[:loadbalancer_id], depth: 1),
|
60
|
+
)
|
63
61
|
end
|
64
62
|
end
|
65
63
|
end
|
@@ -31,7 +31,7 @@ class Chef
|
|
31
31
|
handle_extra_config
|
32
32
|
validate_required_params(@required_options, config)
|
33
33
|
|
34
|
-
load_balancer_api = Ionoscloud::
|
34
|
+
load_balancer_api = Ionoscloud::LoadBalancersApi.new(api_client)
|
35
35
|
|
36
36
|
request_ids_to_wait = []
|
37
37
|
|
@@ -51,16 +51,13 @@ class Chef
|
|
51
51
|
ui.error("NIC ID #{nic_id} not found. Skipping.")
|
52
52
|
next
|
53
53
|
end
|
54
|
-
|
55
54
|
end
|
56
55
|
|
57
56
|
request_ids_to_wait.each { |request_id| api_client.wait_for { is_done? request_id } }
|
58
57
|
|
59
|
-
print_load_balancer(
|
60
|
-
|
61
|
-
|
62
|
-
{ depth: 1 },
|
63
|
-
))
|
58
|
+
print_load_balancer(
|
59
|
+
load_balancer_api.datacenters_loadbalancers_find_by_id(config[:datacenter_id], config[:loadbalancer_id], depth: 1),
|
60
|
+
)
|
64
61
|
end
|
65
62
|
end
|
66
63
|
end
|
@@ -45,7 +45,7 @@ class Chef
|
|
45
45
|
handle_extra_config
|
46
46
|
validate_required_params(@required_options, config)
|
47
47
|
|
48
|
-
load_balancer_api = Ionoscloud::
|
48
|
+
load_balancer_api = Ionoscloud::LoadBalancersApi.new(api_client)
|
49
49
|
|
50
50
|
if @updatable_fields.map { |el| config[el] }.any?
|
51
51
|
print "#{ui.color('Updating Load Balancer...', :magenta)}"
|
@@ -23,16 +23,18 @@ class Chef
|
|
23
23
|
|
24
24
|
location_list = [
|
25
25
|
ui.color('ID', :bold),
|
26
|
-
ui.color('Name', :bold)
|
26
|
+
ui.color('Name', :bold),
|
27
|
+
ui.color('CPU Architectures', :bold),
|
27
28
|
]
|
28
|
-
location_api = Ionoscloud::
|
29
|
+
location_api = Ionoscloud::LocationsApi.new(api_client)
|
29
30
|
|
30
31
|
location_api.locations_get({ depth: 1 }).items.each do |location|
|
31
32
|
location_list << location.id
|
32
33
|
location_list << location.properties.name
|
34
|
+
location_list << location.properties.cpu_architecture.map { |arch| arch.cpu_family }
|
33
35
|
end
|
34
36
|
|
35
|
-
puts ui.list(location_list, :uneven_columns_across,
|
37
|
+
puts ui.list(location_list, :uneven_columns_across, 3)
|
36
38
|
end
|
37
39
|
end
|
38
40
|
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNatgatewayCreate < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud natgateway 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 NAT gateway'
|
19
|
+
|
20
|
+
option :ips,
|
21
|
+
short: '-i IP[,IP,...]',
|
22
|
+
long: '--ips IP[,IP,...]',
|
23
|
+
description: 'Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location'
|
24
|
+
|
25
|
+
attr_reader :description, :required_options
|
26
|
+
|
27
|
+
def initialize(args = [])
|
28
|
+
super(args)
|
29
|
+
@description =
|
30
|
+
'Creates a new Nat Gateway under a data center.'
|
31
|
+
@required_options = [:datacenter_id, :ionoscloud_username, :ionoscloud_password]
|
32
|
+
end
|
33
|
+
|
34
|
+
def run
|
35
|
+
$stdout.sync = true
|
36
|
+
handle_extra_config
|
37
|
+
validate_required_params(@required_options, config)
|
38
|
+
|
39
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
40
|
+
|
41
|
+
config[:ips] = config[:ips].split(',') if config[:ips] && config[:ips].instance_of?(String)
|
42
|
+
|
43
|
+
natgateway = Ionoscloud::NatGateway.new(
|
44
|
+
properties: Ionoscloud::NatGatewayProperties.new(
|
45
|
+
name: config[:name],
|
46
|
+
public_ips: config[:ips],
|
47
|
+
)
|
48
|
+
)
|
49
|
+
|
50
|
+
natgateway, _, headers = natgateways_api.datacenters_natgateways_post_with_http_info(config[:datacenter_id], natgateway)
|
51
|
+
|
52
|
+
print "#{ui.color('Creating Nat Gateway...', :magenta)}"
|
53
|
+
dot = ui.color('.', :magenta)
|
54
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
55
|
+
|
56
|
+
print_natgateway(natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], natgateway.id, depth: 2))
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,54 @@
|
|
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
|
+
handle_extra_config
|
27
|
+
validate_required_params(@required_options, config)
|
28
|
+
|
29
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
30
|
+
@name_args.each do |natgateway_id|
|
31
|
+
begin
|
32
|
+
natgateway = natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], natgateway_id, depth: 2)
|
33
|
+
rescue Ionoscloud::ApiError => err
|
34
|
+
raise err unless err.code == 404
|
35
|
+
ui.error("NAT Gateway ID #{natgateway_id} not found. Skipping.")
|
36
|
+
next
|
37
|
+
end
|
38
|
+
|
39
|
+
print_natgateway(natgateway)
|
40
|
+
puts "\n"
|
41
|
+
|
42
|
+
begin
|
43
|
+
confirm('Do you really want to delete this NAT Gateway')
|
44
|
+
rescue SystemExit => exc
|
45
|
+
next
|
46
|
+
end
|
47
|
+
|
48
|
+
_, _, headers = natgateways_api.datacenters_natgateways_delete_with_http_info(config[:datacenter_id], natgateway.id)
|
49
|
+
ui.warn("Deleted NAT Gateway #{natgateway.id}. Request ID: #{get_request_id headers}")
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNatgatewayGet < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud natgateway get (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
|
+
'Retrieves the attributes of a given NAT Gateway.'
|
26
|
+
@required_options = [:datacenter_id, :natgateway_id, :ionoscloud_username, :ionoscloud_password]
|
27
|
+
end
|
28
|
+
|
29
|
+
def run
|
30
|
+
$stdout.sync = true
|
31
|
+
handle_extra_config
|
32
|
+
validate_required_params(@required_options, config)
|
33
|
+
|
34
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
35
|
+
|
36
|
+
print_natgateway(
|
37
|
+
natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], config[:natgateway_id], depth: 2),
|
38
|
+
)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,74 @@
|
|
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
|
+
handle_extra_config
|
43
|
+
validate_required_params(@required_options, config)
|
44
|
+
|
45
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
46
|
+
|
47
|
+
config[:gateway_ips] = config[:gateway_ips].split(',') if config[:gateway_ips] && config[:gateway_ips].instance_of?(String)
|
48
|
+
|
49
|
+
natgateway = natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], config[:natgateway_id])
|
50
|
+
|
51
|
+
existing_lan = natgateway.properties.lans.find { |lan| lan.id == Integer(config[:lan_id]) }
|
52
|
+
|
53
|
+
if existing_lan
|
54
|
+
existing_lan.gateway_ips = config[:gateway_ips]
|
55
|
+
else
|
56
|
+
natgateway.properties.lans.append(
|
57
|
+
Ionoscloud::NatGatewayLanProperties.new(
|
58
|
+
id: Integer(config[:lan_id]),
|
59
|
+
gateway_ips: config[:gateway_ips],
|
60
|
+
),
|
61
|
+
)
|
62
|
+
end
|
63
|
+
|
64
|
+
_, _, headers = natgateways_api.datacenters_natgateways_patch_with_http_info(config[:datacenter_id], config[:natgateway_id], natgateway.properties)
|
65
|
+
|
66
|
+
print "#{ui.color('Adding the LAN to the Nat Gateway...', :magenta)}"
|
67
|
+
dot = ui.color('.', :magenta)
|
68
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
69
|
+
|
70
|
+
print_natgateway(natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], config[:natgateway_id]))
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,52 @@
|
|
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
|
+
handle_extra_config
|
32
|
+
validate_required_params(@required_options, config)
|
33
|
+
|
34
|
+
return unless @name_args.length > 0
|
35
|
+
|
36
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
37
|
+
|
38
|
+
natgateway = natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], config[:natgateway_id])
|
39
|
+
|
40
|
+
natgateway.properties.lans = natgateway.properties.lans.reject { |lan| @name_args.map { |el| Integer(el) }.include? lan.id }
|
41
|
+
|
42
|
+
natgateway, _, headers = natgateways_api.datacenters_natgateways_patch_with_http_info(config[:datacenter_id], config[:natgateway_id], natgateway.properties)
|
43
|
+
|
44
|
+
print "#{ui.color("Removing LANS #{@name_args} from the NAT Gateway...", :magenta)}"
|
45
|
+
dot = ui.color('.', :magenta)
|
46
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
47
|
+
|
48
|
+
print_natgateway(natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], natgateway.id))
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,51 @@
|
|
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
|
+
handle_extra_config
|
27
|
+
validate_required_params(@required_options, config)
|
28
|
+
|
29
|
+
$stdout.sync = true
|
30
|
+
handle_extra_config
|
31
|
+
natgateway_list = [
|
32
|
+
ui.color('ID', :bold),
|
33
|
+
ui.color('Name', :bold),
|
34
|
+
ui.color('IPS', :bold),
|
35
|
+
ui.color('LANS', :bold),
|
36
|
+
ui.color('Rules Count', :bold),
|
37
|
+
]
|
38
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
39
|
+
|
40
|
+
natgateways_api.datacenters_natgateways_get(config[:datacenter_id], { depth: 3 }).items.each do |natgateway|
|
41
|
+
natgateway_list << natgateway.id
|
42
|
+
natgateway_list << natgateway.properties.name
|
43
|
+
natgateway_list << natgateway.properties.public_ips
|
44
|
+
natgateway_list << natgateway.properties.lans.map { |el| { id: el.id, gateway_ips: el.gateway_ips } }
|
45
|
+
natgateway_list << natgateway.entities.rules.items.length
|
46
|
+
end
|
47
|
+
puts ui.list(natgateway_list, :uneven_columns_across, 5)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,105 @@
|
|
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
|
+
|
30
|
+
option :protocol,
|
31
|
+
short: '-p PROTOCOL',
|
32
|
+
long: '--protocol PROTOCOL',
|
33
|
+
description: "Protocol of the NAT gateway rule. Defaults to ALL. If protocol is "\
|
34
|
+
"'ICMP' then target_port_range start and end cannot be set."
|
35
|
+
|
36
|
+
option :source_subnet,
|
37
|
+
long: '--source SOURCE_SUBNET',
|
38
|
+
description: 'Source subnet of the NAT gateway rule. For SNAT rules it specifies '\
|
39
|
+
'which packets this translation rule applies to based on the packets source IP address.'
|
40
|
+
|
41
|
+
option :public_ip,
|
42
|
+
short: '-i PUBLIC_IP',
|
43
|
+
long: '--ip PUBLIC_IP',
|
44
|
+
description: 'Public IP address of the NAT gateway rule. Specifies the address used for masking outgoing '\
|
45
|
+
'packets source address field. Should be one of the customer reserved IP address already configured on the NAT gateway resource'
|
46
|
+
|
47
|
+
option :target_subnet,
|
48
|
+
long: '--target TARGET_SUBNET',
|
49
|
+
description: 'Target or destination subnet of the NAT gateway rule. For SNAT rules it specifies which packets '\
|
50
|
+
'this translation rule applies to based on the packets destination IP address. If none is provided, rule will match any address'
|
51
|
+
|
52
|
+
option :target_port_range_start,
|
53
|
+
long: '--port-start PORT_RANGE_START',
|
54
|
+
description: 'Target port range start associated with the NAT gateway rule'
|
55
|
+
|
56
|
+
option :target_port_range_end,
|
57
|
+
long: '--port-end PORT_RANGE_START',
|
58
|
+
description: 'Target port range end associated with the NAT gateway rule'
|
59
|
+
|
60
|
+
attr_reader :description, :required_options
|
61
|
+
|
62
|
+
def initialize(args = [])
|
63
|
+
super(args)
|
64
|
+
@description =
|
65
|
+
'Adds a Rule to a Nat Gateway under a data center.'
|
66
|
+
@required_options = [:datacenter_id, :natgateway_id, :name, :source_subnet, :public_ip, :ionoscloud_username, :ionoscloud_password]
|
67
|
+
end
|
68
|
+
|
69
|
+
def run
|
70
|
+
$stdout.sync = true
|
71
|
+
handle_extra_config
|
72
|
+
validate_required_params(@required_options, config)
|
73
|
+
|
74
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
75
|
+
|
76
|
+
natgateway_rule = Ionoscloud::NatGatewayRule.new(
|
77
|
+
properties: Ionoscloud::NatGatewayRuleProperties.new(
|
78
|
+
name: config[:name],
|
79
|
+
type: config[:type],
|
80
|
+
protocol: config[:protocol],
|
81
|
+
public_ip: config[:public_ip],
|
82
|
+
source_subnet: config[:source_subnet],
|
83
|
+
target_subnet: config[:target_subnet],
|
84
|
+
target_port_range: Ionoscloud::TargetPortRange.new(
|
85
|
+
start: config[:target_port_range_start],
|
86
|
+
_end: config[:target_port_range_end],
|
87
|
+
),
|
88
|
+
),
|
89
|
+
)
|
90
|
+
|
91
|
+
_, _, headers = natgateways_api.datacenters_natgateways_rules_post_with_http_info(
|
92
|
+
config[:datacenter_id], config[:natgateway_id], natgateway_rule,
|
93
|
+
)
|
94
|
+
|
95
|
+
print "#{ui.color('Adding the rule to the Nat Gateway...', :magenta)}"
|
96
|
+
dot = ui.color('.', :magenta)
|
97
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
98
|
+
|
99
|
+
print_natgateway(
|
100
|
+
natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], config[:natgateway_id], depth: 2),
|
101
|
+
)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,65 @@
|
|
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
|
+
handle_extra_config
|
32
|
+
validate_required_params(@required_options, config)
|
33
|
+
|
34
|
+
$stdout.sync = true
|
35
|
+
handle_extra_config
|
36
|
+
natgateway_rules_list = [
|
37
|
+
ui.color('ID', :bold),
|
38
|
+
ui.color('Name', :bold),
|
39
|
+
ui.color('Type', :bold),
|
40
|
+
ui.color('Protocol', :bold),
|
41
|
+
ui.color('Public IP', :bold),
|
42
|
+
ui.color('Source Subnet', :bold),
|
43
|
+
ui.color('Target Subnet', :bold),
|
44
|
+
ui.color('Target Port Range Start', :bold),
|
45
|
+
ui.color('Target Port Range End', :bold),
|
46
|
+
]
|
47
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
48
|
+
|
49
|
+
natgateways_api.datacenters_natgateways_rules_get(config[:datacenter_id], config[:natgateway_id], { depth: 1 }).items.each do |natgateway_rule|
|
50
|
+
natgateway_rules_list << natgateway_rule.id
|
51
|
+
natgateway_rules_list << natgateway_rule.properties.name
|
52
|
+
natgateway_rules_list << natgateway_rule.properties.type
|
53
|
+
natgateway_rules_list << natgateway_rule.properties.protocol
|
54
|
+
natgateway_rules_list << natgateway_rule.properties.public_ip
|
55
|
+
natgateway_rules_list << natgateway_rule.properties.source_subnet
|
56
|
+
natgateway_rules_list << natgateway_rule.properties.target_subnet
|
57
|
+
natgateway_rules_list << (natgateway_rule.properties.target_port_range ? natgateway_rule.properties.target_port_range.start : '')
|
58
|
+
natgateway_rules_list << (natgateway_rule.properties.target_port_range ? natgateway_rule.properties.target_port_range._end : '')
|
59
|
+
end
|
60
|
+
|
61
|
+
puts ui.list(natgateway_rules_list, :uneven_columns_across, 9)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,55 @@
|
|
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
|
+
handle_extra_config
|
32
|
+
validate_required_params(@required_options, config)
|
33
|
+
|
34
|
+
return unless @name_args.length > 0
|
35
|
+
|
36
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
37
|
+
|
38
|
+
headers_to_wait = []
|
39
|
+
@name_args.each do |rule_id|
|
40
|
+
_, _, headers = natgateways_api.datacenters_natgateways_rules_delete_with_http_info(config[:datacenter_id], config[:natgateway_id], rule_id)
|
41
|
+
headers_to_wait << headers
|
42
|
+
end
|
43
|
+
|
44
|
+
print "#{ui.color("Removing rules #{@name_args} from the NAT Gateway...", :magenta)}"
|
45
|
+
dot = ui.color('.', :magenta)
|
46
|
+
|
47
|
+
headers_to_wait.each { |headers| api_client.wait_for { print dot; is_done? get_request_id headers } }
|
48
|
+
|
49
|
+
print_natgateway(
|
50
|
+
natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], config[:natgateway_id], depth: 2),
|
51
|
+
)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|