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,212 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudCubeServerCreate < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud cube server create (options)'
|
9
|
+
|
10
|
+
option :datacenter_id,
|
11
|
+
short: '-D DATACENTER_ID',
|
12
|
+
long: '--datacenter-id DATACENTER_ID',
|
13
|
+
description: 'Name of the virtual datacenter'
|
14
|
+
|
15
|
+
option :name,
|
16
|
+
short: '-n NAME',
|
17
|
+
long: '--name NAME',
|
18
|
+
description: '(required) Name of the server'
|
19
|
+
|
20
|
+
option :template,
|
21
|
+
long: '--template TEMPLATE_UUID',
|
22
|
+
description: 'The UUID of the template for creating a CUBE server; the available templates for CUBE servers can be found on the templates resource'
|
23
|
+
|
24
|
+
option :cpu_family,
|
25
|
+
short: '-f CPU_FAMILY',
|
26
|
+
long: '--cpu-family CPU_FAMILY',
|
27
|
+
description: 'The family of processor cores (INTEL_XEON or AMD_OPTERON)'
|
28
|
+
|
29
|
+
option :availability_zone,
|
30
|
+
short: '-a AVAILABILITY_ZONE',
|
31
|
+
long: '--availability-zone AVAILABILITY_ZONE',
|
32
|
+
description: 'The availability zone of the server'
|
33
|
+
|
34
|
+
option :volume_name,
|
35
|
+
long: '--volume-name NAME',
|
36
|
+
description: 'Name of the volume'
|
37
|
+
|
38
|
+
option :bus,
|
39
|
+
short: '-b BUS',
|
40
|
+
long: '--bus BUS',
|
41
|
+
description: 'The bus type of the volume (VIRTIO or IDE)'
|
42
|
+
|
43
|
+
option :image,
|
44
|
+
short: '-N ID',
|
45
|
+
long: '--image ID',
|
46
|
+
description: '(required) The image or snapshot ID'
|
47
|
+
|
48
|
+
option :licence_type,
|
49
|
+
short: '-l LICENCE',
|
50
|
+
long: '--licence-type LICENCE',
|
51
|
+
description: 'The licence type of the volume (LINUX, WINDOWS, WINDOWS2016, UNKNOWN, OTHER)'
|
52
|
+
|
53
|
+
option :image_password,
|
54
|
+
short: '-P PASSWORD',
|
55
|
+
long: '--image-password PASSWORD',
|
56
|
+
description: 'The password set on the image for the "root" or "Administrator" user'
|
57
|
+
|
58
|
+
option :ssh_keys,
|
59
|
+
short: '-K SSHKEY[,SSHKEY,...]',
|
60
|
+
long: '--ssh-keys SSHKEY1,SSHKEY2,...',
|
61
|
+
description: 'A list of public SSH keys to include'
|
62
|
+
|
63
|
+
option :backupunit_id,
|
64
|
+
short: '-B BACKUPUNIT_ID',
|
65
|
+
long: '--backupunit BACKUPUNIT_ID',
|
66
|
+
description: 'The uuid of the Backup Unit that user has access to. The property is immutable and is only allowed '\
|
67
|
+
'to be set on a new volume creation. It is mandatory to provide either \'public image\' or \'imageAlias\' in '\
|
68
|
+
'conjunction with this property.'
|
69
|
+
|
70
|
+
option :user_data,
|
71
|
+
short: '-u USER_DATA',
|
72
|
+
long: '--user-data USER_DATA',
|
73
|
+
description: 'The cloud-init configuration for the volume as base64 encoded string. The property is '\
|
74
|
+
'immutable and is only allowed to be set on a new volume creation. It is mandatory to provide either \'public image\' '\
|
75
|
+
'or \'imageAlias\' that has cloud-init compatibility in conjunction with this property.'
|
76
|
+
|
77
|
+
option :set_boot,
|
78
|
+
long: '--set-boot',
|
79
|
+
description: 'Whether to set the volume as the boot volume'
|
80
|
+
|
81
|
+
option :nic_name,
|
82
|
+
long: '--nic-name NAME',
|
83
|
+
description: 'Name of the NIC'
|
84
|
+
|
85
|
+
option :ips,
|
86
|
+
short: '-i IP[,IP,...]',
|
87
|
+
long: '--ips IP[,IP,...]',
|
88
|
+
description: 'IPs assigned to the NIC'
|
89
|
+
|
90
|
+
option :dhcp,
|
91
|
+
short: '-h',
|
92
|
+
long: '--dhcp',
|
93
|
+
boolean: true | false,
|
94
|
+
description: 'Set to false if you wish to disable DHCP'
|
95
|
+
|
96
|
+
option :lan,
|
97
|
+
short: '-L ID',
|
98
|
+
long: '--lan ID',
|
99
|
+
description: 'The LAN ID the NIC will reside on; if the LAN ID does not exist it will be created'
|
100
|
+
|
101
|
+
option :firewall_type,
|
102
|
+
short: '-t FIREWALL_TYPE',
|
103
|
+
long: '--firewall-type FIREWALL_TYPE',
|
104
|
+
description: 'The type of firewall rules that will be allowed on the NIC. If it is not specified it will take the '\
|
105
|
+
'default value INGRESS'
|
106
|
+
|
107
|
+
attr_reader :description, :required_options
|
108
|
+
|
109
|
+
def initialize(args = [])
|
110
|
+
super(args)
|
111
|
+
@description =
|
112
|
+
'This creates a new cube server with an attached volume and NIC in a specified virtual data center.'
|
113
|
+
@required_options = [
|
114
|
+
:datacenter_id, :name, :template, :ionoscloud_username, :ionoscloud_password,
|
115
|
+
]
|
116
|
+
end
|
117
|
+
|
118
|
+
def run
|
119
|
+
$stdout.sync = true
|
120
|
+
handle_extra_config
|
121
|
+
validate_required_params(@required_options, config)
|
122
|
+
|
123
|
+
config[:ssh_keys] = config[:ssh_keys].split(',') if config[:ssh_keys] && config[:ssh_keys].instance_of?(String)
|
124
|
+
config[:ips] = config[:ips].split(',') if config[:ips] && config[:ips].instance_of?(String)
|
125
|
+
|
126
|
+
print ui.color('Creating cube server...', :magenta).to_s
|
127
|
+
|
128
|
+
volumes = [Ionoscloud::Volume.new(
|
129
|
+
properties: Ionoscloud::VolumeProperties.new({
|
130
|
+
name: config[:volume_name],
|
131
|
+
bus: config[:bus] || 'VIRTIO',
|
132
|
+
image: config[:image],
|
133
|
+
ssh_keys: config[:ssh_keys],
|
134
|
+
image_password: config[:image_password],
|
135
|
+
type: 'DAS',
|
136
|
+
licence_type: config[:licence_type],
|
137
|
+
backupunit_id: config[:backupunit_id],
|
138
|
+
user_data: config[:user_data],
|
139
|
+
}.compact)
|
140
|
+
)]
|
141
|
+
|
142
|
+
nics = []
|
143
|
+
|
144
|
+
if config[:nic_name] || config[:ips] || config[:dhcp] || config[:lan]
|
145
|
+
nics = [
|
146
|
+
Ionoscloud::Nic.new(
|
147
|
+
properties: Ionoscloud::NicProperties.new({
|
148
|
+
name: config[:nic_name],
|
149
|
+
ips: config[:ips],
|
150
|
+
dhcp: config[:dhcp],
|
151
|
+
lan: config[:lan],
|
152
|
+
firewall_type: config[:firewall_type],
|
153
|
+
}.compact)
|
154
|
+
)
|
155
|
+
]
|
156
|
+
end
|
157
|
+
|
158
|
+
server = Ionoscloud::Server.new(
|
159
|
+
properties: Ionoscloud::ServerProperties.new({
|
160
|
+
name: config[:name],
|
161
|
+
type: 'CUBE',
|
162
|
+
template_uuid: config[:template],
|
163
|
+
cpu_family: config[:cpu_family],
|
164
|
+
ram: config[:ram],
|
165
|
+
availability_zone: config[:availability_zone],
|
166
|
+
}.compact),
|
167
|
+
entities: Ionoscloud::ServerEntities.new(
|
168
|
+
volumes: {
|
169
|
+
items: volumes,
|
170
|
+
},
|
171
|
+
nics: {
|
172
|
+
items: nics,
|
173
|
+
},
|
174
|
+
),
|
175
|
+
)
|
176
|
+
|
177
|
+
server_api = Ionoscloud::ServersApi.new(api_client)
|
178
|
+
|
179
|
+
server, _, headers = server_api.datacenters_servers_post_with_http_info(config[:datacenter_id], server)
|
180
|
+
|
181
|
+
dot = ui.color('.', :magenta)
|
182
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
183
|
+
|
184
|
+
server = server_api.datacenters_servers_find_by_id(config[:datacenter_id], server.id, depth: 1)
|
185
|
+
|
186
|
+
if config[:set_boot]
|
187
|
+
changes = Ionoscloud::ServerProperties.new(boot_volume: { id: server.entities.volumes.items[0].id })
|
188
|
+
_, _, headers = server_api.datacenters_servers_patch_with_http_info(
|
189
|
+
config[:datacenter_id], server.id, changes,
|
190
|
+
)
|
191
|
+
|
192
|
+
api_client.wait_for { is_done? get_request_id headers }
|
193
|
+
|
194
|
+
server = server_api.datacenters_servers_find_by_id(config[:datacenter_id], server.id, depth: 1)
|
195
|
+
end
|
196
|
+
|
197
|
+
puts "\n"
|
198
|
+
puts "#{ui.color('ID', :cyan)}: #{server.id}"
|
199
|
+
puts "#{ui.color('Name', :cyan)}: #{server.properties.name}"
|
200
|
+
puts "#{ui.color('Type', :cyan)}: #{server.properties.type}"
|
201
|
+
puts "#{ui.color('Cores', :cyan)}: #{server.properties.cores}"
|
202
|
+
puts "#{ui.color('CPU Family', :cyan)}: #{server.properties.cpu_family}"
|
203
|
+
puts "#{ui.color('Ram', :cyan)}: #{server.properties.ram}"
|
204
|
+
puts "#{ui.color('Availability Zone', :cyan)}: #{server.properties.availability_zone}"
|
205
|
+
puts "#{ui.color('Boot Volume', :cyan)}: #{server.properties.boot_volume ? server.properties.boot_volume.id : ''}"
|
206
|
+
puts "#{ui.color('Boot CDROM', :cyan)}: #{server.properties.boot_cdrom ? server.properties.boot_cdrom.id : ''}"
|
207
|
+
|
208
|
+
puts 'done'
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
@@ -42,25 +42,22 @@ class Chef
|
|
42
42
|
|
43
43
|
print "#{ui.color('Creating data center...', :magenta)}"
|
44
44
|
|
45
|
-
datacenter_api = Ionoscloud::
|
45
|
+
datacenter_api = Ionoscloud::DataCentersApi.new(api_client)
|
46
46
|
|
47
|
-
datacenter, _, headers = datacenter_api.datacenters_post_with_http_info(
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
47
|
+
datacenter, _, headers = datacenter_api.datacenters_post_with_http_info(
|
48
|
+
Ionoscloud::Datacenter.new(
|
49
|
+
properties: Ionoscloud::DatacenterProperties.new(
|
50
|
+
name: config[:name],
|
51
|
+
description: config[:description],
|
52
|
+
location: config[:location],
|
53
|
+
),
|
54
|
+
),
|
55
|
+
)
|
54
56
|
|
55
57
|
dot = ui.color('.', :magenta)
|
56
58
|
api_client.wait_for { print dot; is_done? get_request_id headers }
|
57
59
|
|
58
|
-
|
59
|
-
puts "#{ui.color('ID', :cyan)}: #{datacenter.id}"
|
60
|
-
puts "#{ui.color('Name', :cyan)}: #{datacenter.properties.name}"
|
61
|
-
puts "#{ui.color('Description', :cyan)}: #{datacenter.properties.description}"
|
62
|
-
puts "#{ui.color('Location', :cyan)}: #{datacenter.properties.location}"
|
63
|
-
puts 'done'
|
60
|
+
print_datacenter(datacenter)
|
64
61
|
end
|
65
62
|
end
|
66
63
|
end
|
@@ -23,7 +23,7 @@ class Chef
|
|
23
23
|
handle_extra_config
|
24
24
|
validate_required_params(@required_options, config)
|
25
25
|
|
26
|
-
datacenter_api = Ionoscloud::
|
26
|
+
datacenter_api = Ionoscloud::DataCentersApi.new(api_client)
|
27
27
|
|
28
28
|
@name_args.each do |datacenter_id|
|
29
29
|
begin
|
@@ -34,12 +34,7 @@ class Chef
|
|
34
34
|
next
|
35
35
|
end
|
36
36
|
|
37
|
-
|
38
|
-
msg_pair('Name', datacenter.properties.name)
|
39
|
-
msg_pair('Description', datacenter.properties.description)
|
40
|
-
msg_pair('Location', datacenter.properties.location)
|
41
|
-
msg_pair('Version', datacenter.properties.version)
|
42
|
-
|
37
|
+
print_datacenter(datacenter)
|
43
38
|
puts "\n"
|
44
39
|
|
45
40
|
begin
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudDatacenterGet < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud datacenter 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
|
+
attr_reader :description, :required_options
|
16
|
+
|
17
|
+
def initialize(args = [])
|
18
|
+
super(args)
|
19
|
+
@description =
|
20
|
+
'Retrieves information about a Ionoscloud 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
|
+
print_datacenter(Ionoscloud::DataCentersApi.new(api_client).datacenters_find_by_id(config[:datacenter_id]))
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -31,20 +31,22 @@ class Chef
|
|
31
31
|
ui.color('Name', :bold),
|
32
32
|
ui.color('Description', :bold),
|
33
33
|
ui.color('Location', :bold),
|
34
|
+
ui.color('CPU Architectures', :bold),
|
34
35
|
ui.color('Version', :bold),
|
35
36
|
]
|
36
37
|
|
37
|
-
datacenter_api = Ionoscloud::
|
38
|
+
datacenter_api = Ionoscloud::DataCentersApi.new(api_client)
|
38
39
|
|
39
40
|
datacenter_api.datacenters_get({ depth: 1 }).items.each do |datacenter|
|
40
41
|
datacenter_list << datacenter.id
|
41
42
|
datacenter_list << datacenter.properties.name
|
42
43
|
datacenter_list << datacenter.properties.description || ''
|
43
44
|
datacenter_list << datacenter.properties.location
|
45
|
+
datacenter_list << datacenter.properties.cpu_architecture.map { |arch| arch.cpu_family }
|
44
46
|
datacenter_list << datacenter.properties.version.to_s
|
45
47
|
end
|
46
48
|
|
47
|
-
puts ui.list(datacenter_list, :uneven_columns_across,
|
49
|
+
puts ui.list(datacenter_list, :uneven_columns_across, 6)
|
48
50
|
end
|
49
51
|
end
|
50
52
|
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudDatacenterUpdate < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud datacenter 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 :name,
|
16
|
+
short: '-n NAME',
|
17
|
+
long: '--name NAME',
|
18
|
+
description: 'Name of the data center'
|
19
|
+
|
20
|
+
option :description,
|
21
|
+
long: '--description DESCRIPTION',
|
22
|
+
description: 'Description of the data center'
|
23
|
+
|
24
|
+
option :sec_auth_protection,
|
25
|
+
long: '--sec-auth-protection SEC_AUTH_PROTECTION',
|
26
|
+
description: 'Boolean value representing if the data center requires extra protection e.g. two factor protection'
|
27
|
+
|
28
|
+
attr_reader :description, :required_options
|
29
|
+
|
30
|
+
def initialize(args = [])
|
31
|
+
super(args)
|
32
|
+
@description =
|
33
|
+
'Updates information about a Ionoscloud Datacenter.'
|
34
|
+
@required_options = [:datacenter_id, :ionoscloud_username, :ionoscloud_password]
|
35
|
+
@updatable_fields = [:name, :description, :sec_auth_protection]
|
36
|
+
end
|
37
|
+
|
38
|
+
def run
|
39
|
+
$stdout.sync = true
|
40
|
+
handle_extra_config
|
41
|
+
validate_required_params(@required_options, config)
|
42
|
+
|
43
|
+
datacenter_api = Ionoscloud::DataCentersApi.new(api_client)
|
44
|
+
|
45
|
+
if @updatable_fields.map { |el| config[el] }.any?
|
46
|
+
print "#{ui.color('Updating data center...', :magenta)}"
|
47
|
+
|
48
|
+
datacenter, _, headers = datacenter_api.datacenters_patch_with_http_info(
|
49
|
+
config[:datacenter_id],
|
50
|
+
Ionoscloud::DatacenterProperties.new(
|
51
|
+
name: config[:name],
|
52
|
+
description: config[:description],
|
53
|
+
sec_auth_protection: (config.key?(:sec_auth_protection) ? config[:sec_auth_protection].to_s.downcase == 'true' : nil),
|
54
|
+
)
|
55
|
+
)
|
56
|
+
|
57
|
+
dot = ui.color('.', :magenta)
|
58
|
+
api_client.wait_for { print dot; is_done? get_request_id headers }
|
59
|
+
else
|
60
|
+
ui.warn("Nothing to update, please set one of the attributes #{@updatable_fields}.")
|
61
|
+
end
|
62
|
+
|
63
|
+
print_datacenter(datacenter_api.datacenters_find_by_id(config[:datacenter_id]))
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -57,7 +57,6 @@ class Chef
|
|
57
57
|
description: 'Defines the start range of the allowed port(s)'
|
58
58
|
|
59
59
|
option :port_range_end,
|
60
|
-
short: '-t PORT',
|
61
60
|
long: '--port-range-end PORT',
|
62
61
|
description: 'Defines the end range of the allowed port(s)'
|
63
62
|
|
@@ -71,6 +70,12 @@ class Chef
|
|
71
70
|
description: 'Defines the allowed code (from 0 to 254) if the' \
|
72
71
|
' protocol ICMP is chosen; null allows all codes'
|
73
72
|
|
73
|
+
option :type,
|
74
|
+
short: '--t TYPE',
|
75
|
+
long: '--type TYPE',
|
76
|
+
description: 'The type of firewall rule. If is not specified, it will take the default value INGRESS',
|
77
|
+
default: 'INGRESS'
|
78
|
+
|
74
79
|
attr_reader :description, :required_options
|
75
80
|
|
76
81
|
def initialize(args = [])
|
@@ -97,11 +102,12 @@ class Chef
|
|
97
102
|
port_range_end: config[:port_range_end],
|
98
103
|
icmp_type: config[:icmp_type],
|
99
104
|
icmp_code: config[:icmp_code],
|
105
|
+
type: config[:type]
|
100
106
|
}
|
101
107
|
|
102
|
-
|
108
|
+
firewallrules_api = Ionoscloud::FirewallRulesApi.new(api_client)
|
103
109
|
|
104
|
-
firewall, _, headers =
|
110
|
+
firewall, _, headers = firewallrules_api.datacenters_servers_nics_firewallrules_post_with_http_info(
|
105
111
|
config[:datacenter_id],
|
106
112
|
config[:server_id],
|
107
113
|
config[:nic_id],
|
@@ -111,25 +117,14 @@ class Chef
|
|
111
117
|
dot = ui.color('.', :magenta)
|
112
118
|
api_client.wait_for { print dot; is_done? get_request_id headers }
|
113
119
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
120
|
+
print_firewall_rule(
|
121
|
+
firewallrules_api.datacenters_servers_nics_firewallrules_find_by_id(
|
122
|
+
config[:datacenter_id],
|
123
|
+
config[:server_id],
|
124
|
+
config[:nic_id],
|
125
|
+
firewall.id,
|
126
|
+
),
|
119
127
|
)
|
120
|
-
|
121
|
-
puts "\n"
|
122
|
-
puts "#{ui.color('ID', :cyan)}: #{firewall.id}"
|
123
|
-
puts "#{ui.color('Name', :cyan)}: #{firewall.properties.name}"
|
124
|
-
puts "#{ui.color('Protocol', :cyan)}: #{firewall.properties.protocol}"
|
125
|
-
puts "#{ui.color('Source MAC', :cyan)}: #{firewall.properties.source_mac}"
|
126
|
-
puts "#{ui.color('Source IP', :cyan)}: #{firewall.properties.source_ip}"
|
127
|
-
puts "#{ui.color('Target IP', :cyan)}: #{firewall.properties.target_ip}"
|
128
|
-
puts "#{ui.color('Port Range Start', :cyan)}: #{firewall.properties.port_range_start}"
|
129
|
-
puts "#{ui.color('Port Range End', :cyan)}: #{firewall.properties.port_range_end}"
|
130
|
-
puts "#{ui.color('ICMP Type', :cyan)}: #{firewall.properties.icmp_type}"
|
131
|
-
puts "#{ui.color('ICMP Code', :cyan)}: #{firewall.properties.icmp_code}"
|
132
|
-
puts 'done'
|
133
128
|
end
|
134
129
|
end
|
135
130
|
end
|
@@ -36,11 +36,11 @@ class Chef
|
|
36
36
|
handle_extra_config
|
37
37
|
validate_required_params(@required_options, config)
|
38
38
|
|
39
|
-
|
39
|
+
firewallrules_api = Ionoscloud::FirewallRulesApi.new(api_client)
|
40
40
|
|
41
41
|
@name_args.each do |firewall_id|
|
42
42
|
begin
|
43
|
-
firewall =
|
43
|
+
firewall = firewallrules_api.datacenters_servers_nics_firewallrules_find_by_id(
|
44
44
|
config[:datacenter_id], config[:server_id], config[:nic_id], firewall_id,
|
45
45
|
)
|
46
46
|
rescue Ionoscloud::ApiError => err
|
@@ -49,16 +49,8 @@ class Chef
|
|
49
49
|
next
|
50
50
|
end
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
msg_pair('Protocol', firewall.properties.protocol)
|
55
|
-
msg_pair('Source MAC', firewall.properties.source_mac)
|
56
|
-
msg_pair('Source IP', firewall.properties.source_ip)
|
57
|
-
msg_pair('Target IP', firewall.properties.target_ip)
|
58
|
-
msg_pair('Port Range Start', firewall.properties.port_range_start)
|
59
|
-
msg_pair('Port Range End', firewall.properties.port_range_end)
|
60
|
-
msg_pair('ICMP Type', firewall.properties.icmp_type)
|
61
|
-
msg_pair('ICMP Code', firewall.properties.icmp_code)
|
52
|
+
print_firewall_rule(firewall)
|
53
|
+
puts "\n"
|
62
54
|
|
63
55
|
begin
|
64
56
|
confirm('Do you really want to delete this firewall rule')
|
@@ -66,7 +58,7 @@ class Chef
|
|
66
58
|
next
|
67
59
|
end
|
68
60
|
|
69
|
-
_, _, headers =
|
61
|
+
_, _, headers = firewallrules_api.datacenters_servers_nics_firewallrules_delete_with_http_info(
|
70
62
|
config[:datacenter_id], config[:server_id], config[:nic_id], firewall_id,
|
71
63
|
)
|
72
64
|
ui.warn("Deleted Firewall rule #{firewall.id}. Request ID: #{get_request_id headers}")
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require_relative 'ionoscloud_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class IonoscloudFirewallGet < Knife
|
6
|
+
include Knife::IonoscloudBase
|
7
|
+
|
8
|
+
banner 'knife ionoscloud firewall get (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 :server_id,
|
16
|
+
short: '-S SERVER_ID',
|
17
|
+
long: '--server-id SERVER_ID',
|
18
|
+
description: 'The ID of the server'
|
19
|
+
|
20
|
+
option :nic_id,
|
21
|
+
short: '-N NIC_ID',
|
22
|
+
long: '--nic-id NIC_ID',
|
23
|
+
description: 'ID of the NIC'
|
24
|
+
|
25
|
+
option :firewall_id,
|
26
|
+
short: '-F FIREWALL_ID',
|
27
|
+
long: '--firewall-id FIREWALL_ID',
|
28
|
+
description: 'ID of the Firewall Rule'
|
29
|
+
|
30
|
+
attr_reader :description, :required_options
|
31
|
+
|
32
|
+
def initialize(args = [])
|
33
|
+
super(args)
|
34
|
+
@description =
|
35
|
+
'Retrieves information about a Ionoscloud Firewall Rule.'
|
36
|
+
@required_options = [:firewall_id, :datacenter_id, :server_id, :nic_id, :ionoscloud_username, :ionoscloud_password]
|
37
|
+
end
|
38
|
+
|
39
|
+
def run
|
40
|
+
$stdout.sync = true
|
41
|
+
handle_extra_config
|
42
|
+
validate_required_params(@required_options, config)
|
43
|
+
|
44
|
+
print_firewall_rule(
|
45
|
+
Ionoscloud::FirewallRulesApi.new(api_client).datacenters_servers_nics_firewallrules_find_by_id(
|
46
|
+
config[:datacenter_id], config[:server_id], config[:nic_id], config[:firewall_id],
|
47
|
+
),
|
48
|
+
)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -47,11 +47,12 @@ class Chef
|
|
47
47
|
ui.color('Port Range End', :bold),
|
48
48
|
ui.color('ICMP Type', :bold),
|
49
49
|
ui.color('ICMP CODE', :bold),
|
50
|
+
ui.color('Type', :bold),
|
50
51
|
]
|
51
52
|
|
52
|
-
|
53
|
+
firewallrules_api = Ionoscloud::FirewallRulesApi.new(api_client)
|
53
54
|
|
54
|
-
|
55
|
+
firewallrules_api.datacenters_servers_nics_firewallrules_get(
|
55
56
|
config[:datacenter_id], config[:server_id], config[:nic_id], { depth: 1 }
|
56
57
|
).items.each do |firewall|
|
57
58
|
firewall_list << firewall.id
|
@@ -64,9 +65,10 @@ class Chef
|
|
64
65
|
firewall_list << firewall.properties.port_range_end.to_s
|
65
66
|
firewall_list << firewall.properties.icmp_type.to_s
|
66
67
|
firewall_list << firewall.properties.icmp_code.to_s
|
68
|
+
firewall_list << firewall.properties.type.to_s
|
67
69
|
end
|
68
70
|
|
69
|
-
puts ui.list(firewall_list, :uneven_columns_across,
|
71
|
+
puts ui.list(firewall_list, :uneven_columns_across, 11)
|
70
72
|
end
|
71
73
|
end
|
72
74
|
end
|