Sha256: 21c6158c54fcf2110eb64f1ad5de9f31155e46a13d9f049ade3b1f6175ebaa4d

Contents?: true

Size: 1.45 KB

Versions: 42

Compression:

Stored size: 1.45 KB

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

require 'pathname'
require 'json'
require 'tty-spinner'

require_relative '../shared'
require_relative '../../commands/project'

module GoodData
  module CLI
    desc 'Manage your project'
    arg_name 'project_command'

    command :project do |c|
      c.desc 'Shows users in project'
      c.command :users do |users|
        users.action do |global_options, options, _args|
          opts = options.merge(global_options)
          spinner = TTY::Spinner.new ":spinner Listing users"
          spinner.auto_spin
          res = GoodData::Command::Project.list_users(opts)
          spinner.stop
          res
        end
      end

      c.desc 'Create new project'
      c.command :create do |create|
        create.action do |global_options, options, _args|
          opts = options.merge(global_options)
          token = opts[:token]
          title = opts[:title] || 'New project'
          driver = opts[:driver] || 'Pg'
          spinner = TTY::Spinner.new ":spinner Creating project"
          spinner.auto_spin
          client = GoodData.connect(opts)
          res = GoodData::Command::Project.create(token: token, title: title, driver: driver, client: client)
          spinner.stop
          puts res.to_json
        end
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
gooddata-2.3.1-java lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.3.1 lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.3.0-java lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.3.0 lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.2.0-java lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.2.0 lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.1.19-java lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.1.19 lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.1.17-java lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.1.17 lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.1.15-java lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.1.15 lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.1.14-java lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.1.14 lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.1.13-java lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.1.13 lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.1.12-java lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.1.12 lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.1.11-java lib/gooddata/cli/commands/project_cmd.rb
gooddata-2.1.11 lib/gooddata/cli/commands/project_cmd.rb