Sha256: 2e399460d645b551ff169451e6f61d3d3c330280434d71b2b482ecec0cb5516f

Contents?: true

Size: 932 Bytes

Versions: 42

Compression:

Stored size: 932 Bytes

Contents

# Copyright (c) 2010-2019 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_relative '../shared'
require_relative '../../commands/api'

require 'json'
require 'tty-spinner'

module GoodData
  module CLI
    desc 'Make any requests to the gooddata api'
    command :api do |c|
      %i[get delete post].map do |http_method|
        c.desc "Make a #{http_method} request"
        c.command http_method do |method|
          method.action do |global_options, options, args|
            opts = options.merge(global_options)
            spinner = TTY::Spinner.new ":spinner Calling GoodData API"
            spinner.auto_spin
            res = GoodData::Command::Api.send(http_method, args, opts)
            spinner.stop
            puts res.to_json
          end
        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/api_cmd.rb
gooddata-2.3.1 lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.3.0-java lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.3.0 lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.2.0-java lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.2.0 lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.1.19-java lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.1.19 lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.1.17-java lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.1.17 lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.1.15-java lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.1.15 lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.1.14-java lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.1.14 lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.1.13-java lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.1.13 lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.1.12-java lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.1.12 lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.1.11-java lib/gooddata/cli/commands/api_cmd.rb
gooddata-2.1.11 lib/gooddata/cli/commands/api_cmd.rb