knife-ionoscloud 5.1.1 → 6.0.0.beta.2
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 +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,124 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNetworkloadbalancerRuleTargetAdd < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud networkloadbalancer rule target 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 :forwarding_rule_id,
|
21
|
+
short: '-R FORWARDING_RULE_ID',
|
22
|
+
long: '--forwarding-rule FORWARDING_RULE_ID',
|
23
|
+
description: 'ID of the Network Loadbalancer Forwarding Rule'
|
24
|
+
|
25
|
+
option :ip,
|
26
|
+
short: '-i IP',
|
27
|
+
long: '--ip IP',
|
28
|
+
description: 'IP of a balanced target VM'
|
29
|
+
|
30
|
+
option :port,
|
31
|
+
short: '-p PORT',
|
32
|
+
long: '--port PORT',
|
33
|
+
description: 'Port of the balanced target service. (range: 1 to 65535)'
|
34
|
+
|
35
|
+
option :weight,
|
36
|
+
short: '-w WEIGTH',
|
37
|
+
long: '--weight WEIGTH',
|
38
|
+
description: 'Weight parameter is used to adjust the target VM\'s weight relative to other target VMs. '\
|
39
|
+
'All target VMs will receive a load proportional to their weight relative to the sum of all weights, so '\
|
40
|
+
'the higher the weight, the higher the load. The default weight is 1, and the maximal value is 256. A '\
|
41
|
+
'value of 0 means the target VM will not participate in load-balancing but will still accept persistent '\
|
42
|
+
'connections. If this parameter is used to distribute the load according to target VM\'s capacity, it is '\
|
43
|
+
'recommended to start with values which can both grow and shrink, for instance between 10 and 100 to leave '\
|
44
|
+
'enough room above and below for later adjustments.'
|
45
|
+
|
46
|
+
option :check,
|
47
|
+
short: '-c',
|
48
|
+
long: '--check',
|
49
|
+
description: 'Check specifies whether the target VM\'s health is checked. If turned off, a target VM is '\
|
50
|
+
'always considered available. If turned on, the target VM is available when accepting periodic TCP connections, '\
|
51
|
+
'to ensure that it is really able to serve requests. The address and port to send the tests to are those of the '\
|
52
|
+
'target VM. The health check only consists of a connection attempt.',
|
53
|
+
boolean: true
|
54
|
+
|
55
|
+
option :check_interval,
|
56
|
+
long: '--check-interval CHECK_INTERVAL',
|
57
|
+
description: 'CheckInterval determines the duration (in milliseconds) between consecutive health checks. '\
|
58
|
+
'If unspecified a default of 2000 ms is used.',
|
59
|
+
default: 2000
|
60
|
+
|
61
|
+
option :maintenance,
|
62
|
+
short: '-m',
|
63
|
+
long: '--maintenance MAINTENANCE',
|
64
|
+
description: 'Maintenance specifies if a target VM should be marked as down, even if it is not.',
|
65
|
+
boolean: true
|
66
|
+
|
67
|
+
attr_reader :description, :required_options
|
68
|
+
|
69
|
+
def initialize(args = [])
|
70
|
+
super(args)
|
71
|
+
@description =
|
72
|
+
'Adds a target to a Network Load Balancer Forwarding Rule under a data center.'
|
73
|
+
@required_options = [
|
74
|
+
:datacenter_id, :network_loadbalancer_id, :forwarding_rule_id, :ip, :port, :weight, :ionoscloud_username, :ionoscloud_password,
|
75
|
+
]
|
76
|
+
end
|
77
|
+
|
78
|
+
def run
|
79
|
+
$stdout.sync = true
|
80
|
+
handle_extra_config
|
81
|
+
validate_required_params(@required_options, config)
|
82
|
+
|
83
|
+
network_loadbalancers_api = Ionoscloud::NetworkLoadBalancersApi.new(api_client)
|
84
|
+
|
85
|
+
|
86
|
+
network_load_balancer_rule = network_loadbalancers_api.datacenters_networkloadbalancers_forwardingrules_find_by_forwarding_rule_id(
|
87
|
+
config[:datacenter_id], config[:network_loadbalancer_id], config[:forwarding_rule_id],
|
88
|
+
)
|
89
|
+
|
90
|
+
network_loadbalancer_forwarding_rule_target = Ionoscloud::NetworkLoadBalancerForwardingRuleTarget.new(
|
91
|
+
ip: config[:ip],
|
92
|
+
port: config[:port],
|
93
|
+
weight: config[:weight],
|
94
|
+
health_check: Ionoscloud::NetworkLoadBalancerForwardingRuleTargetHealthCheck.new(
|
95
|
+
check: config[:check],
|
96
|
+
check_interval: config[:check_interval],
|
97
|
+
maintenance: config[:maintenance],
|
98
|
+
),
|
99
|
+
)
|
100
|
+
|
101
|
+
network_load_balancer_rule.properties.targets << network_loadbalancer_forwarding_rule_target
|
102
|
+
|
103
|
+
_, _, headers = network_loadbalancers_api.datacenters_networkloadbalancers_forwardingrules_patch_with_http_info(
|
104
|
+
config[:datacenter_id],
|
105
|
+
config[:network_loadbalancer_id],
|
106
|
+
config[:forwarding_rule_id],
|
107
|
+
Ionoscloud::NetworkLoadBalancerForwardingRuleProperties.new({
|
108
|
+
targets: network_load_balancer_rule.properties.targets,
|
109
|
+
}),
|
110
|
+
)
|
111
|
+
|
112
|
+
print "#{ui.color('Adding the target to the Network Loadbalancer Forwarding Rule...', :magenta)}"
|
113
|
+
dot = ui.color('.', :magenta)
|
114
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
115
|
+
|
116
|
+
print_network_load_balancer(
|
117
|
+
network_loadbalancers_api.datacenters_networkloadbalancers_find_by_network_load_balancer_id(
|
118
|
+
config[:datacenter_id], config[:network_loadbalancer_id], depth: 2,
|
119
|
+
),
|
120
|
+
)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNetworkloadbalancerRuleTargetList < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud networkloadbalancer rule target 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
|
+
option :forwarding_rule_id,
|
21
|
+
short: '-R FORWARDING_RULE_ID',
|
22
|
+
long: '--forwarding-rule FORWARDING_RULE_ID',
|
23
|
+
description: 'ID of the Network Loadbalancer Forwarding Rule'
|
24
|
+
|
25
|
+
attr_reader :description, :required_options
|
26
|
+
|
27
|
+
def initialize(args = [])
|
28
|
+
super(args)
|
29
|
+
@description =
|
30
|
+
'Lists all targets of a Network Loadbalancer Forwarding Rule under a data center.'
|
31
|
+
@required_options = [
|
32
|
+
:datacenter_id, :network_loadbalancer_id, :forwarding_rule_id, :ionoscloud_username, :ionoscloud_password,
|
33
|
+
]
|
34
|
+
end
|
35
|
+
|
36
|
+
def run
|
37
|
+
$stdout.sync = true
|
38
|
+
handle_extra_config
|
39
|
+
validate_required_params(@required_options, config)
|
40
|
+
|
41
|
+
$stdout.sync = true
|
42
|
+
handle_extra_config
|
43
|
+
target_list = [
|
44
|
+
ui.color('IP', :bold),
|
45
|
+
ui.color('Port', :bold),
|
46
|
+
ui.color('Weight', :bold),
|
47
|
+
ui.color('Check', :bold),
|
48
|
+
ui.color('Check interval', :bold),
|
49
|
+
ui.color('Maintenance', :bold),
|
50
|
+
]
|
51
|
+
network_loadbalancers_api = Ionoscloud::NetworkLoadBalancersApi.new(api_client)
|
52
|
+
|
53
|
+
network_load_balancer_rule = network_loadbalancers_api.datacenters_networkloadbalancers_forwardingrules_find_by_forwarding_rule_id(
|
54
|
+
config[:datacenter_id], config[:network_loadbalancer_id], config[:forwarding_rule_id],
|
55
|
+
)
|
56
|
+
|
57
|
+
network_load_balancer_rule.properties.targets.each do |target|
|
58
|
+
target_list << target.ip
|
59
|
+
target_list << target.port
|
60
|
+
target_list << target.weight
|
61
|
+
target_list << target.health_check.check
|
62
|
+
target_list << target.health_check.check_interval
|
63
|
+
target_list << target.health_check.maintenance
|
64
|
+
end
|
65
|
+
|
66
|
+
puts ui.list(target_list, :uneven_columns_across, 6)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNetworkloadbalancerRuleTargetRemove < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud networkloadbalancer rule target remove (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 :forwarding_rule_id,
|
21
|
+
short: '-R FORWARDING_RULE_ID',
|
22
|
+
long: '--forwarding-rule FORWARDING_RULE_ID',
|
23
|
+
description: 'ID of the Network Loadbalancer Forwarding Rule'
|
24
|
+
|
25
|
+
option :ip,
|
26
|
+
short: '-i IP',
|
27
|
+
long: '--ip IP',
|
28
|
+
description: 'IP of a balanced target VM'
|
29
|
+
|
30
|
+
option :port,
|
31
|
+
short: '-p PORT',
|
32
|
+
long: '--port PORT',
|
33
|
+
description: 'Port of the balanced target service. (range: 1 to 65535)'
|
34
|
+
|
35
|
+
attr_reader :description, :required_options
|
36
|
+
|
37
|
+
def initialize(args = [])
|
38
|
+
super(args)
|
39
|
+
@description =
|
40
|
+
'Adds a target to a Network Load Balancer Forwarding Rule under a data center.'
|
41
|
+
@required_options = [
|
42
|
+
:datacenter_id, :network_loadbalancer_id, :forwarding_rule_id, :ip, :port, :ionoscloud_username, :ionoscloud_password,
|
43
|
+
]
|
44
|
+
end
|
45
|
+
|
46
|
+
def run
|
47
|
+
$stdout.sync = true
|
48
|
+
handle_extra_config
|
49
|
+
validate_required_params(@required_options, config)
|
50
|
+
|
51
|
+
network_loadbalancers_api = Ionoscloud::NetworkLoadBalancersApi.new(api_client)
|
52
|
+
|
53
|
+
|
54
|
+
network_load_balancer_rule = network_loadbalancers_api.datacenters_networkloadbalancers_forwardingrules_find_by_forwarding_rule_id(
|
55
|
+
config[:datacenter_id], config[:network_loadbalancer_id], config[:forwarding_rule_id],
|
56
|
+
)
|
57
|
+
|
58
|
+
initial_length = network_load_balancer_rule.properties.targets.length
|
59
|
+
|
60
|
+
network_load_balancer_rule.properties.targets = network_load_balancer_rule.properties.targets.reject do
|
61
|
+
|target|
|
62
|
+
target.ip == config[:ip] && target.port == Integer(config[:port])
|
63
|
+
end
|
64
|
+
|
65
|
+
if initial_length > network_load_balancer_rule.properties.targets.length
|
66
|
+
_, _, headers = network_loadbalancers_api.datacenters_networkloadbalancers_forwardingrules_patch_with_http_info(
|
67
|
+
config[:datacenter_id],
|
68
|
+
config[:network_loadbalancer_id],
|
69
|
+
config[:forwarding_rule_id],
|
70
|
+
Ionoscloud::NetworkLoadBalancerForwardingRuleProperties.new({
|
71
|
+
targets: network_load_balancer_rule.properties.targets,
|
72
|
+
}),
|
73
|
+
)
|
74
|
+
|
75
|
+
print "#{ui.color('Removing the target from the Network Loadbalancer Forwarding Rule...', :magenta)}"
|
76
|
+
dot = ui.color('.', :magenta)
|
77
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
78
|
+
end
|
79
|
+
|
80
|
+
print_network_load_balancer(
|
81
|
+
network_loadbalancers_api.datacenters_networkloadbalancers_find_by_network_load_balancer_id(
|
82
|
+
config[:datacenter_id], config[:network_loadbalancer_id], depth: 2,
|
83
|
+
),
|
84
|
+
)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,148 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNetworkloadbalancerRuleUpdate < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud networkloadbalancer rule 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 :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 :forwarding_rule_id,
|
21
|
+
short: '-R FORWARDING_RULE_ID',
|
22
|
+
long: '--forwarding-rule FORWARDING_RULE_ID',
|
23
|
+
description: 'ID of the Network Loadbalancer Forwarding Rule'
|
24
|
+
|
25
|
+
option :name,
|
26
|
+
short: '-n NAME',
|
27
|
+
long: '--name NAME',
|
28
|
+
description: 'A name of that Network Load Balancer forwarding rule'
|
29
|
+
|
30
|
+
option :algorithm,
|
31
|
+
short: '-a ALGORITHM',
|
32
|
+
long: '--algorithm ALGORITHM',
|
33
|
+
description: 'Algorithm for the balancing'
|
34
|
+
|
35
|
+
option :protocol,
|
36
|
+
long: '--protocol PROTOCOL',
|
37
|
+
description: 'Protocol of the balancing'
|
38
|
+
|
39
|
+
option :listener_ip,
|
40
|
+
short: '-i LISTENER_IP',
|
41
|
+
long: '--ip LISTENER_IP',
|
42
|
+
description: 'Listening IP. (inbound)'
|
43
|
+
|
44
|
+
option :listener_port,
|
45
|
+
short: '-p LISTENER_PORT',
|
46
|
+
long: '--port LISTENER_PORT',
|
47
|
+
description: 'Listening port number. (inbound) (range: 1 to 65535)'
|
48
|
+
|
49
|
+
option :client_timeout,
|
50
|
+
long: '--client-timeout CLIENT_TIMEOUT',
|
51
|
+
description: 'ClientTimeout is expressed in milliseconds. This inactivity timeout applies when '\
|
52
|
+
'the client is expected to acknowledge or send data. If unset the default of 50 seconds will be used.'
|
53
|
+
|
54
|
+
option :connect_timeout,
|
55
|
+
long: '--connect-timeout CONNECT_TIMEOUT',
|
56
|
+
description: 'It specifies the maximum time (in milliseconds) to wait for a connection attempt to a '\
|
57
|
+
'target VM to succeed. If unset, the default of 5 seconds will be used.'
|
58
|
+
|
59
|
+
option :target_timeout,
|
60
|
+
long: '--terget-timeout TARGET_TIMEOUT',
|
61
|
+
description: 'TargetTimeout specifies the maximum inactivity time (in milliseconds) on the target VM side. '\
|
62
|
+
'If unset, the default of 50 seconds will be used.'
|
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
|
+
|
70
|
+
option :targets,
|
71
|
+
long: '--targets TARGETS',
|
72
|
+
description: 'Array of targets'
|
73
|
+
|
74
|
+
attr_reader :description, :required_options
|
75
|
+
|
76
|
+
def initialize(args = [])
|
77
|
+
super(args)
|
78
|
+
@description =
|
79
|
+
'Updates information about a Ionoscloud Network Load Balancer.'
|
80
|
+
@required_options = [:datacenter_id, :network_loadbalancer_id, :ionoscloud_username, :ionoscloud_password]
|
81
|
+
@updatable_fields = [
|
82
|
+
:name, :algorithm, :protocol, :listener_ip, :listener_port, :targets,
|
83
|
+
:client_timeout, :connect_timeout, :target_timeout, :retries,
|
84
|
+
]
|
85
|
+
end
|
86
|
+
|
87
|
+
def run
|
88
|
+
$stdout.sync = true
|
89
|
+
handle_extra_config
|
90
|
+
validate_required_params(@required_options, config)
|
91
|
+
|
92
|
+
network_load_balancer_api = Ionoscloud::NetworkLoadBalancersApi.new(api_client)
|
93
|
+
|
94
|
+
config[:gateway_ips] = config[:gateway_ips].split(',') if config[:gateway_ips] && config[:gateway_ips].instance_of?(String)
|
95
|
+
config[:targets] = JSON[config[:targets]] if config[:targets] && config[:targets].instance_of?(String)
|
96
|
+
|
97
|
+
config[:targets] = config[:targets].map do
|
98
|
+
|target|
|
99
|
+
Ionoscloud::NetworkLoadBalancerForwardingRuleTarget.new(
|
100
|
+
ip: target['ip'],
|
101
|
+
port: target['port'],
|
102
|
+
weight: target['weight'],
|
103
|
+
health_check: Ionoscloud::NetworkLoadBalancerForwardingRuleTargetHealthCheck.new(
|
104
|
+
check: target['health_check']['check'],
|
105
|
+
check_interval: target['health_check']['check_interval'],
|
106
|
+
maintenance: target['health_check']['maintenance'],
|
107
|
+
),
|
108
|
+
)
|
109
|
+
end if config[:targets]
|
110
|
+
|
111
|
+
if @updatable_fields.map { |el| config[el] }.any?
|
112
|
+
print "#{ui.color('Updating Network Load Balancer...', :magenta)}"
|
113
|
+
|
114
|
+
_, _, headers = network_load_balancer_api.datacenters_networkloadbalancers_forwardingrules_patch_with_http_info(
|
115
|
+
config[:datacenter_id],
|
116
|
+
config[:network_loadbalancer_id],
|
117
|
+
config[:forwarding_rule_id],
|
118
|
+
Ionoscloud::NetworkLoadBalancerForwardingRuleProperties.new(
|
119
|
+
name: config[:name],
|
120
|
+
algorithm: config[:algorithm],
|
121
|
+
protocol: config[:protocol],
|
122
|
+
listener_ip: config[:listener_ip],
|
123
|
+
listener_port: config[:listener_port],
|
124
|
+
targets: config[:targets],
|
125
|
+
health_check: Ionoscloud::NetworkLoadBalancerForwardingRuleHealthCheck.new(
|
126
|
+
client_timeout: config[:client_timeout],
|
127
|
+
connect_timeout: config[:connect_timeout],
|
128
|
+
target_timeout: config[:target_timeout],
|
129
|
+
retries: config[:retries],
|
130
|
+
),
|
131
|
+
),
|
132
|
+
)
|
133
|
+
|
134
|
+
dot = ui.color('.', :magenta)
|
135
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
136
|
+
else
|
137
|
+
ui.warn("Nothing to update, please set one of the attributes #{@updatable_fields}.")
|
138
|
+
end
|
139
|
+
|
140
|
+
print_network_load_balancer(
|
141
|
+
network_load_balancer_api.datacenters_networkloadbalancers_find_by_network_load_balancer_id(
|
142
|
+
config[:datacenter_id], config[:network_loadbalancer_id], depth: 2,
|
143
|
+
),
|
144
|
+
)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNetworkloadbalancerUpdate < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud networkloadbalancer 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 :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: 'Name of the load balancer'
|
24
|
+
|
25
|
+
option :listener_lan,
|
26
|
+
short: '-l LISTENER_LAN_ID',
|
27
|
+
long: '--listener-lan LISTENER_LAN_ID',
|
28
|
+
description: 'Id of the listening LAN. (inbound)'
|
29
|
+
|
30
|
+
option :target_lan,
|
31
|
+
short: '-t TARGET_LAN_ID',
|
32
|
+
long: '--target-lan TARGET_LAN_ID',
|
33
|
+
description: 'Id of the balanced private target LAN. (outbound)'
|
34
|
+
|
35
|
+
option :ips,
|
36
|
+
short: '-i IP[,IP,...]',
|
37
|
+
long: '--ips IP[,IP,...]',
|
38
|
+
description: 'Collection of IP addresses of the Network Load Balancer. (inbound and outbound) '\
|
39
|
+
'IP of the listenerLan must be a customer reserved IP for the public load balancer '\
|
40
|
+
'and private IP for the private load balancer.'
|
41
|
+
|
42
|
+
option :lb_private_ips,
|
43
|
+
long: '--private-ips IP[,IP,...]',
|
44
|
+
description: 'Collection of private IP addresses with subnet mask of the Network Load Balancer. '\
|
45
|
+
'IPs must contain valid subnet mask. If user will not provide any IP then the system '\
|
46
|
+
'will generate one IP with /24 subnet.'
|
47
|
+
|
48
|
+
|
49
|
+
attr_reader :description, :required_options
|
50
|
+
|
51
|
+
def initialize(args = [])
|
52
|
+
super(args)
|
53
|
+
@description =
|
54
|
+
'Updates information about a Ionoscloud Network Load Balancer.'
|
55
|
+
@required_options = [:datacenter_id, :network_loadbalancer_id, :ionoscloud_username, :ionoscloud_password]
|
56
|
+
@updatable_fields = [:name, :listener_lan, :target_lan, :ips, :lb_private_ips]
|
57
|
+
end
|
58
|
+
|
59
|
+
def run
|
60
|
+
$stdout.sync = true
|
61
|
+
handle_extra_config
|
62
|
+
validate_required_params(@required_options, config)
|
63
|
+
|
64
|
+
config[:ips] = config[:ips].split(',') if config[:ips] && config[:ips].instance_of?(String)
|
65
|
+
config[:lb_private_ips] = config[:lb_private_ips].split(',') if config[:lb_private_ips] && config[:lb_private_ips].instance_of?(String)
|
66
|
+
|
67
|
+
network_load_balancer_api = Ionoscloud::NetworkLoadBalancersApi.new(api_client)
|
68
|
+
|
69
|
+
if @updatable_fields.map { |el| config[el] }.any?
|
70
|
+
print "#{ui.color('Updating Network Load Balancer...', :magenta)}"
|
71
|
+
|
72
|
+
_, _, headers = network_load_balancer_api.datacenters_networkloadbalancers_patch_with_http_info(
|
73
|
+
config[:datacenter_id],
|
74
|
+
config[:network_loadbalancer_id],
|
75
|
+
Ionoscloud::NetworkLoadBalancerProperties.new({
|
76
|
+
name: config[:name],
|
77
|
+
ips: config[:ips],
|
78
|
+
listener_lan: config[:listener_lan],
|
79
|
+
target_lan: config[:target_lan],
|
80
|
+
lb_private_ips: config[:lb_private_ips],
|
81
|
+
}.compact),
|
82
|
+
)
|
83
|
+
|
84
|
+
dot = ui.color('.', :magenta)
|
85
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
86
|
+
else
|
87
|
+
ui.warn("Nothing to update, please set one of the attributes #{@updatable_fields}.")
|
88
|
+
end
|
89
|
+
|
90
|
+
print_network_load_balancer(
|
91
|
+
network_load_balancer_api.datacenters_networkloadbalancers_find_by_network_load_balancer_id(
|
92
|
+
config[:datacenter_id], config[:network_loadbalancer_id], depth: 2,
|
93
|
+
),
|
94
|
+
)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -39,9 +39,12 @@ class Chef
|
|
39
39
|
long: '--lan ID',
|
40
40
|
description: 'The LAN ID the NIC will reside on; if the LAN ID does not exist it will be created'
|
41
41
|
|
42
|
-
option :
|
43
|
-
|
44
|
-
|
42
|
+
option :firewall_type,
|
43
|
+
short: '-t FIREWALL_TYPE',
|
44
|
+
long: '--firewall-type FIREWALL_TYPE',
|
45
|
+
description: 'The type of firewall rules that will be allowed on the NIC. If it is not specified it will take the '\
|
46
|
+
'default value INGRESS',
|
47
|
+
default: 'INGRESS'
|
45
48
|
|
46
49
|
attr_reader :description, :required_options
|
47
50
|
|
@@ -62,40 +65,32 @@ class Chef
|
|
62
65
|
|
63
66
|
config[:ips] = config[:ips].split(',') if config[:ips] && config[:ips].instance_of?(String)
|
64
67
|
|
65
|
-
|
68
|
+
nic_properties = {
|
66
69
|
name: config[:name],
|
67
70
|
ips: config[:ips],
|
68
71
|
dhcp: config[:dhcp],
|
69
72
|
lan: config[:lan],
|
70
|
-
|
71
|
-
}
|
73
|
+
firewall_type: config[:firewall_type]
|
74
|
+
}.compact
|
72
75
|
|
73
|
-
nic_api = Ionoscloud::
|
76
|
+
nic_api = Ionoscloud::NetworkInterfacesApi.new(api_client)
|
74
77
|
|
75
78
|
nic, _, headers = nic_api.datacenters_servers_nics_post_with_http_info(
|
76
79
|
config[:datacenter_id],
|
77
80
|
config[:server_id],
|
78
|
-
|
81
|
+
Ionoscloud::Nic.new(properties: Ionoscloud::NicProperties.new(**nic_properties)),
|
79
82
|
)
|
80
83
|
|
81
84
|
dot = ui.color('.', :magenta)
|
82
85
|
api_client.wait_for { print dot; is_done? get_request_id headers }
|
83
86
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
87
|
+
print_nic(
|
88
|
+
nic_api.datacenters_servers_nics_find_by_id(
|
89
|
+
config[:datacenter_id],
|
90
|
+
config[:server_id],
|
91
|
+
nic.id,
|
92
|
+
),
|
88
93
|
)
|
89
|
-
|
90
|
-
puts "\n"
|
91
|
-
puts "#{ui.color('ID', :cyan)}: #{nic.id}"
|
92
|
-
puts "#{ui.color('Name', :cyan)}: #{nic.properties.name}"
|
93
|
-
puts "#{ui.color('IPs', :cyan)}: #{nic.properties.ips.to_s}"
|
94
|
-
puts "#{ui.color('DHCP', :cyan)}: #{nic.properties.dhcp}"
|
95
|
-
puts "#{ui.color('LAN', :cyan)}: #{nic.properties.lan}"
|
96
|
-
puts "#{ui.color('NAT', :cyan)}: #{nic.properties.nat}"
|
97
|
-
|
98
|
-
puts 'done'
|
99
94
|
end
|
100
95
|
end
|
101
96
|
end
|
@@ -31,7 +31,7 @@ class Chef
|
|
31
31
|
handle_extra_config
|
32
32
|
validate_required_params(@required_options, config)
|
33
33
|
|
34
|
-
nic_api = Ionoscloud::
|
34
|
+
nic_api = Ionoscloud::NetworkInterfacesApi.new(api_client)
|
35
35
|
@name_args.each do |nic_id|
|
36
36
|
begin
|
37
37
|
nic = nic_api.datacenters_servers_nics_find_by_id(config[:datacenter_id], config[:server_id], nic_id)
|
@@ -41,12 +41,8 @@ class Chef
|
|
41
41
|
next
|
42
42
|
end
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
msg_pair('IPs', nic.properties.ips)
|
47
|
-
msg_pair('DHCP', nic.properties.dhcp)
|
48
|
-
msg_pair('LAN', nic.properties.lan)
|
49
|
-
msg_pair('NAT', nic.properties.nat)
|
44
|
+
print_nic(nic)
|
45
|
+
puts "\n"
|
50
46
|
|
51
47
|
begin
|
52
48
|
confirm('Do you really want to delete this Nic')
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudNicGet < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud nic 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 :server_id,
|
16
|
+
short: '-S SERVER_ID',
|
17
|
+
long: '--server-id SERVER_ID',
|
18
|
+
description: 'The ID of the server to which the NIC is assigned'
|
19
|
+
|
20
|
+
option :nic_id,
|
21
|
+
short: '-N NIC_ID',
|
22
|
+
long: '--nic-id NIC_ID',
|
23
|
+
description: 'ID of the load balancer'
|
24
|
+
|
25
|
+
attr_reader :description, :required_options
|
26
|
+
|
27
|
+
def initialize(args = [])
|
28
|
+
super(args)
|
29
|
+
@description =
|
30
|
+
'Retrieves the attributes of a given NIC.'
|
31
|
+
@required_options = [:datacenter_id, :server_id, :nic_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
|
+
print_nic(
|
40
|
+
Ionoscloud::NetworkInterfacesApi.new(api_client).datacenters_servers_nics_find_by_id(
|
41
|
+
config[:datacenter_id],
|
42
|
+
config[:server_id],
|
43
|
+
config[:nic_id],
|
44
|
+
),
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|