Sha256: f195bdfd1931d3ad856c5bcf6d3541eedaf08a024f5d2a98146d2285e59a345b

Contents?: true

Size: 876 Bytes

Versions: 2

Compression:

Stored size: 876 Bytes

Contents

require_relative 'ionoscloud_base'

class Chef
  class Knife
    class IonoscloudIpblockGet < Knife
      include Knife::IonoscloudBase

      banner 'knife ionoscloud ipblock get (options)'

      option :ipblock_id,
              short: '-I IPBLOCK_ID',
              long: '--ipblock-id IPBLOCK_ID',
              description: 'ID of the IPBlock.'

      def initialize(args = [])
        super(args)
        @description =
        'Retrieves information about an IP Block.'
        @directory = 'compute-engine'
        @required_options = [:ipblock_id, :ionoscloud_username, :ionoscloud_password]
      end

      def run
        $stdout.sync = true
        handle_extra_config
        validate_required_params(@required_options, config)

        print_ipblock(Ionoscloud::IPBlocksApi.new(api_client).ipblocks_find_by_id(config[:ipblock_id]))
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
knife-ionoscloud-6.1.1 lib/chef/knife/ionoscloud_ipblock_get.rb
knife-ionoscloud-6.1.0 lib/chef/knife/ionoscloud_ipblock_get.rb