Sha256: 77b6798c2b0357a196ffdb2ae8eed8c72f6035e43c80d19dacdeb2151194abab

Contents?: true

Size: 250 Bytes

Versions: 8

Compression:

Stored size: 250 Bytes

Contents

# frozen_string_literal: true

class ControlplaneApiCli
  def call(url, method:)
    response = `cpln rest #{method} #{url} -o json`
    raise(response) unless $?.success? # rubocop:disable Style/SpecialGlobalVars

    JSON.parse(response)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cpl-0.4.1 lib/core/controlplane_api_cli.rb
cpl-0.4.0 lib/core/controlplane_api_cli.rb
cpl-0.3.3 lib/core/controlplane_api_cli.rb
cpl-0.3.2 lib/core/controlplane_api_cli.rb
cpl-0.3.1 lib/core/controlplane_api_cli.rb
cpl-0.3.0 lib/core/controlplane_api_cli.rb
cpl-0.2.0 lib/core/controlplane_api_cli.rb
cpl-0.1.0 lib/core/controlplane_api_cli.rb