knife-ionoscloud 6.0.0.alpha.1 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/IONOS.CLOUD.BLU.svg +1 -0
- data/.github/workflows/publish.yml +4 -1
- data/README.md +9 -0
- data/docs/README.md +37 -0
- data/docs/changelog.md +10 -0
- data/docs/docs_generator.rb +45 -10
- data/docs/subcommands/{backupunit_create.md → backup/backupunit_create.md} +7 -1
- data/docs/subcommands/{backupunit_delete.md → backup/backupunit_delete.md} +7 -1
- data/docs/subcommands/backup/backupunit_get.md +38 -0
- data/docs/subcommands/{backupunit_list.md → backup/backupunit_list.md} +7 -1
- data/docs/subcommands/{backupunit_ssourl.md → backup/backupunit_ssourl.md} +7 -1
- data/docs/subcommands/backup/backupunit_update.md +44 -0
- data/docs/subcommands/{composite_server_create.md → compute-engine/composite_server_create.md} +15 -3
- data/docs/subcommands/compute-engine/cube_server_create.md +94 -0
- data/docs/subcommands/{datacenter_create.md → compute-engine/datacenter_create.md} +7 -1
- data/docs/subcommands/{datacenter_delete.md → compute-engine/datacenter_delete.md} +7 -1
- data/docs/subcommands/compute-engine/datacenter_get.md +38 -0
- data/docs/subcommands/{datacenter_list.md → compute-engine/datacenter_list.md} +7 -1
- data/docs/subcommands/compute-engine/datacenter_update.md +47 -0
- data/docs/subcommands/{firewall_create.md → compute-engine/firewall_create.md} +11 -2
- data/docs/subcommands/{firewall_delete.md → compute-engine/firewall_delete.md} +6 -0
- data/docs/subcommands/compute-engine/firewall_get.md +50 -0
- data/docs/subcommands/{firewall_list.md → compute-engine/firewall_list.md} +7 -1
- data/docs/subcommands/compute-engine/firewall_update.md +74 -0
- data/docs/subcommands/compute-engine/flowlog_create.md +66 -0
- data/docs/subcommands/compute-engine/flowlog_delete.md +54 -0
- data/docs/subcommands/compute-engine/flowlog_get.md +58 -0
- data/docs/subcommands/compute-engine/flowlog_list.md +54 -0
- data/docs/subcommands/compute-engine/flowlog_update.md +70 -0
- data/docs/subcommands/{image_list.md → compute-engine/image_list.md} +7 -1
- data/docs/subcommands/{ipblock_create.md → compute-engine/ipblock_create.md} +7 -1
- data/docs/subcommands/{ipblock_delete.md → compute-engine/ipblock_delete.md} +7 -1
- data/docs/subcommands/compute-engine/ipblock_get.md +38 -0
- data/docs/subcommands/{ipblock_list.md → compute-engine/ipblock_list.md} +7 -1
- data/docs/subcommands/compute-engine/ipblock_update.md +41 -0
- data/docs/subcommands/{ipfailover_add.md → compute-engine/ipfailover_add.md} +7 -1
- data/docs/subcommands/{ipfailover_remove.md → compute-engine/ipfailover_remove.md} +7 -1
- data/docs/subcommands/{label_add.md → compute-engine/label_add.md} +7 -1
- data/docs/subcommands/{label_list.md → compute-engine/label_list.md} +7 -1
- data/docs/subcommands/{label_remove.md → compute-engine/label_remove.md} +6 -0
- data/docs/subcommands/{lan_create.md → compute-engine/lan_create.md} +7 -1
- data/docs/subcommands/{lan_delete.md → compute-engine/lan_delete.md} +6 -0
- data/docs/subcommands/compute-engine/lan_get.md +42 -0
- data/docs/subcommands/{lan_list.md → compute-engine/lan_list.md} +7 -1
- data/docs/subcommands/compute-engine/lan_update.md +51 -0
- data/docs/subcommands/{loadbalancer_create.md → compute-engine/loadbalancer_create.md} +7 -1
- data/docs/subcommands/{loadbalancer_delete.md → compute-engine/loadbalancer_delete.md} +6 -0
- data/docs/subcommands/{loadbalancer_get.md → compute-engine/loadbalancer_get.md} +7 -1
- data/docs/subcommands/{loadbalancer_list.md → compute-engine/loadbalancer_list.md} +7 -1
- data/docs/subcommands/{loadbalancer_nic_add.md → compute-engine/loadbalancer_nic_add.md} +6 -0
- data/docs/subcommands/{loadbalancer_nic_remove.md → compute-engine/loadbalancer_nic_remove.md} +6 -0
- data/docs/subcommands/compute-engine/loadbalancer_update.md +51 -0
- data/docs/subcommands/{location_list.md → compute-engine/location_list.md} +7 -1
- data/docs/subcommands/compute-engine/natgateway_create.md +44 -0
- data/docs/subcommands/compute-engine/natgateway_delete.md +38 -0
- data/docs/subcommands/compute-engine/natgateway_get.md +42 -0
- data/docs/subcommands/compute-engine/natgateway_lan_add.md +49 -0
- data/docs/subcommands/compute-engine/natgateway_lan_remove.md +42 -0
- data/docs/subcommands/compute-engine/natgateway_list.md +38 -0
- data/docs/subcommands/compute-engine/natgateway_rule_add.md +69 -0
- data/docs/subcommands/compute-engine/natgateway_rule_list.md +41 -0
- data/docs/subcommands/compute-engine/natgateway_rule_remove.md +42 -0
- data/docs/subcommands/compute-engine/natgateway_rule_update.md +69 -0
- data/docs/subcommands/compute-engine/natgateway_update.md +51 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_create.md +57 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_delete.md +38 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_get.md +42 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_list.md +38 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_rule_add.md +75 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_rule_list.md +42 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_rule_remove.md +42 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_rule_target_add.md +67 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_rule_target_list.md +46 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_rule_target_remove.md +54 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_rule_update.md +75 -0
- data/docs/subcommands/compute-engine/networkloadbalancer_update.md +57 -0
- data/docs/subcommands/{nic_create.md → compute-engine/nic_create.md} +9 -3
- data/docs/subcommands/{nic_delete.md → compute-engine/nic_delete.md} +6 -0
- data/docs/subcommands/compute-engine/nic_get.md +46 -0
- data/docs/subcommands/{nic_list.md → compute-engine/nic_list.md} +7 -1
- data/docs/subcommands/compute-engine/nic_update.md +61 -0
- data/docs/subcommands/{pcc_create.md → compute-engine/pcc_create.md} +7 -1
- data/docs/subcommands/{pcc_delete.md → compute-engine/pcc_delete.md} +7 -1
- data/docs/subcommands/compute-engine/pcc_get.md +38 -0
- data/docs/subcommands/{pcc_list.md → compute-engine/pcc_list.md} +7 -1
- data/docs/subcommands/compute-engine/pcc_update.md +44 -0
- data/docs/subcommands/compute-engine/request_get.md +38 -0
- data/docs/subcommands/{request_list.md → compute-engine/request_list.md} +7 -1
- data/docs/subcommands/{request_status.md → compute-engine/request_status.md} +7 -1
- data/docs/subcommands/{request_wait.md → compute-engine/request_wait.md} +7 -1
- data/docs/subcommands/compute-engine/server_console.md +42 -0
- data/docs/subcommands/{server_create.md → compute-engine/server_create.md} +7 -1
- data/docs/subcommands/{server_delete.md → compute-engine/server_delete.md} +6 -0
- data/docs/subcommands/compute-engine/server_get.md +42 -0
- data/docs/subcommands/{server_list.md → compute-engine/server_list.md} +10 -1
- data/docs/subcommands/{server_reboot.md → compute-engine/server_reboot.md} +6 -0
- data/docs/subcommands/compute-engine/server_resume.md +38 -0
- data/docs/subcommands/{server_start.md → compute-engine/server_start.md} +6 -0
- data/docs/subcommands/{server_stop.md → compute-engine/server_stop.md} +6 -0
- data/docs/subcommands/compute-engine/server_suspend.md +38 -0
- data/docs/subcommands/compute-engine/server_token.md +42 -0
- data/docs/subcommands/compute-engine/server_update.md +63 -0
- data/docs/subcommands/compute-engine/server_upgrade.md +42 -0
- data/docs/subcommands/{snapshot_create.md → compute-engine/snapshot_create.md} +7 -1
- data/docs/subcommands/{snapshot_delete.md → compute-engine/snapshot_delete.md} +7 -1
- data/docs/subcommands/compute-engine/snapshot_get.md +38 -0
- data/docs/subcommands/{snapshot_list.md → compute-engine/snapshot_list.md} +7 -1
- data/docs/subcommands/{snapshot_restore.md → compute-engine/snapshot_restore.md} +7 -1
- data/docs/subcommands/compute-engine/snapshot_update.md +80 -0
- data/docs/subcommands/compute-engine/template_list.md +34 -0
- data/docs/subcommands/{volume_attach.md → compute-engine/volume_attach.md} +6 -0
- data/docs/subcommands/{volume_create.md → compute-engine/volume_create.md} +14 -5
- data/docs/subcommands/{volume_delete.md → compute-engine/volume_delete.md} +6 -0
- data/docs/subcommands/{volume_detach.md → compute-engine/volume_detach.md} +6 -0
- data/docs/subcommands/compute-engine/volume_get.md +42 -0
- data/docs/subcommands/{volume_list.md → compute-engine/volume_list.md} +7 -1
- data/docs/subcommands/compute-engine/volume_update.md +69 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_backup_get.md +38 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_backup_list.md +38 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_create.md +100 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_delete.md +34 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_get.md +38 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_list.md +34 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_restore.md +44 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_cluster_update.md +65 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_logs_get.md +47 -0
- data/docs/subcommands/dbaas-postgres/dbaas_postgres_version_list.md +38 -0
- data/docs/subcommands/kubernetes/k8s_create.md +53 -0
- data/docs/subcommands/{k8s_delete.md → kubernetes/k8s_delete.md} +7 -1
- data/docs/subcommands/kubernetes/k8s_get.md +38 -0
- data/docs/subcommands/{k8s_list.md → kubernetes/k8s_list.md} +7 -1
- data/docs/subcommands/kubernetes/k8s_update.md +56 -0
- data/docs/subcommands/{kubeconfig_get.md → kubernetes/kubeconfig_get.md} +7 -1
- data/docs/subcommands/{node_delete.md → kubernetes/node_delete.md} +6 -0
- data/docs/subcommands/kubernetes/node_get.md +46 -0
- data/docs/subcommands/{node_list.md → kubernetes/node_list.md} +7 -1
- data/docs/subcommands/{node_replace.md → kubernetes/node_replace.md} +6 -0
- data/docs/subcommands/{nodepool_create.md → kubernetes/nodepool_create.md} +16 -1
- data/docs/subcommands/{nodepool_delete.md → kubernetes/nodepool_delete.md} +6 -0
- data/docs/subcommands/kubernetes/nodepool_get.md +42 -0
- data/docs/subcommands/kubernetes/nodepool_lan_add.md +52 -0
- data/docs/subcommands/kubernetes/nodepool_lan_remove.md +42 -0
- data/docs/subcommands/{nodepool_list.md → kubernetes/nodepool_list.md} +7 -1
- data/docs/subcommands/kubernetes/nodepool_update.md +72 -0
- data/docs/subcommands/{contract_list.md → user/contract_list.md} +7 -1
- data/docs/subcommands/{group_create.md → user/group_create.md} +16 -1
- data/docs/subcommands/{group_delete.md → user/group_delete.md} +7 -1
- data/docs/subcommands/{group_get.md → user/group_get.md} +7 -1
- data/docs/subcommands/{group_list.md → user/group_list.md} +7 -1
- data/docs/subcommands/user/group_update.md +77 -0
- data/docs/subcommands/{group_user_add.md → user/group_user_add.md} +6 -0
- data/docs/subcommands/{group_user_remove.md → user/group_user_remove.md} +6 -0
- data/docs/subcommands/{resource_list.md → user/resource_list.md} +7 -1
- data/docs/subcommands/{s3key_create.md → user/s3key_create.md} +7 -1
- data/docs/subcommands/{s3key_delete.md → user/s3key_delete.md} +6 -0
- data/docs/subcommands/user/s3key_get.md +42 -0
- data/docs/subcommands/{s3key_list.md → user/s3key_list.md} +7 -1
- data/docs/subcommands/{share_create.md → user/share_create.md} +7 -1
- data/docs/subcommands/{share_delete.md → user/share_delete.md} +6 -0
- data/docs/subcommands/user/share_get.md +42 -0
- data/docs/subcommands/{share_list.md → user/share_list.md} +7 -1
- data/docs/subcommands/user/share_update.md +48 -0
- data/docs/subcommands/{user_create.md → user/user_create.md} +7 -1
- data/docs/subcommands/{user_delete.md → user/user_delete.md} +7 -1
- data/docs/subcommands/user/user_get.md +38 -0
- data/docs/subcommands/{user_list.md → user/user_list.md} +7 -1
- data/docs/subcommands/{user_ssourl.md → user/user_ssourl.md} +7 -1
- data/docs/subcommands/user/user_update.md +59 -0
- data/docs/summary.md +167 -82
- data/docs/templates/summary.mustache +6 -3
- data/knife-ionoscloud.gemspec +2 -1
- data/lib/chef/knife/ionoscloud_backupunit_create.rb +12 -16
- data/lib/chef/knife/ionoscloud_backupunit_delete.rb +3 -6
- data/lib/chef/knife/ionoscloud_backupunit_get.rb +32 -0
- data/lib/chef/knife/ionoscloud_backupunit_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_backupunit_ssourl.rb +2 -2
- data/lib/chef/knife/ionoscloud_backupunit_update.rb +61 -0
- data/lib/chef/knife/ionoscloud_base.rb +417 -1
- data/lib/chef/knife/ionoscloud_composite_server_create.rb +7 -11
- data/lib/chef/knife/ionoscloud_contract_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_cube_server_create.rb +7 -11
- data/lib/chef/knife/ionoscloud_datacenter_create.rb +12 -15
- data/lib/chef/knife/ionoscloud_datacenter_delete.rb +3 -8
- data/lib/chef/knife/ionoscloud_datacenter_get.rb +32 -0
- data/lib/chef/knife/ionoscloud_datacenter_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_datacenter_update.rb +66 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_backup_get.rb +33 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_backup_list.rb +59 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_create.rb +158 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_delete.rb +49 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_get.rb +34 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_list.rb +53 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_restore.rb +48 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_cluster_update.rb +102 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_logs_get.rb +59 -0
- data/lib/chef/knife/ionoscloud_dbaas_postgres_version_list.rb +49 -0
- data/lib/chef/knife/ionoscloud_firewall_create.rb +10 -24
- data/lib/chef/knife/ionoscloud_firewall_delete.rb +4 -13
- data/lib/chef/knife/ionoscloud_firewall_get.rb +51 -0
- data/lib/chef/knife/ionoscloud_firewall_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_firewall_update.rb +131 -0
- data/lib/chef/knife/ionoscloud_flowlog_create.rb +6 -14
- data/lib/chef/knife/ionoscloud_flowlog_delete.rb +10 -14
- data/lib/chef/knife/ionoscloud_flowlog_get.rb +83 -0
- data/lib/chef/knife/ionoscloud_flowlog_list.rb +4 -4
- data/lib/chef/knife/ionoscloud_flowlog_update.rb +124 -0
- data/lib/chef/knife/ionoscloud_group_create.rb +3 -18
- data/lib/chef/knife/ionoscloud_group_delete.rb +3 -20
- data/lib/chef/knife/ionoscloud_group_get.rb +3 -21
- data/lib/chef/knife/ionoscloud_group_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_group_update.rb +130 -0
- data/lib/chef/knife/ionoscloud_group_user_add.rb +3 -20
- data/lib/chef/knife/ionoscloud_group_user_remove.rb +3 -20
- data/lib/chef/knife/ionoscloud_image_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_ipblock_create.rb +12 -15
- data/lib/chef/knife/ionoscloud_ipblock_delete.rb +3 -6
- data/lib/chef/knife/ionoscloud_ipblock_get.rb +32 -0
- data/lib/chef/knife/ionoscloud_ipblock_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_ipblock_update.rb +56 -0
- data/lib/chef/knife/ionoscloud_ipfailover_add.rb +3 -3
- data/lib/chef/knife/ionoscloud_ipfailover_remove.rb +3 -3
- data/lib/chef/knife/ionoscloud_k8s_create.rb +28 -36
- data/lib/chef/knife/ionoscloud_k8s_delete.rb +3 -11
- data/lib/chef/knife/ionoscloud_k8s_get.rb +32 -0
- data/lib/chef/knife/ionoscloud_k8s_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_k8s_update.rb +98 -0
- data/lib/chef/knife/ionoscloud_kubeconfig_get.rb +2 -2
- data/lib/chef/knife/ionoscloud_label_add.rb +2 -2
- data/lib/chef/knife/ionoscloud_label_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_label_remove.rb +2 -2
- data/lib/chef/knife/ionoscloud_lan_create.rb +8 -17
- data/lib/chef/knife/ionoscloud_lan_delete.rb +5 -6
- data/lib/chef/knife/ionoscloud_lan_get.rb +37 -0
- data/lib/chef/knife/ionoscloud_lan_list.rb +4 -3
- data/lib/chef/knife/ionoscloud_lan_update.rb +75 -0
- data/lib/chef/knife/ionoscloud_loadbalancer_create.rb +7 -16
- data/lib/chef/knife/ionoscloud_loadbalancer_delete.rb +3 -10
- data/lib/chef/knife/ionoscloud_loadbalancer_get.rb +4 -14
- data/lib/chef/knife/ionoscloud_loadbalancer_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_add.rb +4 -16
- data/lib/chef/knife/ionoscloud_loadbalancer_nic_remove.rb +4 -17
- data/lib/chef/knife/ionoscloud_loadbalancer_update.rb +72 -0
- data/lib/chef/knife/ionoscloud_location_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_natgateway_create.rb +7 -19
- data/lib/chef/knife/ionoscloud_natgateway_delete.rb +4 -20
- data/lib/chef/knife/ionoscloud_natgateway_get.rb +41 -0
- data/lib/chef/knife/ionoscloud_natgateway_lan_add.rb +4 -13
- data/lib/chef/knife/ionoscloud_natgateway_lan_remove.rb +3 -10
- data/lib/chef/knife/ionoscloud_natgateway_list.rb +3 -2
- data/lib/chef/knife/ionoscloud_natgateway_rule_add.rb +8 -28
- data/lib/chef/knife/ionoscloud_natgateway_rule_list.rb +3 -2
- data/lib/chef/knife/ionoscloud_natgateway_rule_remove.rb +5 -23
- data/lib/chef/knife/ionoscloud_natgateway_rule_update.rb +115 -0
- data/lib/chef/knife/ionoscloud_natgateway_update.rb +83 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_create.rb +8 -15
- data/lib/chef/knife/ionoscloud_networkloadbalancer_delete.rb +4 -24
- data/lib/chef/knife/ionoscloud_networkloadbalancer_get.rb +41 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_add.rb +32 -48
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_list.rb +3 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_remove.rb +21 -32
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_add.rb +7 -26
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_list.rb +3 -2
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove.rb +6 -24
- data/lib/chef/knife/ionoscloud_networkloadbalancer_rule_update.rb +147 -0
- data/lib/chef/knife/ionoscloud_networkloadbalancer_update.rb +97 -0
- data/lib/chef/knife/ionoscloud_nic_create.rb +10 -24
- data/lib/chef/knife/ionoscloud_nic_delete.rb +4 -10
- data/lib/chef/knife/ionoscloud_nic_get.rb +48 -0
- data/lib/chef/knife/ionoscloud_nic_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_nic_update.rb +95 -0
- data/lib/chef/knife/ionoscloud_node_delete.rb +2 -2
- data/lib/chef/knife/ionoscloud_node_get.rb +48 -0
- data/lib/chef/knife/ionoscloud_node_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_node_replace.rb +2 -2
- data/lib/chef/knife/ionoscloud_nodepool_create.rb +27 -59
- data/lib/chef/knife/ionoscloud_nodepool_delete.rb +3 -34
- data/lib/chef/knife/ionoscloud_nodepool_get.rb +42 -0
- data/lib/chef/knife/ionoscloud_nodepool_lan_add.rb +4 -32
- data/lib/chef/knife/ionoscloud_nodepool_lan_remove.rb +3 -28
- data/lib/chef/knife/ionoscloud_nodepool_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_nodepool_update.rb +123 -0
- data/lib/chef/knife/ionoscloud_pcc_create.rb +13 -19
- data/lib/chef/knife/ionoscloud_pcc_delete.rb +3 -11
- data/lib/chef/knife/ionoscloud_pcc_get.rb +32 -0
- data/lib/chef/knife/ionoscloud_pcc_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_pcc_update.rb +62 -0
- data/lib/chef/knife/ionoscloud_request_get.rb +39 -0
- data/lib/chef/knife/ionoscloud_request_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_request_status.rb +2 -2
- data/lib/chef/knife/ionoscloud_request_wait.rb +2 -2
- data/lib/chef/knife/ionoscloud_resource_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_s3key_create.rb +3 -7
- data/lib/chef/knife/ionoscloud_s3key_delete.rb +3 -6
- data/lib/chef/knife/ionoscloud_s3key_get.rb +37 -0
- data/lib/chef/knife/ionoscloud_s3key_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_console.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_create.rb +16 -30
- data/lib/chef/knife/ionoscloud_server_delete.rb +4 -10
- data/lib/chef/knife/ionoscloud_server_get.rb +42 -0
- data/lib/chef/knife/ionoscloud_server_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_reboot.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_resume.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_start.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_stop.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_suspend.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_token.rb +2 -2
- data/lib/chef/knife/ionoscloud_server_update.rb +96 -0
- data/lib/chef/knife/ionoscloud_server_upgrade.rb +2 -2
- data/lib/chef/knife/ionoscloud_share_create.rb +9 -13
- data/lib/chef/knife/ionoscloud_share_delete.rb +4 -5
- data/lib/chef/knife/ionoscloud_share_get.rb +37 -0
- data/lib/chef/knife/ionoscloud_share_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_share_update.rb +69 -0
- data/lib/chef/knife/ionoscloud_snapshot_create.rb +3 -11
- data/lib/chef/knife/ionoscloud_snapshot_delete.rb +3 -8
- data/lib/chef/knife/ionoscloud_snapshot_get.rb +31 -0
- data/lib/chef/knife/ionoscloud_snapshot_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_snapshot_restore.rb +3 -14
- data/lib/chef/knife/ionoscloud_snapshot_update.rb +125 -0
- data/lib/chef/knife/ionoscloud_template_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_user_create.rb +3 -10
- data/lib/chef/knife/ionoscloud_user_delete.rb +3 -8
- data/lib/chef/knife/ionoscloud_user_get.rb +31 -0
- data/lib/chef/knife/ionoscloud_user_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_user_ssourl.rb +2 -2
- data/lib/chef/knife/ionoscloud_user_update.rb +91 -0
- data/lib/chef/knife/ionoscloud_volume_attach.rb +2 -2
- data/lib/chef/knife/ionoscloud_volume_create.rb +4 -15
- data/lib/chef/knife/ionoscloud_volume_delete.rb +4 -10
- data/lib/chef/knife/ionoscloud_volume_detach.rb +2 -2
- data/lib/chef/knife/ionoscloud_volume_get.rb +35 -0
- data/lib/chef/knife/ionoscloud_volume_list.rb +2 -2
- data/lib/chef/knife/ionoscloud_volume_update.rb +105 -0
- data/lib/knife-ionoscloud/version.rb +1 -1
- data/spec/chef/knife/ionoscloud_backupunit_get_spec.rb +65 -0
- data/spec/chef/knife/ionoscloud_backupunit_update_spec.rb +78 -0
- data/spec/chef/knife/ionoscloud_datacenter_create_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_datacenter_delete_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_datacenter_get_spec.rb +69 -0
- data/spec/chef/knife/ionoscloud_datacenter_update_spec.rb +82 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_backup_get_spec.rb +67 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_backup_list_spec.rb +111 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_create_spec.rb +99 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_delete_spec.rb +109 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_get_spec.rb +73 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_list_spec.rb +84 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_restore_spec.rb +59 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_cluster_update_spec.rb +89 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_logs_get_spec.rb +67 -0
- data/spec/chef/knife/ionoscloud_dbaas_postgres_version_list_spec.rb +94 -0
- data/spec/chef/knife/ionoscloud_firewall_create_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_firewall_delete_spec.rb +1 -1
- data/spec/chef/knife/ionoscloud_firewall_get_spec.rb +77 -0
- data/spec/chef/knife/ionoscloud_firewall_update_spec.rb +117 -0
- data/spec/chef/knife/ionoscloud_flowlog_create_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_flowlog_delete_spec.rb +10 -10
- data/spec/chef/knife/ionoscloud_flowlog_get_spec.rb +171 -0
- data/spec/chef/knife/ionoscloud_flowlog_list_spec.rb +3 -3
- data/spec/chef/knife/ionoscloud_flowlog_update_spec.rb +244 -0
- data/spec/chef/knife/ionoscloud_group_create_spec.rb +3 -0
- 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_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_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_update_spec.rb +89 -0
- data/spec/chef/knife/ionoscloud_natgateway_create_spec.rb +15 -0
- data/spec/chef/knife/ionoscloud_natgateway_get_spec.rb +81 -0
- data/spec/chef/knife/ionoscloud_natgateway_lan_add_spec.rb +15 -0
- data/spec/chef/knife/ionoscloud_natgateway_lan_remove_spec.rb +15 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_add_spec.rb +1 -0
- data/spec/chef/knife/ionoscloud_natgateway_rule_remove_spec.rb +1 -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 +13 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_delete_spec.rb +3 -2
- data/spec/chef/knife/ionoscloud_networkloadbalancer_get_spec.rb +82 -0
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_add_spec.rb +4 -3
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_remove_spec.rb +70 -44
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_add_spec.rb +26 -22
- data/spec/chef/knife/ionoscloud_networkloadbalancer_rule_target_remove_spec.rb +79 -61
- 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_get_spec.rb +72 -0
- 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 +8 -17
- 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 +29 -33
- data/spec/chef/knife/ionoscloud_nodepool_lan_remove.rb +14 -17
- data/spec/chef/knife/ionoscloud_nodepool_update_spec.rb +134 -0
- data/spec/chef/knife/ionoscloud_pcc_create_spec.rb +7 -4
- data/spec/chef/knife/ionoscloud_pcc_delete_spec.rb +2 -2
- data/spec/chef/knife/ionoscloud_pcc_get_spec.rb +71 -0
- 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_s3key_get_spec.rb +66 -0
- data/spec/chef/knife/ionoscloud_server_create_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_server_delete_spec.rb +3 -0
- data/spec/chef/knife/ionoscloud_server_get_spec.rb +74 -0
- data/spec/chef/knife/ionoscloud_server_update_spec.rb +105 -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 +12 -0
- data/spec/chef/knife/ionoscloud_snapshot_delete_spec.rb +12 -0
- data/spec/chef/knife/ionoscloud_snapshot_get_spec.rb +79 -0
- data/spec/chef/knife/ionoscloud_snapshot_restore_spec.rb +9 -0
- data/spec/chef/knife/ionoscloud_snapshot_update_spec.rb +113 -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_update_spec.rb +110 -0
- data/spec/chef/knife/ionoscloud_volume_create_spec.rb +15 -5
- data/spec/chef/knife/ionoscloud_volume_delete_spec.rb +10 -0
- data/spec/chef/knife/ionoscloud_volume_get_spec.rb +81 -0
- data/spec/chef/knife/ionoscloud_volume_update_spec.rb +116 -0
- data/spec/spec_helper.rb +148 -23
- metadata +336 -90
- data/docs/subcommands/k8s_create.md +0 -47
- data/spec/test.sh +0 -3
@@ -0,0 +1,117 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ionoscloud_firewall_update'
|
3
|
+
|
4
|
+
Chef::Knife::IonoscloudFirewallUpdate.load_deps
|
5
|
+
|
6
|
+
describe Chef::Knife::IonoscloudFirewallUpdate do
|
7
|
+
before :each do
|
8
|
+
subject { Chef::Knife::IonoscloudFirewallUpdate.new }
|
9
|
+
|
10
|
+
allow(subject).to receive(:puts)
|
11
|
+
allow(subject).to receive(:print)
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#run' do
|
15
|
+
it 'should call FirewallRulesApi.datacenters_servers_nics_firewallrules_patch' do
|
16
|
+
firewall = firewall_mock
|
17
|
+
subject_config = {
|
18
|
+
ionoscloud_username: 'email',
|
19
|
+
ionoscloud_password: 'password',
|
20
|
+
datacenter_id: 'datacenter_id',
|
21
|
+
server_id: 'server_id',
|
22
|
+
nic_id: 'nic_id',
|
23
|
+
firewall_id: firewall.id,
|
24
|
+
name: firewall.properties.name + '_edited',
|
25
|
+
protocol: 'TCP',
|
26
|
+
source_mac: '01:11:11:11:22:00',
|
27
|
+
source_ip: '1.2.3.4',
|
28
|
+
target_ip: '2.2.3.1',
|
29
|
+
port_range_start: 100,
|
30
|
+
port_range_end: 145,
|
31
|
+
icmp_type: 15,
|
32
|
+
icmp_code: 14,
|
33
|
+
yes: true,
|
34
|
+
}
|
35
|
+
|
36
|
+
subject_config.each { |key, value| subject.config[key] = value }
|
37
|
+
|
38
|
+
expect(subject).to receive(:puts).with("ID: #{firewall.id}")
|
39
|
+
expect(subject).to receive(:puts).with("Name: #{subject_config[:name]}")
|
40
|
+
expect(subject).to receive(:puts).with("Type: #{firewall.properties.type}")
|
41
|
+
expect(subject).to receive(:puts).with("Protocol: #{subject_config[:protocol]}")
|
42
|
+
expect(subject).to receive(:puts).with("Source MAC: #{subject_config[:source_mac]}")
|
43
|
+
expect(subject).to receive(:puts).with("Source IP: #{subject_config[:source_ip]}")
|
44
|
+
expect(subject).to receive(:puts).with("Target IP: #{subject_config[:target_ip]}")
|
45
|
+
expect(subject).to receive(:puts).with("Port Range Start: #{subject_config[:port_range_start]}")
|
46
|
+
expect(subject).to receive(:puts).with("Port Range End: #{subject_config[:port_range_end]}")
|
47
|
+
expect(subject).to receive(:puts).with("ICMP Type: #{subject_config[:icmp_type]}")
|
48
|
+
expect(subject).to receive(:puts).with("ICMP Code: #{subject_config[:icmp_code]}")
|
49
|
+
|
50
|
+
firewall.properties.name = subject_config[:name]
|
51
|
+
firewall.properties.protocol = subject_config[:protocol]
|
52
|
+
firewall.properties.source_mac = subject_config[:source_mac]
|
53
|
+
firewall.properties.source_ip = subject_config[:source_ip]
|
54
|
+
firewall.properties.target_ip = subject_config[:target_ip]
|
55
|
+
firewall.properties.port_range_start = subject_config[:port_range_start]
|
56
|
+
firewall.properties.port_range_end = subject_config[:port_range_end]
|
57
|
+
firewall.properties.icmp_type = subject_config[:icmp_type]
|
58
|
+
firewall.properties.icmp_code = subject_config[:icmp_code]
|
59
|
+
|
60
|
+
expected_body = {
|
61
|
+
name: subject_config[:name],
|
62
|
+
protocol: subject_config[:protocol],
|
63
|
+
sourceMac: subject_config[:source_mac],
|
64
|
+
sourceIp: subject_config[:source_ip],
|
65
|
+
targetIp: subject_config[:target_ip],
|
66
|
+
portRangeStart: subject_config[:port_range_start],
|
67
|
+
portRangeEnd: subject_config[:port_range_end],
|
68
|
+
icmpType: subject_config[:icmp_type],
|
69
|
+
icmpCode: subject_config[:icmp_code],
|
70
|
+
}
|
71
|
+
|
72
|
+
mock_wait_for(subject)
|
73
|
+
mock_call_api(
|
74
|
+
subject,
|
75
|
+
[
|
76
|
+
{
|
77
|
+
method: 'PATCH',
|
78
|
+
path: "/datacenters/#{subject_config[:datacenter_id]}/servers/#{subject_config[:server_id]}/"\
|
79
|
+
"nics/#{subject_config[:nic_id]}/firewallrules/#{firewall.id}",
|
80
|
+
operation: :'FirewallRulesApi.datacenters_servers_nics_firewallrules_patch',
|
81
|
+
return_type: 'FirewallRule',
|
82
|
+
body: expected_body,
|
83
|
+
result: firewall,
|
84
|
+
},
|
85
|
+
{
|
86
|
+
method: 'GET',
|
87
|
+
path: "/datacenters/#{subject_config[:datacenter_id]}/servers/#{subject_config[:server_id]}/"\
|
88
|
+
"nics/#{subject_config[:nic_id]}/firewallrules/#{firewall.id}",
|
89
|
+
operation: :'FirewallRulesApi.datacenters_servers_nics_firewallrules_find_by_id',
|
90
|
+
return_type: 'FirewallRule',
|
91
|
+
result: firewall,
|
92
|
+
},
|
93
|
+
],
|
94
|
+
)
|
95
|
+
|
96
|
+
expect { subject.run }.not_to raise_error(Exception)
|
97
|
+
end
|
98
|
+
|
99
|
+
it 'should not make any call if any required option is missing' do
|
100
|
+
required_options = subject.instance_variable_get(:@required_options)
|
101
|
+
|
102
|
+
arrays_without_one_element(required_options).each do |test_case|
|
103
|
+
|
104
|
+
test_case[:array].each { |value| subject.config[value] = 'test' }
|
105
|
+
|
106
|
+
expect(subject).to receive(:puts).with("Missing required parameters #{test_case[:removed]}")
|
107
|
+
expect(subject.api_client).not_to receive(:call_api)
|
108
|
+
|
109
|
+
expect { subject.run }.to raise_error(SystemExit) do |error|
|
110
|
+
expect(error.status).to eq(1)
|
111
|
+
end
|
112
|
+
|
113
|
+
required_options.each { |value| subject.config[value] = nil }
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
@@ -148,7 +148,7 @@ describe Chef::Knife::IonoscloudFlowlogCreate do
|
|
148
148
|
ionoscloud_password: 'password',
|
149
149
|
datacenter_id: 'datacenter_id',
|
150
150
|
network_loadbalancer_id: 'network_loadbalancer_id',
|
151
|
-
type: '
|
151
|
+
type: 'networkloadbalancer',
|
152
152
|
name: flowlog.properties.name,
|
153
153
|
action: flowlog.properties.action,
|
154
154
|
direction: flowlog.properties.direction,
|
@@ -187,7 +187,7 @@ describe Chef::Knife::IonoscloudFlowlogCreate do
|
|
187
187
|
ionoscloud_username: 'email',
|
188
188
|
ionoscloud_password: 'password',
|
189
189
|
datacenter_id: 'datacenter_id',
|
190
|
-
type: '
|
190
|
+
type: 'networkloadbalancer',
|
191
191
|
name: flowlog.properties.name,
|
192
192
|
action: flowlog.properties.action,
|
193
193
|
direction: flowlog.properties.direction,
|
@@ -224,7 +224,7 @@ describe Chef::Knife::IonoscloudFlowlogCreate do
|
|
224
224
|
|
225
225
|
subject_config.each { |key, value| subject.config[key] = value }
|
226
226
|
|
227
|
-
expect(subject.ui).to receive(:error).with("Flow
|
227
|
+
expect(subject.ui).to receive(:error).with("Flow Log cannot belong to #{subject_config[:type]}. Value must be one of ['nic', 'natgateway', 'networkloadbalancer']")
|
228
228
|
|
229
229
|
expect(subject.api_client).not_to receive(:call_api)
|
230
230
|
|
@@ -32,7 +32,7 @@ describe Chef::Knife::IonoscloudFlowlogDelete do
|
|
32
32
|
expect(subject).to receive(:puts).with("Action: #{flowlog.properties.action}")
|
33
33
|
expect(subject).to receive(:puts).with("Direction: #{flowlog.properties.direction}")
|
34
34
|
expect(subject).to receive(:puts).with("Bucket: #{flowlog.properties.bucket}")
|
35
|
-
expect(subject.ui).to receive(:warn).with("Deleted
|
35
|
+
expect(subject.ui).to receive(:warn).with("Deleted Flow Log #{flowlog.id}. Request ID: ")
|
36
36
|
|
37
37
|
expect(subject.api_client).not_to receive(:wait_for)
|
38
38
|
expect(subject).to receive(:get_request_id).once
|
@@ -73,7 +73,7 @@ describe Chef::Knife::IonoscloudFlowlogDelete do
|
|
73
73
|
subject_config.each { |key, value| subject.config[key] = value }
|
74
74
|
subject.name_args = [flowlog_id]
|
75
75
|
|
76
|
-
expect(subject.ui).to receive(:error).with("Flow
|
76
|
+
expect(subject.ui).to receive(:error).with("Flow Log ID #{flowlog_id} not found. Skipping.")
|
77
77
|
|
78
78
|
expect(subject.api_client).not_to receive(:wait_for)
|
79
79
|
mock_call_api(
|
@@ -133,7 +133,7 @@ describe Chef::Knife::IonoscloudFlowlogDelete do
|
|
133
133
|
expect(subject).to receive(:puts).with("Action: #{flowlog.properties.action}")
|
134
134
|
expect(subject).to receive(:puts).with("Direction: #{flowlog.properties.direction}")
|
135
135
|
expect(subject).to receive(:puts).with("Bucket: #{flowlog.properties.bucket}")
|
136
|
-
expect(subject.ui).to receive(:warn).with("Deleted
|
136
|
+
expect(subject.ui).to receive(:warn).with("Deleted Flow Log #{flowlog.id}. Request ID: ")
|
137
137
|
|
138
138
|
expect(subject.api_client).not_to receive(:wait_for)
|
139
139
|
expect(subject).to receive(:get_request_id).once
|
@@ -171,7 +171,7 @@ describe Chef::Knife::IonoscloudFlowlogDelete do
|
|
171
171
|
subject_config.each { |key, value| subject.config[key] = value }
|
172
172
|
subject.name_args = [flowlog_id]
|
173
173
|
|
174
|
-
expect(subject.ui).to receive(:error).with("Flow
|
174
|
+
expect(subject.ui).to receive(:error).with("Flow Log ID #{flowlog_id} not found. Skipping.")
|
175
175
|
|
176
176
|
expect(subject.api_client).not_to receive(:wait_for)
|
177
177
|
mock_call_api(
|
@@ -218,7 +218,7 @@ describe Chef::Knife::IonoscloudFlowlogDelete do
|
|
218
218
|
ionoscloud_password: 'password',
|
219
219
|
datacenter_id: 'datacenter_id',
|
220
220
|
network_loadbalancer_id: 'network_loadbalancer_id',
|
221
|
-
type: '
|
221
|
+
type: 'networkloadbalancer',
|
222
222
|
yes: true,
|
223
223
|
}
|
224
224
|
|
@@ -230,7 +230,7 @@ describe Chef::Knife::IonoscloudFlowlogDelete do
|
|
230
230
|
expect(subject).to receive(:puts).with("Action: #{flowlog.properties.action}")
|
231
231
|
expect(subject).to receive(:puts).with("Direction: #{flowlog.properties.direction}")
|
232
232
|
expect(subject).to receive(:puts).with("Bucket: #{flowlog.properties.bucket}")
|
233
|
-
expect(subject.ui).to receive(:warn).with("Deleted
|
233
|
+
expect(subject.ui).to receive(:warn).with("Deleted Flow Log #{flowlog.id}. Request ID: ")
|
234
234
|
|
235
235
|
expect(subject.api_client).not_to receive(:wait_for)
|
236
236
|
expect(subject).to receive(:get_request_id).once
|
@@ -264,13 +264,13 @@ describe Chef::Knife::IonoscloudFlowlogDelete do
|
|
264
264
|
ionoscloud_password: 'password',
|
265
265
|
datacenter_id: 'datacenter_id',
|
266
266
|
network_loadbalancer_id: 'network_loadbalancer_id',
|
267
|
-
type: '
|
267
|
+
type: 'networkloadbalancer',
|
268
268
|
}
|
269
269
|
|
270
270
|
subject_config.each { |key, value| subject.config[key] = value }
|
271
271
|
subject.name_args = [flowlog_id]
|
272
272
|
|
273
|
-
expect(subject.ui).to receive(:error).with("Flow
|
273
|
+
expect(subject.ui).to receive(:error).with("Flow Log ID #{flowlog_id} not found. Skipping.")
|
274
274
|
|
275
275
|
expect(subject.api_client).not_to receive(:wait_for)
|
276
276
|
mock_call_api(
|
@@ -296,7 +296,7 @@ describe Chef::Knife::IonoscloudFlowlogDelete do
|
|
296
296
|
ionoscloud_username: 'email',
|
297
297
|
ionoscloud_password: 'password',
|
298
298
|
datacenter_id: 'datacenter_id',
|
299
|
-
type: '
|
299
|
+
type: 'networkloadbalancer',
|
300
300
|
}
|
301
301
|
|
302
302
|
subject_config.each { |key, value| subject.config[key] = value }
|
@@ -330,7 +330,7 @@ describe Chef::Knife::IonoscloudFlowlogDelete do
|
|
330
330
|
|
331
331
|
subject_config.each { |key, value| subject.config[key] = value }
|
332
332
|
|
333
|
-
expect(subject.ui).to receive(:error).with("Flow
|
333
|
+
expect(subject.ui).to receive(:error).with("Flow Log cannot belong to #{subject_config[:type]}. Value must be one of ['nic', 'natgateway', 'networkloadbalancer']")
|
334
334
|
|
335
335
|
expect(subject.api_client).not_to receive(:call_api)
|
336
336
|
|
@@ -0,0 +1,171 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ionoscloud_flowlog_get'
|
3
|
+
|
4
|
+
Chef::Knife::IonoscloudFlowlogGet.load_deps
|
5
|
+
|
6
|
+
describe Chef::Knife::IonoscloudFlowlogGet do
|
7
|
+
before :each do
|
8
|
+
subject { Chef::Knife::IonoscloudFlowlogGet.new }
|
9
|
+
|
10
|
+
allow(subject).to receive(:puts)
|
11
|
+
allow(subject).to receive(:print)
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#run' do
|
15
|
+
it 'should call FlowLogsApi.datacenters_servers_nics_flowlogs_find_by_id' do
|
16
|
+
flowlog = flowlog_mock
|
17
|
+
subject_config = {
|
18
|
+
ionoscloud_username: 'email',
|
19
|
+
ionoscloud_password: 'password',
|
20
|
+
type: 'nic',
|
21
|
+
datacenter_id: 'datacenter_id',
|
22
|
+
server_id: 'server_id',
|
23
|
+
nic_id: 'nic_id',
|
24
|
+
flowlog_id: flowlog.id,
|
25
|
+
yes: true,
|
26
|
+
}
|
27
|
+
|
28
|
+
subject_config.each { |key, value| subject.config[key] = value }
|
29
|
+
|
30
|
+
expect(subject).to receive(:puts).with("ID: #{flowlog.id}")
|
31
|
+
expect(subject).to receive(:puts).with("Name: #{flowlog.properties.name}")
|
32
|
+
expect(subject).to receive(:puts).with("Action: #{flowlog.properties.action}")
|
33
|
+
expect(subject).to receive(:puts).with("Direction: #{flowlog.properties.direction}")
|
34
|
+
expect(subject).to receive(:puts).with("Bucket: #{flowlog.properties.bucket}")
|
35
|
+
|
36
|
+
expect(subject.api_client).not_to receive(:wait_for)
|
37
|
+
mock_call_api(
|
38
|
+
subject,
|
39
|
+
[
|
40
|
+
{
|
41
|
+
method: 'GET',
|
42
|
+
path: "/datacenters/#{subject_config[:datacenter_id]}/servers/#{subject_config[:server_id]}/"\
|
43
|
+
"nics/#{subject_config[:nic_id]}/flowlogs/#{flowlog.id}",
|
44
|
+
operation: :'FlowLogsApi.datacenters_servers_nics_flowlogs_find_by_id',
|
45
|
+
return_type: 'FlowLog',
|
46
|
+
result: flowlog,
|
47
|
+
},
|
48
|
+
],
|
49
|
+
)
|
50
|
+
|
51
|
+
expect { subject.run }.not_to raise_error(Exception)
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'should call NATGatewaysApi.datacenters_natgateways_flowlogs_find_by_flow_log_id' do
|
55
|
+
flowlog = flowlog_mock
|
56
|
+
subject_config = {
|
57
|
+
ionoscloud_username: 'email',
|
58
|
+
ionoscloud_password: 'password',
|
59
|
+
type: 'natgateway',
|
60
|
+
datacenter_id: 'datacenter_id',
|
61
|
+
natgateway_id: 'natgateway_id',
|
62
|
+
flowlog_id: flowlog.id,
|
63
|
+
yes: true,
|
64
|
+
}
|
65
|
+
|
66
|
+
subject_config.each { |key, value| subject.config[key] = value }
|
67
|
+
|
68
|
+
expect(subject).to receive(:puts).with("ID: #{flowlog.id}")
|
69
|
+
expect(subject).to receive(:puts).with("Name: #{flowlog.properties.name}")
|
70
|
+
expect(subject).to receive(:puts).with("Action: #{flowlog.properties.action}")
|
71
|
+
expect(subject).to receive(:puts).with("Direction: #{flowlog.properties.direction}")
|
72
|
+
expect(subject).to receive(:puts).with("Bucket: #{flowlog.properties.bucket}")
|
73
|
+
|
74
|
+
expect(subject.api_client).not_to receive(:wait_for)
|
75
|
+
mock_call_api(
|
76
|
+
subject,
|
77
|
+
[
|
78
|
+
{
|
79
|
+
method: 'GET',
|
80
|
+
path: "/datacenters/#{subject_config[:datacenter_id]}/natgateways/#{subject_config[:natgateway_id]}/flowlogs/#{flowlog.id}",
|
81
|
+
operation: :'NATGatewaysApi.datacenters_natgateways_flowlogs_find_by_flow_log_id',
|
82
|
+
return_type: 'FlowLog',
|
83
|
+
result: flowlog,
|
84
|
+
},
|
85
|
+
],
|
86
|
+
)
|
87
|
+
|
88
|
+
expect { subject.run }.not_to raise_error(Exception)
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'should call NetworkLoadBalancersApi.datacenters_networkloadbalancers_flowlogs_find_by_flow_log_id' do
|
92
|
+
flowlog = flowlog_mock
|
93
|
+
subject_config = {
|
94
|
+
ionoscloud_username: 'email',
|
95
|
+
ionoscloud_password: 'password',
|
96
|
+
type: 'networkloadbalancer',
|
97
|
+
datacenter_id: 'datacenter_id',
|
98
|
+
network_loadbalancer_id: 'network_loadbalancer_id',
|
99
|
+
flowlog_id: flowlog.id,
|
100
|
+
yes: true,
|
101
|
+
}
|
102
|
+
|
103
|
+
subject_config.each { |key, value| subject.config[key] = value }
|
104
|
+
|
105
|
+
expect(subject).to receive(:puts).with("ID: #{flowlog.id}")
|
106
|
+
expect(subject).to receive(:puts).with("Name: #{flowlog.properties.name}")
|
107
|
+
expect(subject).to receive(:puts).with("Action: #{flowlog.properties.action}")
|
108
|
+
expect(subject).to receive(:puts).with("Direction: #{flowlog.properties.direction}")
|
109
|
+
expect(subject).to receive(:puts).with("Bucket: #{flowlog.properties.bucket}")
|
110
|
+
|
111
|
+
expect(subject.api_client).not_to receive(:wait_for)
|
112
|
+
mock_call_api(
|
113
|
+
subject,
|
114
|
+
[
|
115
|
+
{
|
116
|
+
method: 'GET',
|
117
|
+
path: "/datacenters/#{subject_config[:datacenter_id]}/networkloadbalancers/#{subject_config[:network_loadbalancer_id]}/flowlogs/#{flowlog.id}",
|
118
|
+
operation: :'NetworkLoadBalancersApi.datacenters_networkloadbalancers_flowlogs_find_by_flow_log_id',
|
119
|
+
return_type: 'FlowLog',
|
120
|
+
result: flowlog,
|
121
|
+
},
|
122
|
+
],
|
123
|
+
)
|
124
|
+
|
125
|
+
expect { subject.run }.not_to raise_error(Exception)
|
126
|
+
end
|
127
|
+
|
128
|
+
it 'should not call anything when the wrong type is given' do
|
129
|
+
flowlog = flowlog_mock
|
130
|
+
subject_config = {
|
131
|
+
ionoscloud_username: 'email',
|
132
|
+
ionoscloud_password: 'password',
|
133
|
+
datacenter_id: 'datacenter_id',
|
134
|
+
server_id: 'server_id',
|
135
|
+
natgateway_id: 'natgateway_id',
|
136
|
+
network_loadbalancer_id: 'network_loadbalancer_id',
|
137
|
+
flowlog_id: 'flowlog_id',
|
138
|
+
nic_id: 'nic_id',
|
139
|
+
type: 'other',
|
140
|
+
}
|
141
|
+
|
142
|
+
subject_config.each { |key, value| subject.config[key] = value }
|
143
|
+
|
144
|
+
expect(subject.ui).to receive(:error).with("Flow Log cannot belong to #{subject_config[:type]}. Value must be one of ['nic', 'natgateway', 'networkloadbalancer']")
|
145
|
+
|
146
|
+
expect(subject.api_client).not_to receive(:call_api)
|
147
|
+
|
148
|
+
expect { subject.run }.to raise_error(SystemExit) do |error|
|
149
|
+
expect(error.status).to eq(1)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
it 'should not make any call if any required option is missing' do
|
154
|
+
required_options = subject.instance_variable_get(:@required_options)
|
155
|
+
|
156
|
+
arrays_without_one_element(required_options).each do |test_case|
|
157
|
+
|
158
|
+
test_case[:array].each { |value| subject.config[value] = 'test' }
|
159
|
+
|
160
|
+
expect(subject).to receive(:puts).with("Missing required parameters #{test_case[:removed]}")
|
161
|
+
expect(subject.api_client).not_to receive(:call_api)
|
162
|
+
|
163
|
+
expect { subject.run }.to raise_error(SystemExit) do |error|
|
164
|
+
expect(error.status).to eq(1)
|
165
|
+
end
|
166
|
+
|
167
|
+
required_options.each { |value| subject.config[value] = nil }
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
@@ -155,7 +155,7 @@ describe Chef::Knife::IonoscloudFlowlogList do
|
|
155
155
|
ionoscloud_password: 'password',
|
156
156
|
datacenter_id: 'datacenter_id',
|
157
157
|
network_loadbalancer_id: 'network_loadbalancer_id',
|
158
|
-
type: '
|
158
|
+
type: 'networkloadbalancer',
|
159
159
|
}
|
160
160
|
|
161
161
|
subject_config.each { |key, value| subject.config[key] = value }
|
@@ -200,7 +200,7 @@ describe Chef::Knife::IonoscloudFlowlogList do
|
|
200
200
|
ionoscloud_username: 'email',
|
201
201
|
ionoscloud_password: 'password',
|
202
202
|
datacenter_id: 'datacenter_id',
|
203
|
-
type: '
|
203
|
+
type: 'networkloadbalancer',
|
204
204
|
}
|
205
205
|
|
206
206
|
subject_config.each { |key, value| subject.config[key] = value }
|
@@ -234,7 +234,7 @@ describe Chef::Knife::IonoscloudFlowlogList do
|
|
234
234
|
|
235
235
|
subject_config.each { |key, value| subject.config[key] = value }
|
236
236
|
|
237
|
-
expect(subject.ui).to receive(:error).with("Flow log cannot belong to #{subject_config[:type]}. Value must be one of ['nic', 'natgateway', '
|
237
|
+
expect(subject.ui).to receive(:error).with("Flow log cannot belong to #{subject_config[:type]}. Value must be one of ['nic', 'natgateway', 'networkloadbalancer']")
|
238
238
|
|
239
239
|
expect(subject.api_client).not_to receive(:call_api)
|
240
240
|
|
@@ -0,0 +1,244 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ionoscloud_flowlog_update'
|
3
|
+
|
4
|
+
Chef::Knife::IonoscloudFlowlogUpdate.load_deps
|
5
|
+
|
6
|
+
describe Chef::Knife::IonoscloudFlowlogUpdate do
|
7
|
+
before :each do
|
8
|
+
subject { Chef::Knife::IonoscloudFlowlogUpdate.new }
|
9
|
+
|
10
|
+
allow(subject).to receive(:puts)
|
11
|
+
allow(subject).to receive(:print)
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#run' do
|
15
|
+
it 'should call FlowLogsApi.datacenters_servers_nics_flowlogs_patch' do
|
16
|
+
flowlog = flowlog_mock
|
17
|
+
subject_config = {
|
18
|
+
ionoscloud_username: 'email',
|
19
|
+
ionoscloud_password: 'password',
|
20
|
+
type: 'nic',
|
21
|
+
datacenter_id: 'datacenter_id',
|
22
|
+
server_id: 'server_id',
|
23
|
+
nic_id: 'nic_id',
|
24
|
+
flowlog_id: flowlog.id,
|
25
|
+
name: flowlog.properties.name + '_edited',
|
26
|
+
action: 'REJECTED',
|
27
|
+
direction: 'BIDIRECTIONAL',
|
28
|
+
bucket: 'new_bucket_name',
|
29
|
+
yes: true,
|
30
|
+
}
|
31
|
+
|
32
|
+
subject_config.each { |key, value| subject.config[key] = value }
|
33
|
+
|
34
|
+
expect(subject).to receive(:puts).with("ID: #{flowlog.id}")
|
35
|
+
expect(subject).to receive(:puts).with("Name: #{subject_config[:name]}")
|
36
|
+
expect(subject).to receive(:puts).with("Action: #{subject_config[:action]}")
|
37
|
+
expect(subject).to receive(:puts).with("Direction: #{subject_config[:direction]}")
|
38
|
+
expect(subject).to receive(:puts).with("Bucket: #{subject_config[:bucket]}")
|
39
|
+
|
40
|
+
flowlog.properties.name = subject_config[:name]
|
41
|
+
flowlog.properties.action = subject_config[:action]
|
42
|
+
flowlog.properties.direction = subject_config[:direction]
|
43
|
+
flowlog.properties.bucket = subject_config[:bucket]
|
44
|
+
|
45
|
+
expected_body = {
|
46
|
+
name: subject_config[:name],
|
47
|
+
action: subject_config[:action],
|
48
|
+
direction: subject_config[:direction],
|
49
|
+
bucket: subject_config[:bucket],
|
50
|
+
}
|
51
|
+
|
52
|
+
mock_wait_for(subject)
|
53
|
+
mock_call_api(
|
54
|
+
subject,
|
55
|
+
[
|
56
|
+
{
|
57
|
+
method: 'PATCH',
|
58
|
+
path: "/datacenters/#{subject_config[:datacenter_id]}/servers/#{subject_config[:server_id]}/"\
|
59
|
+
"nics/#{subject_config[:nic_id]}/flowlogs/#{flowlog.id}",
|
60
|
+
operation: :'FlowLogsApi.datacenters_servers_nics_flowlogs_patch',
|
61
|
+
return_type: 'FlowLog',
|
62
|
+
body: expected_body,
|
63
|
+
result: flowlog,
|
64
|
+
},
|
65
|
+
{
|
66
|
+
method: 'GET',
|
67
|
+
path: "/datacenters/#{subject_config[:datacenter_id]}/servers/#{subject_config[:server_id]}/"\
|
68
|
+
"nics/#{subject_config[:nic_id]}/flowlogs/#{flowlog.id}",
|
69
|
+
operation: :'FlowLogsApi.datacenters_servers_nics_flowlogs_find_by_id',
|
70
|
+
return_type: 'FlowLog',
|
71
|
+
result: flowlog,
|
72
|
+
},
|
73
|
+
],
|
74
|
+
)
|
75
|
+
|
76
|
+
expect { subject.run }.not_to raise_error(Exception)
|
77
|
+
end
|
78
|
+
|
79
|
+
it 'should call NATGatewaysApi.datacenters_natgateways_flowlogs_patch' do
|
80
|
+
flowlog = flowlog_mock
|
81
|
+
subject_config = {
|
82
|
+
ionoscloud_username: 'email',
|
83
|
+
ionoscloud_password: 'password',
|
84
|
+
type: 'natgateway',
|
85
|
+
datacenter_id: 'datacenter_id',
|
86
|
+
natgateway_id: 'natgateway_id',
|
87
|
+
flowlog_id: flowlog.id,
|
88
|
+
name: flowlog.properties.name + '_edited',
|
89
|
+
action: 'REJECTED',
|
90
|
+
direction: 'BIDIRECTIONAL',
|
91
|
+
bucket: 'new_bucket_name',
|
92
|
+
yes: true,
|
93
|
+
}
|
94
|
+
|
95
|
+
subject_config.each { |key, value| subject.config[key] = value }
|
96
|
+
|
97
|
+
expect(subject).to receive(:puts).with("ID: #{flowlog.id}")
|
98
|
+
expect(subject).to receive(:puts).with("Name: #{subject_config[:name]}")
|
99
|
+
expect(subject).to receive(:puts).with("Action: #{subject_config[:action]}")
|
100
|
+
expect(subject).to receive(:puts).with("Direction: #{subject_config[:direction]}")
|
101
|
+
expect(subject).to receive(:puts).with("Bucket: #{subject_config[:bucket]}")
|
102
|
+
|
103
|
+
flowlog.properties.name = subject_config[:name]
|
104
|
+
flowlog.properties.action = subject_config[:action]
|
105
|
+
flowlog.properties.direction = subject_config[:direction]
|
106
|
+
flowlog.properties.bucket = subject_config[:bucket]
|
107
|
+
|
108
|
+
expected_body = {
|
109
|
+
name: subject_config[:name],
|
110
|
+
action: subject_config[:action],
|
111
|
+
direction: subject_config[:direction],
|
112
|
+
bucket: subject_config[:bucket],
|
113
|
+
}
|
114
|
+
|
115
|
+
mock_wait_for(subject)
|
116
|
+
mock_call_api(
|
117
|
+
subject,
|
118
|
+
[
|
119
|
+
{
|
120
|
+
method: 'PATCH',
|
121
|
+
path: "/datacenters/#{subject_config[:datacenter_id]}/natgateways/#{subject_config[:natgateway_id]}/flowlogs/#{flowlog.id}",
|
122
|
+
operation: :'NATGatewaysApi.datacenters_natgateways_flowlogs_patch',
|
123
|
+
return_type: 'FlowLog',
|
124
|
+
body: expected_body,
|
125
|
+
result: flowlog,
|
126
|
+
},
|
127
|
+
{
|
128
|
+
method: 'GET',
|
129
|
+
path: "/datacenters/#{subject_config[:datacenter_id]}/natgateways/#{subject_config[:natgateway_id]}/flowlogs/#{flowlog.id}",
|
130
|
+
operation: :'NATGatewaysApi.datacenters_natgateways_flowlogs_find_by_flow_log_id',
|
131
|
+
return_type: 'FlowLog',
|
132
|
+
result: flowlog,
|
133
|
+
},
|
134
|
+
],
|
135
|
+
)
|
136
|
+
|
137
|
+
expect { subject.run }.not_to raise_error(Exception)
|
138
|
+
end
|
139
|
+
|
140
|
+
it 'should call NetworkLoadBalancersApi.datacenters_networkloadbalancers_flowlogs_patch' do
|
141
|
+
flowlog = flowlog_mock
|
142
|
+
subject_config = {
|
143
|
+
ionoscloud_username: 'email',
|
144
|
+
ionoscloud_password: 'password',
|
145
|
+
type: 'networkloadbalancer',
|
146
|
+
datacenter_id: 'datacenter_id',
|
147
|
+
network_loadbalancer_id: 'network_loadbalancer_id',
|
148
|
+
flowlog_id: flowlog.id,
|
149
|
+
name: flowlog.properties.name + '_edited',
|
150
|
+
action: 'REJECTED',
|
151
|
+
direction: 'BIDIRECTIONAL',
|
152
|
+
bucket: 'new_bucket_name',
|
153
|
+
yes: true,
|
154
|
+
}
|
155
|
+
|
156
|
+
subject_config.each { |key, value| subject.config[key] = value }
|
157
|
+
|
158
|
+
expect(subject).to receive(:puts).with("ID: #{flowlog.id}")
|
159
|
+
expect(subject).to receive(:puts).with("Name: #{subject_config[:name]}")
|
160
|
+
expect(subject).to receive(:puts).with("Action: #{subject_config[:action]}")
|
161
|
+
expect(subject).to receive(:puts).with("Direction: #{subject_config[:direction]}")
|
162
|
+
expect(subject).to receive(:puts).with("Bucket: #{subject_config[:bucket]}")
|
163
|
+
|
164
|
+
flowlog.properties.name = subject_config[:name]
|
165
|
+
flowlog.properties.action = subject_config[:action]
|
166
|
+
flowlog.properties.direction = subject_config[:direction]
|
167
|
+
flowlog.properties.bucket = subject_config[:bucket]
|
168
|
+
|
169
|
+
expected_body = {
|
170
|
+
name: subject_config[:name],
|
171
|
+
action: subject_config[:action],
|
172
|
+
direction: subject_config[:direction],
|
173
|
+
bucket: subject_config[:bucket],
|
174
|
+
}
|
175
|
+
|
176
|
+
mock_wait_for(subject)
|
177
|
+
mock_call_api(
|
178
|
+
subject,
|
179
|
+
[
|
180
|
+
{
|
181
|
+
method: 'PATCH',
|
182
|
+
path: "/datacenters/#{subject_config[:datacenter_id]}/networkloadbalancers/#{subject_config[:network_loadbalancer_id]}/flowlogs/#{flowlog.id}",
|
183
|
+
operation: :'NetworkLoadBalancersApi.datacenters_networkloadbalancers_flowlogs_patch',
|
184
|
+
return_type: 'FlowLog',
|
185
|
+
body: expected_body,
|
186
|
+
result: flowlog,
|
187
|
+
},
|
188
|
+
{
|
189
|
+
method: 'GET',
|
190
|
+
path: "/datacenters/#{subject_config[:datacenter_id]}/networkloadbalancers/#{subject_config[:network_loadbalancer_id]}/flowlogs/#{flowlog.id}",
|
191
|
+
operation: :'NetworkLoadBalancersApi.datacenters_networkloadbalancers_flowlogs_find_by_flow_log_id',
|
192
|
+
return_type: 'FlowLog',
|
193
|
+
result: flowlog,
|
194
|
+
},
|
195
|
+
],
|
196
|
+
)
|
197
|
+
|
198
|
+
expect { subject.run }.not_to raise_error(Exception)
|
199
|
+
end
|
200
|
+
|
201
|
+
it 'should not call anything when the wrong type is given' do
|
202
|
+
flowlog = flowlog_mock
|
203
|
+
subject_config = {
|
204
|
+
ionoscloud_username: 'email',
|
205
|
+
ionoscloud_password: 'password',
|
206
|
+
datacenter_id: 'datacenter_id',
|
207
|
+
server_id: 'server_id',
|
208
|
+
natgateway_id: 'natgateway_id',
|
209
|
+
network_loadbalancer_id: 'network_loadbalancer_id',
|
210
|
+
flowlog_id: 'flowlog_id',
|
211
|
+
nic_id: 'nic_id',
|
212
|
+
type: 'other',
|
213
|
+
}
|
214
|
+
|
215
|
+
subject_config.each { |key, value| subject.config[key] = value }
|
216
|
+
|
217
|
+
expect(subject.ui).to receive(:error).with("Flow Log cannot belong to #{subject_config[:type]}. Value must be one of ['nic', 'natgateway', 'networkloadbalancer']")
|
218
|
+
|
219
|
+
expect(subject.api_client).not_to receive(:call_api)
|
220
|
+
|
221
|
+
expect { subject.run }.to raise_error(SystemExit) do |error|
|
222
|
+
expect(error.status).to eq(1)
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
it 'should not make any call if any required option is missing' do
|
227
|
+
required_options = subject.instance_variable_get(:@required_options)
|
228
|
+
|
229
|
+
arrays_without_one_element(required_options).each do |test_case|
|
230
|
+
|
231
|
+
test_case[:array].each { |value| subject.config[value] = 'test' }
|
232
|
+
|
233
|
+
expect(subject).to receive(:puts).with("Missing required parameters #{test_case[:removed]}")
|
234
|
+
expect(subject.api_client).not_to receive(:call_api)
|
235
|
+
|
236
|
+
expect { subject.run }.to raise_error(SystemExit) do |error|
|
237
|
+
expect(error.status).to eq(1)
|
238
|
+
end
|
239
|
+
|
240
|
+
required_options.each { |value| subject.config[value] = nil }
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|