Sha256: 6e1e63551c082e1909e7a5c9620a8df96aeb0a82f55153c5575824f76238b793

Contents?: true

Size: 1.21 KB

Versions: 2

Compression:

Stored size: 1.21 KB

Contents

require_relative 'ionoscloud_base'

class Chef
  class Knife
    class IonoscloudNatgatewayGet < Knife
      include Knife::IonoscloudBase

      banner 'knife ionoscloud natgateway get (options)'

      option :datacenter_id,
              short: '-D DATACENTER_ID',
              long: '--datacenter-id DATACENTER_ID',
              description: 'Name of the data center'

      option :natgateway_id,
              short: '-G NATGATEWAY_ID',
              long: '--natgateway-id NATGATEWAY_ID',
              description: 'ID of the NAT Gateway'

      def initialize(args = [])
        super(args)
        @description =
        'Retrieves the attributes of a given NAT Gateway.'
        @directory = 'compute-engine'
        @required_options = [:datacenter_id, :natgateway_id, :ionoscloud_username, :ionoscloud_password]
      end

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

        natgateways_api = Ionoscloud::NATGatewaysApi.new(api_client)

        print_natgateway(
          natgateways_api.datacenters_natgateways_find_by_nat_gateway_id(config[:datacenter_id], config[:natgateway_id], depth: 2),
        )
      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_natgateway_get.rb
knife-ionoscloud-6.1.0 lib/chef/knife/ionoscloud_natgateway_get.rb