Sha256: 1866717ea1b072c21ab09045ad55afa98962aae82920a82e12dd56b4eac3d5f5

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

require_relative 'ionoscloud_base'

class Chef
  class Knife
    class IonoscloudDbaasPostgresClusterGet < Knife
      include Knife::IonoscloudBase

      banner 'knife ionoscloud dbaas postgres cluster get (options)'

      option :cluster_id,
              short: '-C CLUSTER_ID',
              long: '--cluster-id CLUSTER_ID',
              description: 'ID of the cluster'

      def initialize(args = [])
        super(args)
        @description =
        'You can retrieve a PostgreSQL cluster by using its ID. This value can be '\
        'found in the response body when a PostgreSQL cluster is created or when '\
        'you GET a list of PostgreSQL clusters.'
        @directory = 'dbaas-postgres'
        @required_options = [:cluster_id, :ionoscloud_username, :ionoscloud_password]
      end

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

        print_cluster(IonoscloudDbaasPostgres::ClustersApi.new(api_client_dbaas).clusters_find_by_id(config[:cluster_id]))
      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_dbaas_postgres_cluster_get.rb