module GoodData
GoodData
Module
Copyright © 2010-2022 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.
Copyright © 2010-2018 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.
rubocop:disable Style/ClassVars
Copyright © 2010-2018 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.
Copyright © 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.
Define GoodData::CLI
as GLI Wrapper
Define GoodData::CLI
as GLI Wrapper
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 2010-2021 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Migrate date dimension urn:gooddata:date or urn:custom:date to urn:custom_v2:date
Copyright © 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.
Copyright © 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.
© 2019-2022 GoodData
Corporation
Copyright © 2010-2018 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
See gist.github.com/ubermajestix/3644301
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 2010-2021 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 2010-2018 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 2010-2021 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.
Copyright © 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.
Copyright © 2022 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.
Copyright © 2010-2021 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.
GoodData
Module
Copyright © 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.
Copyright © 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.
Module containing classes that counter-part GoodData
server-side meta-data elements, including the server-side data model.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
Copyright © 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.
GoodData
Module
GoodData
Module
Constants
- BRICKS_VERSION
- DEFAULT_LOGGER_CLASS
- DEFAULT_LOG_LEVEL
- DEFAULT_LOG_OUTPUT
- DEFAULT_RESTLOGGER_CLASS
- DEFAULT_RESTLOG_LEVEL
- DEFAULT_RESTLOG_OUTPUT
- DEFAULT_SPLUNKLOG_LEVEL
- DEFAULT_SPLUNKLOG_OUTPUT
- DEFAULT_SSO_OPTIONS
- DisplayForm
- VERSION
Attributes
Public Class Methods
Source
# File lib/gooddata/version.rb, line 23 def bricks_version BRICKS_VERSION end
LCM
bricks version @return brick version
Source
# File lib/gooddata/connection.rb, line 36 def connect(options = nil, second_options = nil, third_options = {}) Rest::Client.connect(options, second_options, third_options) end
Connect to the GoodData
API
@param options @param second_options @param third_options
Source
# File lib/gooddata/connection.rb, line 118 def connect_sso(login, provider, url = GoodData::Rest::Connection::DEFAULT_URL, opts = {}) url, params = sso_url(login, provider, url) RestClient::Request.execute(opts.merge(method: :post, url: url, payload: params)) do |response, _request, _result| return Rest::Client.connect_sso( opts.merge( headers: { x_gdc_authsst: response.cookies['GDCAuthSST'], x_gdc_authtt: response.cookies['GDCAuthTT'] } ) ) end end
Connect to GoodData
using SSO
This SSO implementation is custom implementation provided by GoodData
that allows your application to sign in an existing GoodData
user. The authentication is done not by username and password but by generating a session specific token using pair of PGP keys.
@see developer.gooddata.com/article/single-sign-on
@param [String] login Email address used for logging into gooddata @param [String] provider Name of SSO provider @return [GoodData::Rest::Client] Instance of REST client
Source
# File lib/gooddata/connection.rb, line 23 def connection # TODO: Remove this after successful rest-factory transition Rest::Client.connection # || fail('Please authenticate with GoodData.connect first') end
Returns the active GoodData
connection earlier initialized via GoodData.connect
call
@see GoodData.connect
Source
# File lib/gooddata/core/rest.rb, line 65 def delete(path, options = {}) connection.delete path, options end
Performs a HTTP DELETE request.
Retuns the JSON response formatted as a Hash object.
@param path The HTTP path on the GoodData
server (must be prefixed with a forward slash)
### Examples
GoodData.delete '/gdc/project/1'
Source
# File lib/gooddata/connection.rb, line 41 def disconnect Rest::Client.disconnect end
Disconnect (logout) if logged in
Source
# File lib/gooddata/core/rest.rb, line 92 def download_from_project_webdav(file, where, options = {}) options = merge_options(options) url = project_webdav_path(options) connection.download(file, where, options.merge(:staging_url => url)) end
Download from project directory
Source
# File lib/gooddata/core/rest.rb, line 106 def download_from_user_webdav(file, where, options = {}) url = user_webdav_path({ :client => GoodData.client }.merge(options)) connection.download(file, where, options.merge(:staging_url => url)) end
Download from user directory
Source
# File lib/gooddata/version.rb, line 29 def gem_version_string "gooddata-gem/#{VERSION}/#{RUBY_PLATFORM}/#{RUBY_VERSION}" end
Identifier of gem version @return Formatted gem version
Source
# File lib/gooddata/core/rest.rb, line 19 def get(path, options = {}) connection.get(path, options) end
Performs a HTTP GET request.
Retuns the JSON response formatted as a Hash object.
@param path The HTTP path on the GoodData
server (must be prefixed with a forward slash)
### Examples
GoodData.get '/gdc/projects'
Source
# File lib/gooddata/helpers/global_helpers.rb, line 288 def get_client(opts) client = opts[:client] fail ArgumentError, 'No :client specified' if client.nil? client end
Source
# File lib/gooddata/helpers/global_helpers.rb, line 295 def get_client_and_project(opts) client = opts[:client] fail ArgumentError, 'No :client specified' if client.nil? p = opts[:project] fail ArgumentError, 'No :project specified' if p.nil? project = GoodData::Project[p, opts] fail ArgumentError, 'Wrong :project specified' if project.nil? [client, project] end
Source
# File lib/gooddata/client.rb, line 46 def init_module # Metadata packages, such as report.rb, require this to be loaded first require_relative 'models/metadata.rb' # Load models from models folder Dir[File.dirname(__FILE__) + '/models/*.rb'].each { |file| require file } # Load collections Dir[File.dirname(__FILE__) + '/collections/*.rb'].each { |file| require file } end
Initializes required dynamically loaded classes
Source
# File lib/gooddata/core/logging.rb, line 62 def logging_http_off @rest_logger = NilLogger.new end
Source
# File lib/gooddata/core/logging.rb, line 56 def logging_http_on(level = DEFAULT_RESTLOG_LEVEL, output = DEFAULT_RESTLOG_OUTPUT, klass = DEFAULT_RESTLOGGER_CLASS) @rest_logger = klass.new(output) @rest_logger.level = level @rest_logger end
Source
# File lib/gooddata/core/logging.rb, line 66 def logging_http_on? !@rest_logger.instance_of?(NilLogger) end
Source
# File lib/gooddata/core/logging.rb, line 48 def logging_off @logger = NilLogger.new end
Source
# File lib/gooddata/core/logging.rb, line 42 def logging_on(level = DEFAULT_LOG_LEVEL, output = DEFAULT_LOG_OUTPUT, klass = DEFAULT_LOGGER_CLASS) @logger = klass.new(output) @logger.level = level @logger end
Turn logging on
### Example
# Turn of default logging GoodData.logging_on # Log only WARN and higher GoodData.logging_on(Logger::WARN) # Log DEBUG and above to file GoodData.logging_on(Logger::DEBUG, 'log.txt')
Source
# File lib/gooddata/core/logging.rb, line 52 def logging_on? !@logger.instance_of?(NilLogger) end
Source
# File lib/gooddata/core/rest.rb, line 120 def poll_on_code(link, options = {}) client = options[:client] fail ArgumentError, 'No :client specified' if client.nil? client.poll_on_code(link, options) end
Generalizaton of poller. Since we have quite a variation of how async proceses are handled this is a helper that should help you with resources where the information about “Are we done” is the http code of response. By default we repeat as long as the code == 202. You can change the code if necessary. It expects the URI as an input where it can poll. It returns the value of last poll. In majority of cases these are the data that you need.
@param link [String] Link for polling @param options [Hash] Options @return [Hash] Result of polling
Source
# File lib/gooddata/core/rest.rb, line 135 def poll_on_response(link, options = {}, &bl) client = options[:client] fail ArgumentError, 'No :client specified' if client.nil? client.poll_on_response(link, options, &bl) end
Generalizaton of poller. Since we have quite a variation of how async proceses are handled this is a helper that should help you with resources where the information about “Are we done” is inside the response. It expects the URI as an input where it can poll and a block that should return either false -> ‘meaning we are done’ or true -> meaning sleep and repeat. It returns the value of last poll. In majority of cases these are the data that you need
@param link [String] Link for polling @param options [Hash] Options @return [Hash] Result of polling
Source
# File lib/gooddata/core/rest.rb, line 34 def post(path, data = {}, options = {}) connection.post path, data, options end
Performs a HTTP POST request.
Retuns the JSON response formatted as a Hash object.
@param path The HTTP path on the GoodData
server (must be prefixed with a forward slash) @param data The payload data in the format of a Hash object
### Examples
client.post '/gdc/projects', { ... }
Source
# File lib/gooddata/core/project.rb, line 31 def project=(project, opts = { :client => GoodData.connection }) if project.is_a? Project @project = project elsif project.nil? @project = nil else @project = Project[project, opts] end @project end
Sets the active project
@param project A project identifier
### Examples
The following calls are equivalent
# Assign project ID GoodData.project = 'afawtv356b6usdfsdf34vt' # Use project ID GoodData.use 'afawtv356b6usdfsdf34vt' # Use project URL GoodData.use '/gdc/projects/afawtv356b6usdfsdf34vt' # Select project using indexer on GoodData::Project class GoodData.project = Project['afawtv356b6usdfsdf34vt']
Assigns global/default GoodData
project
Source
# File lib/gooddata/core/rest.rb, line 78 def project_webdav_path(options = {}) options = merge_options(options) project = options[:project] project.project_webdav_path end
Get WebDav directory for project data @return [String]
Source
# File lib/gooddata/core/rest.rb, line 51 def put(path, data, options = {}) connection.put path, data, options end
Performs a HTTP PUT request.
Retuns the JSON response formatted as a Hash object.
### Parameters
@param path The HTTP path on the GoodData
server (must be prefixed with a forward slash) @param data The payload data in the format of a Hash object
### Examples
client.put '/gdc/projects', { ... }
Source
# File lib/gooddata/client.rb, line 59 def release_info fail 'The release info endpoint has been deprecated without a replacement.' end
Returns information about the GoodData
API as a Hash (e.g. version, release time etc.) @deprecated The release info endpoint has been deprecated without a replacement.
Source
# File lib/gooddata/core/logging.rb, line 74 def splunk_logging_off gd_logger.logging_off :splunk end
Source
# File lib/gooddata/core/logging.rb, line 70 def splunk_logging_on(logger) gd_logger.logging_on :splunk, logger end
Source
# File lib/gooddata/core/logging.rb, line 78 def splunk_logging_on? gd_logger.logging_on? :splunk end
Source
# File lib/gooddata/connection.rb, line 66 def sso_url(login, provider, url, opts = DEFAULT_SSO_OPTIONS) opts = DEFAULT_SSO_OPTIONS.merge(opts) ts = DateTime.now.strftime('%s').to_i + opts[:valid] obj = { 'email' => login, 'validity' => ts } json_data = JSON.pretty_generate(obj) + "\n" file_json = Tempfile.new('gooddata-sso-json') file_json.write(json_data) file_json.rewind file_signed = Tempfile.new('gooddata-sso-signed') cmd = "gpg --yes --no-tty --armor -u #{login} --output #{file_signed.path} --sign #{file_json.path}" res = system(cmd) fail 'Unable to sign json' unless res file_signed.rewind file_final = Tempfile.new('gooddata-sso-final') recipient = url == GoodData::Rest::Connection::DEFAULT_URL ? 'secure@gooddata.com' : 'test@gooddata.com' cmd = "gpg --yes --no-tty --trust-model always --armor --output #{file_final.path} --encrypt --recipient #{recipient} #{file_signed.path}" res = system(cmd) fail 'Unable to encrypt json' unless res file_final.rewind final = file_final.read params = { targetUrl: opts[:url], ssoProvider: provider, encryptedClaims: final } [url + '/gdc/account/customerlogin', params] end
Generates SSO URL
This SSO implementation is custom implementation provided by GoodData
that allows your application to sign in an existing GoodData
user. The authentication is done not by username and password but by generating a session specific token using pair of PGP keys.
@see developer.gooddata.com/article/single-sign-on
@param [String] login Email address used for logging into gooddata @param [String] provider Name of SSO provider @param [Hash] opts Additional options @option opts [Fixnum] :validity Validity in seconds from ‘now’ @return [String] URL which can be used for SSO logging in
Source
# File lib/gooddata/core/rest.rb, line 85 def upload_to_project_webdav(file, options = {}) options = merge_options(options) url = project_webdav_path(options) connection.upload(file, options.merge(:staging_url => url)) end
Upload to project directory
Source
# File lib/gooddata/core/rest.rb, line 71 def upload_to_user_webdav(file, options = {}) url = user_webdav_path({ :client => GoodData.client }.merge(options)) connection.upload(file, options.merge(staging_url: url)) end
Upload to user directory @return [String]
Source
# File lib/gooddata/core/user.rb, line 14 def user GoodData::Profile.current end
Gets currently logged user
@return [GoodData::Profile] User Profile
Source
# File lib/gooddata/core/rest.rb, line 100 def user_webdav_path(options = {}) client = GoodData::Rest::Object.client({ :client => GoodData.client }.merge(options)) client.user_webdav_path end
Get WebDav directory for user data @return [String]
Source
# File lib/gooddata/version.rb, line 15 def version VERSION end
SDK version @return SDK version
Source
# File lib/gooddata/connection.rb, line 45 def with_connection(options = nil, second_options = nil, third_options = {}, &block) client = connect(options, second_options, third_options) block.call(client) ensure disconnect end
Source
# File lib/gooddata/core/project.rb, line 56 def with_project(project, opts = { :client => GoodData.connection }, &bl) fail 'You have to specify a project when using with_project' if project.nil? || (project.is_a?(String) && project.empty?) fail 'You have to specify block' unless bl old_project = GoodData.project begin GoodData.use(project, opts) res = bl.call(GoodData.project) rescue RestClient::ResourceNotFound GoodData.project = old_project raise(GoodData::ProjectNotFound, 'Project was not found') end GoodData.project = old_project res end
Perform block in context of another project than currently set
@param project Project
to use @param bl Block to be performed
Private Class Methods
Source
# File lib/gooddata/core/rest.rb, line 143 def merge_options(opts) { :project => GoodData.project }.merge(opts) end