Sha256: 2bf5b7f25d991d2aa638a132312760ff1bbc6b9bf2e492237502b080f6ead2e7
Contents?: true
Size: 1.27 KB
Versions: 1
Compression:
Stored size: 1.27 KB
Contents
require_relative 'ionoscloud_base' class Chef class Knife class IonoscloudPccDelete < Knife include Knife::IonoscloudBase banner 'knife ionoscloud pcc delete PCC_ID [PCC_ID]' def initialize(args = []) super(args) @description = 'Deletes a Private Cross-Connect.' @directory = 'compute-engine' @required_options = [:ionoscloud_username, :ionoscloud_password] end def run $stdout.sync = true handle_extra_config validate_required_params(@required_options, config) pcc_api = Ionoscloud::PrivateCrossConnectsApi.new(api_client) @name_args.each do |pcc_id| begin pcc = pcc_api.pccs_find_by_id(pcc_id) rescue Ionoscloud::ApiError => err raise err unless err.code == 404 ui.error("PCC ID #{pcc_id} not found. Skipping.") next end print_pcc(pcc) puts "\n" begin confirm('Do you really want to delete this PCC') rescue SystemExit next end _, _, headers = pcc_api.pccs_delete_with_http_info(pcc_id) ui.warn("Deleted PCC #{pcc.id}. Request ID: #{get_request_id headers}") end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
knife-ionoscloud-6.1.1 | lib/chef/knife/ionoscloud_pcc_delete.rb |