knife-ionoscloud 5.1.1 → 6.0.0.beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/docs/README.md +1 -1
- data/docs/subcommands/composite_server_create.md +9 -3
- data/docs/subcommands/cube_server_create.md +91 -0
- data/docs/subcommands/firewall_create.md +5 -2
- data/docs/subcommands/flowlog_create.md +63 -0
- data/docs/subcommands/flowlog_delete.md +51 -0
- data/docs/subcommands/flowlog_list.md +51 -0
- data/docs/subcommands/group_create.md +10 -1
- data/docs/subcommands/natgateway_create.md +41 -0
- data/docs/subcommands/natgateway_delete.md +35 -0
- data/docs/subcommands/natgateway_lan_add.md +46 -0
- data/docs/subcommands/natgateway_lan_remove.md +39 -0
- data/docs/subcommands/natgateway_list.md +35 -0
- data/docs/subcommands/natgateway_rule_add.md +66 -0
- data/docs/subcommands/natgateway_rule_list.md +38 -0
- data/docs/subcommands/natgateway_rule_remove.md +39 -0
- data/docs/subcommands/networkloadbalancer_create.md +54 -0
- data/docs/subcommands/networkloadbalancer_delete.md +35 -0
- data/docs/subcommands/networkloadbalancer_list.md +35 -0
- data/docs/subcommands/networkloadbalancer_rule_add.md +72 -0
- data/docs/subcommands/networkloadbalancer_rule_list.md +39 -0
- data/docs/subcommands/networkloadbalancer_rule_remove.md +39 -0
- data/docs/subcommands/networkloadbalancer_rule_target_add.md +64 -0
- data/docs/subcommands/networkloadbalancer_rule_target_list.md +43 -0
- data/docs/subcommands/networkloadbalancer_rule_target_remove.md +51 -0
- data/docs/subcommands/nic_create.md +3 -3
- data/docs/subcommands/nodepool_lan_add.md +49 -0
- data/docs/subcommands/nodepool_lan_remove.md +39 -0
- data/docs/subcommands/server_console.md +39 -0
- data/docs/subcommands/server_list.md +4 -1
- data/docs/subcommands/server_resume.md +35 -0
- data/docs/subcommands/server_suspend.md +35 -0
- data/docs/subcommands/server_token.md +39 -0
- data/docs/subcommands/server_upgrade.md +39 -0
- data/docs/subcommands/template_list.md +31 -0
- data/docs/subcommands/volume_create.md +2 -5
- data/docs/summary.md +29 -0
- data/knife-ionoscloud.gemspec +1 -1
- data/lib/chef/knife/ionoscloud_backupunit_create.rb +12 -16
- data/lib/chef/knife/ionoscloud_backupunit_delete.rb +2 -5
- data/lib/chef/knife/ionoscloud_backupunit_get.rb +33 -0
- 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 +62 -0
- data/lib/chef/knife/ionoscloud_base.rb +309 -1
- data/lib/chef/knife/ionoscloud_composite_server_create.rb +23 -5
- 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 +11 -14
- data/lib/chef/knife/ionoscloud_datacenter_delete.rb +2 -7
- data/lib/chef/knife/ionoscloud_datacenter_get.rb +33 -0
- data/lib/chef/knife/ionoscloud_datacenter_list.rb +4 -2
- data/lib/chef/knife/ionoscloud_datacenter_update.rb +67 -0
- data/lib/chef/knife/ionoscloud_firewall_create.rb +16 -21
- data/lib/chef/knife/ionoscloud_firewall_delete.rb +5 -13
- data/lib/chef/knife/ionoscloud_firewall_get.rb +52 -0
- data/lib/chef/knife/ionoscloud_firewall_list.rb +5 -3
- data/lib/chef/knife/ionoscloud_firewall_update.rb +133 -0
- data/lib/chef/knife/ionoscloud_flowlog_create.rb +116 -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 +127 -0
- data/lib/chef/knife/ionoscloud_group_create.rb +33 -27
- data/lib/chef/knife/ionoscloud_group_delete.rb +1 -11
- data/lib/chef/knife/ionoscloud_group_get.rb +1 -13
- data/lib/chef/knife/ionoscloud_group_list.rb +19 -7
- data/lib/chef/knife/ionoscloud_group_update.rb +131 -0
- data/lib/chef/knife/ionoscloud_group_user_add.rb +1 -18
- data/lib/chef/knife/ionoscloud_group_user_remove.rb +1 -18
- data/lib/chef/knife/ionoscloud_image_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_ipblock_create.rb +10 -13
- data/lib/chef/knife/ionoscloud_ipblock_delete.rb +1 -4
- data/lib/chef/knife/ionoscloud_ipblock_get.rb +33 -0
- data/lib/chef/knife/ionoscloud_ipblock_update.rb +57 -0
- data/lib/chef/knife/ionoscloud_ipfailover_add.rb +1 -1
- data/lib/chef/knife/ionoscloud_ipfailover_remove.rb +1 -1
- data/lib/chef/knife/ionoscloud_k8s_create.rb +27 -35
- data/lib/chef/knife/ionoscloud_k8s_delete.rb +1 -9
- data/lib/chef/knife/ionoscloud_k8s_get.rb +33 -0
- data/lib/chef/knife/ionoscloud_k8s_update.rb +99 -0
- 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 +6 -14
- data/lib/chef/knife/ionoscloud_lan_delete.rb +3 -4
- data/lib/chef/knife/ionoscloud_lan_get.rb +38 -0
- data/lib/chef/knife/ionoscloud_lan_list.rb +2 -1
- data/lib/chef/knife/ionoscloud_lan_update.rb +76 -0
- data/lib/chef/knife/ionoscloud_loadbalancer_create.rb +4 -14
- data/lib/chef/knife/ionoscloud_loadbalancer_delete.rb +2 -9
- data/lib/chef/knife/ionoscloud_loadbalancer_get.rb +3 -13
- data/lib/chef/knife/ionoscloud_loadbalancer_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_add.rb +3 -15
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_remove.rb +3 -16
- data/lib/chef/knife/ionoscloud_loadbalancer_update.rb +73 -0
- 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 +107 -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 +141 -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 +124 -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 +17 -22
- data/lib/chef/knife/ionoscloud_nic_delete.rb +3 -7
- data/lib/chef/knife/ionoscloud_nic_get.rb +49 -0
- data/lib/chef/knife/ionoscloud_nic_list.rb +9 -5
- data/lib/chef/knife/ionoscloud_nic_update.rb +96 -0
- data/lib/chef/knife/ionoscloud_node_get.rb +49 -0
- data/lib/chef/knife/ionoscloud_node_list.rb +0 -1
- data/lib/chef/knife/ionoscloud_nodepool_create.rb +35 -48
- data/lib/chef/knife/ionoscloud_nodepool_delete.rb +1 -7
- data/lib/chef/knife/ionoscloud_nodepool_get.rb +43 -0
- data/lib/chef/knife/ionoscloud_nodepool_lan_add.rb +104 -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_nodepool_update.rb +124 -0
- data/lib/chef/knife/ionoscloud_pcc_create.rb +12 -18
- data/lib/chef/knife/ionoscloud_pcc_delete.rb +2 -10
- data/lib/chef/knife/ionoscloud_pcc_get.rb +33 -0
- data/lib/chef/knife/ionoscloud_pcc_list.rb +1 -1
- data/lib/chef/knife/ionoscloud_pcc_update.rb +63 -0
- data/lib/chef/knife/ionoscloud_request_get.rb +40 -0
- 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 +3 -7
- data/lib/chef/knife/ionoscloud_s3key_delete.rb +4 -7
- data/lib/chef/knife/ionoscloud_s3key_get.rb +38 -0
- 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 +14 -26
- data/lib/chef/knife/ionoscloud_server_delete.rb +3 -9
- data/lib/chef/knife/ionoscloud_server_get.rb +43 -0
- 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 +97 -0
- data/lib/chef/knife/ionoscloud_server_upgrade.rb +45 -0
- data/lib/chef/knife/ionoscloud_share_create.rb +7 -11
- data/lib/chef/knife/ionoscloud_share_delete.rb +2 -3
- data/lib/chef/knife/ionoscloud_share_get.rb +38 -0
- data/lib/chef/knife/ionoscloud_share_update.rb +70 -0
- data/lib/chef/knife/ionoscloud_snapshot_create.rb +2 -10
- data/lib/chef/knife/ionoscloud_snapshot_delete.rb +2 -7
- data/lib/chef/knife/ionoscloud_snapshot_get.rb +32 -0
- 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 +126 -0
- data/lib/chef/knife/ionoscloud_template_list.rb +47 -0
- data/lib/chef/knife/ionoscloud_user_create.rb +1 -8
- data/lib/chef/knife/ionoscloud_user_delete.rb +1 -6
- data/lib/chef/knife/ionoscloud_user_get.rb +32 -0
- data/lib/chef/knife/ionoscloud_user_ssourl.rb +1 -1
- data/lib/chef/knife/ionoscloud_user_update.rb +92 -0
- data/lib/chef/knife/ionoscloud_volume_attach.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_create.rb +18 -34
- data/lib/chef/knife/ionoscloud_volume_delete.rb +3 -9
- data/lib/chef/knife/ionoscloud_volume_detach.rb +1 -1
- data/lib/chef/knife/ionoscloud_volume_get.rb +36 -0
- data/lib/chef/knife/ionoscloud_volume_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_volume_update.rb +106 -0
- 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 +65 -0
- 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 +78 -0
- 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 +6 -2
- data/spec/chef/knife/ionoscloud_datacenter_delete_spec.rb +8 -5
- data/spec/chef/knife/ionoscloud_datacenter_get_spec.rb +69 -0
- data/spec/chef/knife/ionoscloud_datacenter_list_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_datacenter_update_spec.rb +82 -0
- 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 +77 -0
- data/spec/chef/knife/ionoscloud_firewall_list_spec.rb +5 -3
- data/spec/chef/knife/ionoscloud_firewall_update_spec.rb +117 -0
- 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 -0
- data/spec/chef/knife/ionoscloud_group_delete_spec.rb +6 -0
- data/spec/chef/knife/ionoscloud_group_get_spec.rb +6 -0
- data/spec/chef/knife/ionoscloud_group_list_spec.rb +26 -8
- data/spec/chef/knife/ionoscloud_group_update_spec.rb +121 -0
- data/spec/chef/knife/ionoscloud_group_user_add_spec.rb +6 -0
- data/spec/chef/knife/ionoscloud_group_user_remove_spec.rb +6 -0
- data/spec/chef/knife/ionoscloud_image_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_ipblock_get_spec.rb +66 -0
- data/spec/chef/knife/ionoscloud_ipblock_update_spec.rb +79 -0
- data/spec/chef/knife/ionoscloud_ipfailover_add_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_ipfailover_remove_spec.rb +7 -7
- data/spec/chef/knife/ionoscloud_k8s_create_spec.rb +7 -0
- data/spec/chef/knife/ionoscloud_k8s_delete_spec.rb +16 -11
- data/spec/chef/knife/ionoscloud_k8s_get_spec.rb +72 -0
- data/spec/chef/knife/ionoscloud_k8s_update_spec.rb +114 -0
- data/spec/chef/knife/ionoscloud_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 +4 -3
- data/spec/chef/knife/ionoscloud_lan_delete_spec.rb +7 -5
- data/spec/chef/knife/ionoscloud_lan_get_spec.rb +68 -0
- data/spec/chef/knife/ionoscloud_lan_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_lan_update_spec.rb +87 -0
- data/spec/chef/knife/ionoscloud_loadbalancer_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 +89 -0
- 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 +72 -0
- data/spec/chef/knife/ionoscloud_nic_list_spec.rb +12 -6
- data/spec/chef/knife/ionoscloud_nic_update_spec.rb +97 -0
- data/spec/chef/knife/ionoscloud_node_get_spec.rb +70 -0
- data/spec/chef/knife/ionoscloud_nodepool_create_spec.rb +10 -5
- data/spec/chef/knife/ionoscloud_nodepool_delete_spec.rb +14 -0
- data/spec/chef/knife/ionoscloud_nodepool_get_spec.rb +83 -0
- data/spec/chef/knife/ionoscloud_nodepool_lan_add_spec.rb +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 +134 -0
- data/spec/chef/knife/ionoscloud_pcc_create_spec.rb +11 -8
- data/spec/chef/knife/ionoscloud_pcc_delete_spec.rb +7 -7
- data/spec/chef/knife/ionoscloud_pcc_get_spec.rb +71 -0
- data/spec/chef/knife/ionoscloud_pcc_list_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_pcc_update_spec.rb +83 -0
- data/spec/chef/knife/ionoscloud_request_get_spec.rb +69 -0
- data/spec/chef/knife/ionoscloud_request_list_spec.rb +16 -16
- 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 +66 -0
- 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 +74 -0
- 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 +105 -0
- data/spec/chef/knife/ionoscloud_server_upgrade_spec.rb +96 -0
- data/spec/chef/knife/ionoscloud_share_get_spec.rb +66 -0
- data/spec/chef/knife/ionoscloud_share_update_spec.rb +91 -0
- data/spec/chef/knife/ionoscloud_snapshot_create_spec.rb +15 -3
- data/spec/chef/knife/ionoscloud_snapshot_delete_spec.rb +17 -5
- data/spec/chef/knife/ionoscloud_snapshot_get_spec.rb +79 -0
- 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 +113 -0
- data/spec/chef/knife/ionoscloud_template_list_spec.rb +78 -0
- data/spec/chef/knife/ionoscloud_user_create_spec.rb +3 -1
- data/spec/chef/knife/ionoscloud_user_delete_spec.rb +4 -2
- data/spec/chef/knife/ionoscloud_user_get_spec.rb +70 -0
- data/spec/chef/knife/ionoscloud_user_ssourl_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_user_update_spec.rb +110 -0
- data/spec/chef/knife/ionoscloud_volume_attach_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_volume_create_spec.rb +21 -11
- data/spec/chef/knife/ionoscloud_volume_delete_spec.rb +15 -5
- data/spec/chef/knife/ionoscloud_volume_detach_spec.rb +5 -5
- data/spec/chef/knife/ionoscloud_volume_get_spec.rb +81 -0
- data/spec/chef/knife/ionoscloud_volume_list_spec.rb +4 -4
- data/spec/chef/knife/ionoscloud_volume_update_spec.rb +116 -0
- data/spec/spec_helper.rb +251 -39
- metadata +245 -6
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
require_relative 'ionoscloud_base'
|
|
2
|
+
|
|
3
|
+
class Chef
|
|
4
|
+
class Knife
|
|
5
|
+
class IonoscloudNatgatewayUpdate < Knife
|
|
6
|
+
include Knife::IonoscloudBase
|
|
7
|
+
|
|
8
|
+
banner 'knife ionoscloud natgateway update (options)'
|
|
9
|
+
|
|
10
|
+
option :datacenter_id,
|
|
11
|
+
short: '-D DATACENTER_ID',
|
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
|
13
|
+
description: 'ID of the data center'
|
|
14
|
+
|
|
15
|
+
option :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'
|
|
24
|
+
|
|
25
|
+
option :ips,
|
|
26
|
+
short: '-i IP[,IP,...]',
|
|
27
|
+
long: '--ips IP[,IP,...]',
|
|
28
|
+
description: 'Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location'
|
|
29
|
+
|
|
30
|
+
option :lans,
|
|
31
|
+
long: '--lans LAN[,LAN,...]',
|
|
32
|
+
description: 'Collection of LANs connected to the NAT gateway. IPs must contain valid subnet mask. If user will not provide any IP then system will generate an IP with /24 subnet.'
|
|
33
|
+
|
|
34
|
+
attr_reader :description, :required_options
|
|
35
|
+
|
|
36
|
+
def initialize(args = [])
|
|
37
|
+
super(args)
|
|
38
|
+
@description =
|
|
39
|
+
'Updates information about a Ionoscloud NAT Gateway.'
|
|
40
|
+
@required_options = [:datacenter_id, :natgateway_id, :ionoscloud_username, :ionoscloud_password]
|
|
41
|
+
@updatable_fields = [:name, :ips, :lans]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def run
|
|
45
|
+
$stdout.sync = true
|
|
46
|
+
handle_extra_config
|
|
47
|
+
validate_required_params(@required_options, config)
|
|
48
|
+
|
|
49
|
+
natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)
|
|
50
|
+
|
|
51
|
+
config[:ips] = config[:ips].split(',') if config[:ips] && config[:ips].instance_of?(String)
|
|
52
|
+
config[:lans] = JSON[config[:lans]] if config[:lans] && config[:lans].instance_of?(String)
|
|
53
|
+
config[:lans] = config[:lans].map do
|
|
54
|
+
|lan|
|
|
55
|
+
Ionoscloud::NatGatewayLanProperties.new(
|
|
56
|
+
id: lan['id'],
|
|
57
|
+
gateway_ips: lan['gateway_ips'],
|
|
58
|
+
)
|
|
59
|
+
end if config[:lans]
|
|
60
|
+
|
|
61
|
+
if @updatable_fields.map { |el| config[el] }.any?
|
|
62
|
+
print "#{ui.color('Updating NAT Gateway...', :magenta)}"
|
|
63
|
+
|
|
64
|
+
_, _, headers = natgateways_api.datacenters_natgateways_patch_with_http_info(
|
|
65
|
+
config[:datacenter_id],
|
|
66
|
+
config[:natgateway_id],
|
|
67
|
+
Ionoscloud::NatGatewayProperties.new(
|
|
68
|
+
name: config[:name],
|
|
69
|
+
public_ips: config[:ips],
|
|
70
|
+
lans: config[:lans],
|
|
71
|
+
),
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
dot = ui.color('.', :magenta)
|
|
75
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
|
76
|
+
else
|
|
77
|
+
ui.warn("Nothing to update, please set one of the attributes #{@updatable_fields}.")
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
print_natgateway(natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], config[:natgateway_id], depth: 2))
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
handle_extra_config
|
|
55
|
+
validate_required_params(@required_options, config)
|
|
56
|
+
|
|
57
|
+
print "#{ui.color('Creating Network Load Balancer...', :magenta)}"
|
|
58
|
+
|
|
59
|
+
config[:ips] = config[:ips].split(',') if config[:ips] && config[:ips].instance_of?(String)
|
|
60
|
+
config[:lb_private_ips] = config[:lb_private_ips].split(',') if config[:lb_private_ips] && config[:lb_private_ips].instance_of?(String)
|
|
61
|
+
|
|
62
|
+
network_load_balancers_api = Ionoscloud::NetworkLoadBalancersApi.new(api_client)
|
|
63
|
+
|
|
64
|
+
network_load_balancer, _, headers = network_load_balancers_api.datacenters_networkloadbalancers_post_with_http_info(
|
|
65
|
+
config[:datacenter_id],
|
|
66
|
+
Ionoscloud::NetworkLoadBalancer.new(
|
|
67
|
+
properties: Ionoscloud::NetworkLoadBalancerProperties.new({
|
|
68
|
+
name: config[:name],
|
|
69
|
+
ips: config[:ips],
|
|
70
|
+
listener_lan: config[:listener_lan],
|
|
71
|
+
target_lan: config[:target_lan],
|
|
72
|
+
lb_private_ips: config[:lb_private_ips],
|
|
73
|
+
}.compact),
|
|
74
|
+
),
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
dot = ui.color('.', :magenta)
|
|
79
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
|
80
|
+
|
|
81
|
+
print_network_load_balancer(
|
|
82
|
+
network_load_balancers_api.datacenters_networkloadbalancers_find_by_network_load_balancer_id(
|
|
83
|
+
config[:datacenter_id], network_load_balancer.id, depth: 2,
|
|
84
|
+
),
|
|
85
|
+
)
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
require_relative 'ionoscloud_base'
|
|
2
|
+
|
|
3
|
+
class Chef
|
|
4
|
+
class Knife
|
|
5
|
+
class IonoscloudNetworkloadbalancerDelete < Knife
|
|
6
|
+
include Knife::IonoscloudBase
|
|
7
|
+
|
|
8
|
+
banner 'knife ionoscloud networkloadbalancer delete LOAD_BALANCER_ID [LOAD_BALANCER_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
|
+
'Removes the specified Network Load Balancer.'
|
|
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
|
+
network_load_balancers_api = Ionoscloud::NetworkLoadBalancersApi.new(api_client)
|
|
30
|
+
|
|
31
|
+
@name_args.each do |network_load_balancer_id|
|
|
32
|
+
begin
|
|
33
|
+
network_load_balancer = network_load_balancers_api.datacenters_networkloadbalancers_find_by_network_load_balancer_id(
|
|
34
|
+
config[:datacenter_id],
|
|
35
|
+
network_load_balancer_id,
|
|
36
|
+
depth: 2,
|
|
37
|
+
)
|
|
38
|
+
rescue Ionoscloud::ApiError => err
|
|
39
|
+
raise err unless err.code == 404
|
|
40
|
+
ui.error("Network Load balancer ID #{network_load_balancer_id} not found. Skipping.")
|
|
41
|
+
next
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
print_network_load_balancer(network_load_balancer)
|
|
45
|
+
puts "\n"
|
|
46
|
+
|
|
47
|
+
begin
|
|
48
|
+
confirm('Do you really want to delete this Network Load balancer')
|
|
49
|
+
rescue SystemExit => exc
|
|
50
|
+
next
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
_, _, headers = network_load_balancers_api.datacenters_networkloadbalancers_delete_with_http_info(
|
|
54
|
+
config[:datacenter_id],
|
|
55
|
+
network_load_balancer_id,
|
|
56
|
+
)
|
|
57
|
+
ui.warn("Deleted Network Load balancer #{network_load_balancer.id}. Request ID: #{get_request_id headers}")
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
require_relative 'ionoscloud_base'
|
|
2
|
+
|
|
3
|
+
class Chef
|
|
4
|
+
class Knife
|
|
5
|
+
class IonoscloudNetworkloadbalancerGet < Knife
|
|
6
|
+
include Knife::IonoscloudBase
|
|
7
|
+
|
|
8
|
+
banner 'knife ionoscloud networkloadbalancer get (options)'
|
|
9
|
+
|
|
10
|
+
option :datacenter_id,
|
|
11
|
+
short: '-D DATACENTER_ID',
|
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
|
13
|
+
description: 'ID of the data center'
|
|
14
|
+
|
|
15
|
+
option :network_loadbalancer_id,
|
|
16
|
+
short: '-L NETWORK_LOADBALANCER_ID',
|
|
17
|
+
long: '--network-loadbalancer NETWORK_LOADBALANCER_ID',
|
|
18
|
+
description: 'ID of the Network Loadbalancer'
|
|
19
|
+
|
|
20
|
+
attr_reader :description, :required_options
|
|
21
|
+
|
|
22
|
+
def initialize(args = [])
|
|
23
|
+
super(args)
|
|
24
|
+
@description =
|
|
25
|
+
'Retrieves the attributes of a given Network Load Balancer.'
|
|
26
|
+
@required_options = [:datacenter_id, :network_loadbalancer_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
|
+
print_network_load_balancer(
|
|
35
|
+
Ionoscloud::NetworkLoadBalancersApi.new(api_client).datacenters_networkloadbalancers_find_by_network_load_balancer_id(
|
|
36
|
+
config[:datacenter_id], config[:network_loadbalancer_id], depth: 2,
|
|
37
|
+
),
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
require_relative 'ionoscloud_base'
|
|
2
|
+
|
|
3
|
+
class Chef
|
|
4
|
+
class Knife
|
|
5
|
+
class IonoscloudNetworkloadbalancerList < Knife
|
|
6
|
+
include Knife::IonoscloudBase
|
|
7
|
+
|
|
8
|
+
banner 'knife ionoscloud networkloadbalancer list (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
|
+
'Retrieve a list of Network Load Balancers within the datacenter.'
|
|
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
|
+
network_load_balancers_list = [
|
|
30
|
+
ui.color('ID', :bold),
|
|
31
|
+
ui.color('Name', :bold),
|
|
32
|
+
ui.color('Listener LAN', :bold),
|
|
33
|
+
ui.color('Target LAN', :bold),
|
|
34
|
+
ui.color('Rules', :bold),
|
|
35
|
+
ui.color('Flowlogs', :bold),
|
|
36
|
+
ui.color('IPS', :bold),
|
|
37
|
+
ui.color('Private IPS', :bold),
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
network_load_balancers_api = Ionoscloud::NetworkLoadBalancersApi.new(api_client)
|
|
41
|
+
|
|
42
|
+
network_load_balancers_api.datacenters_networkloadbalancers_get(config[:datacenter_id], { depth: 2 }).items.each do |network_load_balancer|
|
|
43
|
+
network_load_balancers_list << network_load_balancer.id
|
|
44
|
+
network_load_balancers_list << network_load_balancer.properties.name
|
|
45
|
+
network_load_balancers_list << network_load_balancer.properties.listener_lan
|
|
46
|
+
network_load_balancers_list << network_load_balancer.properties.target_lan
|
|
47
|
+
network_load_balancers_list << network_load_balancer.entities.forwardingrules.items.length
|
|
48
|
+
network_load_balancers_list << network_load_balancer.entities.flowlogs.items.length
|
|
49
|
+
network_load_balancers_list << network_load_balancer.properties.ips
|
|
50
|
+
network_load_balancers_list << network_load_balancer.properties.lb_private_ips
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
puts ui.list(network_load_balancers_list, :uneven_columns_across, 8)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
require_relative 'ionoscloud_base'
|
|
2
|
+
|
|
3
|
+
class Chef
|
|
4
|
+
class Knife
|
|
5
|
+
class IonoscloudNetworkloadbalancerRuleAdd < Knife
|
|
6
|
+
include Knife::IonoscloudBase
|
|
7
|
+
|
|
8
|
+
banner 'knife ionoscloud networkloadbalancer 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 :network_loadbalancer_id,
|
|
16
|
+
short: '-L NETWORK_LOADBALANCER_ID',
|
|
17
|
+
long: '--network-loadbalancer NETWORK_LOADBALANCER_ID',
|
|
18
|
+
description: 'ID of the Network Loadbalancer'
|
|
19
|
+
|
|
20
|
+
option :name,
|
|
21
|
+
short: '-n NAME',
|
|
22
|
+
long: '--name NAME',
|
|
23
|
+
description: 'A name of that Network Load Balancer forwarding rule'
|
|
24
|
+
|
|
25
|
+
option :algorithm,
|
|
26
|
+
short: '-a ALGORITHM',
|
|
27
|
+
long: '--algorithm ALGORITHM',
|
|
28
|
+
description: 'Algorithm for the balancing',
|
|
29
|
+
default: 'ROUND_ROBIN'
|
|
30
|
+
|
|
31
|
+
option :protocol,
|
|
32
|
+
long: '--protocol PROTOCOL',
|
|
33
|
+
description: 'Protocol of the balancing',
|
|
34
|
+
default: 'TCP'
|
|
35
|
+
|
|
36
|
+
option :listener_ip,
|
|
37
|
+
short: '-i LISTENER_IP',
|
|
38
|
+
long: '--ip LISTENER_IP',
|
|
39
|
+
description: 'Listening IP. (inbound)'
|
|
40
|
+
|
|
41
|
+
option :listener_port,
|
|
42
|
+
short: '-p LISTENER_PORT',
|
|
43
|
+
long: '--port LISTENER_PORT',
|
|
44
|
+
description: 'Listening port number. (inbound) (range: 1 to 65535)'
|
|
45
|
+
|
|
46
|
+
option :client_timeout,
|
|
47
|
+
long: '--client-timeout CLIENT_TIMEOUT',
|
|
48
|
+
description: 'ClientTimeout is expressed in milliseconds. This inactivity timeout applies when '\
|
|
49
|
+
'the client is expected to acknowledge or send data. If unset the default of 50 seconds will be used.',
|
|
50
|
+
default: 50
|
|
51
|
+
|
|
52
|
+
option :connect_timeout,
|
|
53
|
+
long: '--connect-timeout CONNECT_TIMEOUT',
|
|
54
|
+
description: 'It specifies the maximum time (in milliseconds) to wait for a connection attempt to a '\
|
|
55
|
+
'target VM to succeed. If unset, the default of 5 seconds will be used.',
|
|
56
|
+
default: 5000
|
|
57
|
+
|
|
58
|
+
option :target_timeout,
|
|
59
|
+
long: '--terget-timeout TARGET_TIMEOUT',
|
|
60
|
+
description: 'TargetTimeout specifies the maximum inactivity time (in milliseconds) on the target VM side. '\
|
|
61
|
+
'If unset, the default of 50 seconds will be used.',
|
|
62
|
+
default: 50000
|
|
63
|
+
|
|
64
|
+
option :retries,
|
|
65
|
+
short: '-r RETRIES',
|
|
66
|
+
long: '--retries RETRIES',
|
|
67
|
+
description: 'Retries specifies the number of retries to perform on a target VM after a connection failure. '\
|
|
68
|
+
'If unset, the default value of 3 will be used. (valid range: [0, 65535])',
|
|
69
|
+
default: 3
|
|
70
|
+
|
|
71
|
+
option :targets,
|
|
72
|
+
long: '--targets TARGETS',
|
|
73
|
+
description: 'Array of targets'
|
|
74
|
+
|
|
75
|
+
attr_reader :description, :required_options
|
|
76
|
+
|
|
77
|
+
def initialize(args = [])
|
|
78
|
+
super(args)
|
|
79
|
+
@description =
|
|
80
|
+
'Adds a Forwarding Rule to a Network Load Balancer under a data center.'
|
|
81
|
+
@required_options = [:datacenter_id, :network_loadbalancer_id, :name, :listener_ip, :listener_port, :ionoscloud_username, :ionoscloud_password]
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def run
|
|
85
|
+
$stdout.sync = true
|
|
86
|
+
handle_extra_config
|
|
87
|
+
validate_required_params(@required_options, config)
|
|
88
|
+
|
|
89
|
+
network_loadbalancers_api = Ionoscloud::NetworkLoadBalancersApi.new(api_client)
|
|
90
|
+
|
|
91
|
+
config[:gateway_ips] = config[:gateway_ips].split(',') if config[:gateway_ips] && config[:gateway_ips].instance_of?(String)
|
|
92
|
+
config[:targets] = JSON[config[:targets]] if config[:targets] && config[:targets].instance_of?(String)
|
|
93
|
+
|
|
94
|
+
config[:targets] = config[:targets].map do
|
|
95
|
+
|condition|
|
|
96
|
+
Ionoscloud::NetworkLoadBalancerForwardingRuleTarget.new(
|
|
97
|
+
ip: condition['ip'],
|
|
98
|
+
port: condition['port'],
|
|
99
|
+
weight: condition['weight'],
|
|
100
|
+
health_check: Ionoscloud::NetworkLoadBalancerForwardingRuleTargetHealthCheck.new(
|
|
101
|
+
check: condition['check'],
|
|
102
|
+
check_interval: condition['check_interval'],
|
|
103
|
+
maintenance: condition['maintenance'],
|
|
104
|
+
),
|
|
105
|
+
)
|
|
106
|
+
end if config[:targets]
|
|
107
|
+
|
|
108
|
+
network_loadbalancer_forwarding_rule = Ionoscloud::NetworkLoadBalancerForwardingRule.new(
|
|
109
|
+
properties: Ionoscloud::NetworkLoadBalancerForwardingRuleProperties.new(
|
|
110
|
+
name: config[:name],
|
|
111
|
+
algorithm: config[:algorithm],
|
|
112
|
+
protocol: config[:protocol],
|
|
113
|
+
listener_ip: config[:listener_ip],
|
|
114
|
+
listener_port: config[:listener_port],
|
|
115
|
+
targets: config[:targets],
|
|
116
|
+
health_check: Ionoscloud::NetworkLoadBalancerForwardingRuleHealthCheck.new(
|
|
117
|
+
client_timeout: config[:client_timeout],
|
|
118
|
+
connect_timeout: config[:connect_timeout],
|
|
119
|
+
target_timeout: config[:target_timeout],
|
|
120
|
+
retries: config[:retries],
|
|
121
|
+
),
|
|
122
|
+
),
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
_, _, headers = network_loadbalancers_api.datacenters_networkloadbalancers_forwardingrules_post_with_http_info(
|
|
126
|
+
config[:datacenter_id], config[:network_loadbalancer_id], network_loadbalancer_forwarding_rule,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
print "#{ui.color('Adding the rule to the Network Loadbalancer...', :magenta)}"
|
|
130
|
+
dot = ui.color('.', :magenta)
|
|
131
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
|
132
|
+
|
|
133
|
+
print_network_load_balancer(
|
|
134
|
+
network_loadbalancers_api.datacenters_networkloadbalancers_find_by_network_load_balancer_id(
|
|
135
|
+
config[:datacenter_id], config[:network_loadbalancer_id], depth: 2,
|
|
136
|
+
),
|
|
137
|
+
)
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
require_relative 'ionoscloud_base'
|
|
2
|
+
|
|
3
|
+
class Chef
|
|
4
|
+
class Knife
|
|
5
|
+
class IonoscloudNetworkloadbalancerRuleList < Knife
|
|
6
|
+
include Knife::IonoscloudBase
|
|
7
|
+
|
|
8
|
+
banner 'knife ionoscloud networkloadbalancer 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 :network_loadbalancer_id,
|
|
16
|
+
short: '-L NETWORK_LOADBALANCER_ID',
|
|
17
|
+
long: '--network-loadbalancer NETWORK_LOADBALANCER_ID',
|
|
18
|
+
description: 'ID of the Network Loadbalancer'
|
|
19
|
+
|
|
20
|
+
attr_reader :description, :required_options
|
|
21
|
+
|
|
22
|
+
def initialize(args = [])
|
|
23
|
+
super(args)
|
|
24
|
+
@description =
|
|
25
|
+
'Lists all available rules in a Network Loadbalancer under a data center.'
|
|
26
|
+
@required_options = [:datacenter_id, :network_loadbalancer_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
|
+
network_loadbalancer_rule_list = [
|
|
37
|
+
ui.color('ID', :bold),
|
|
38
|
+
ui.color('Name', :bold),
|
|
39
|
+
ui.color('Algorithm', :bold),
|
|
40
|
+
ui.color('Protocol', :bold),
|
|
41
|
+
ui.color('Listener IP', :bold),
|
|
42
|
+
ui.color('Listener Port', :bold),
|
|
43
|
+
ui.color('Targets', :bold),
|
|
44
|
+
ui.color('Health Check', :bold),
|
|
45
|
+
]
|
|
46
|
+
network_loadbalancers_api = Ionoscloud::NetworkLoadBalancersApi.new(api_client)
|
|
47
|
+
|
|
48
|
+
network_loadbalancers_api.datacenters_networkloadbalancers_forwardingrules_get(
|
|
49
|
+
config[:datacenter_id], config[:network_loadbalancer_id], depth: 1,
|
|
50
|
+
).items.each do |network_loadbalancer_rule|
|
|
51
|
+
network_loadbalancer_rule_list << network_loadbalancer_rule.id
|
|
52
|
+
network_loadbalancer_rule_list << network_loadbalancer_rule.properties.name
|
|
53
|
+
network_loadbalancer_rule_list << network_loadbalancer_rule.properties.algorithm
|
|
54
|
+
network_loadbalancer_rule_list << network_loadbalancer_rule.properties.protocol
|
|
55
|
+
network_loadbalancer_rule_list << network_loadbalancer_rule.properties.listener_ip
|
|
56
|
+
network_loadbalancer_rule_list << network_loadbalancer_rule.properties.listener_port
|
|
57
|
+
network_loadbalancer_rule_list << network_loadbalancer_rule.properties.targets.length
|
|
58
|
+
network_loadbalancer_rule_list << network_loadbalancer_rule.properties.health_check
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
puts ui.list(network_loadbalancer_rule_list, :uneven_columns_across, 8)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
require_relative 'ionoscloud_base'
|
|
2
|
+
|
|
3
|
+
class Chef
|
|
4
|
+
class Knife
|
|
5
|
+
class IonoscloudNetworkloadbalancerRuleRemove < Knife
|
|
6
|
+
include Knife::IonoscloudBase
|
|
7
|
+
|
|
8
|
+
banner 'knife ionoscloud networkloadbalancer 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: 'The ID of the data center'
|
|
14
|
+
|
|
15
|
+
option :network_loadbalancer_id,
|
|
16
|
+
short: '-L NETWORK_LOADBALANCER_ID',
|
|
17
|
+
long: '--network-loadbalancer NETWORK_LOADBALANCER_ID',
|
|
18
|
+
description: 'ID of the Network Loadbalancer'
|
|
19
|
+
|
|
20
|
+
attr_reader :description, :required_options
|
|
21
|
+
|
|
22
|
+
def initialize(args = [])
|
|
23
|
+
super(args)
|
|
24
|
+
@description =
|
|
25
|
+
'Removes the specified rules from a Network Loadbalancer under a data center.'
|
|
26
|
+
@required_options = [:datacenter_id, :network_loadbalancer_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
|
+
network_loadbalancers_api = Ionoscloud::NetworkLoadBalancersApi.new(api_client)
|
|
37
|
+
|
|
38
|
+
headers_to_wait = []
|
|
39
|
+
@name_args.each do |rule_id|
|
|
40
|
+
begin
|
|
41
|
+
_, _, headers = network_loadbalancers_api.datacenters_networkloadbalancers_forwardingrules_delete_with_http_info(
|
|
42
|
+
config[:datacenter_id], config[:network_loadbalancer_id], rule_id,
|
|
43
|
+
)
|
|
44
|
+
headers_to_wait << headers
|
|
45
|
+
|
|
46
|
+
ui.warn(
|
|
47
|
+
"Removed Forwarding Rule #{rule_id} from the Network Load balancer "\
|
|
48
|
+
"#{config[:network_loadbalancer_id]}. Request ID: #{get_request_id headers}.",
|
|
49
|
+
)
|
|
50
|
+
rescue Ionoscloud::ApiError => err
|
|
51
|
+
raise err unless err.code == 404
|
|
52
|
+
ui.error("Forwarding rule ID #{rule_id} not found. Skipping.")
|
|
53
|
+
next
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
dot = ui.color('.', :magenta)
|
|
58
|
+
headers_to_wait.each { |headers| api_client.wait_for { print dot; is_done? get_request_id headers } }
|
|
59
|
+
|
|
60
|
+
print_network_load_balancer(
|
|
61
|
+
network_loadbalancers_api.datacenters_networkloadbalancers_find_by_network_load_balancer_id(
|
|
62
|
+
config[:datacenter_id], config[:network_loadbalancer_id], depth: 2,
|
|
63
|
+
),
|
|
64
|
+
)
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|