Module: GoodData
- Defined in:
- lib/gooddata.rb,
lib/gooddata/client.rb,
lib/gooddata/app/app.rb,
lib/gooddata/cli/cli.rb,
lib/gooddata/extract.rb,
lib/gooddata/lcm/lcm.rb,
lib/gooddata/version.rb,
lib/gooddata/lcm/lcm2.rb,
lib/gooddata/core/rest.rb,
lib/gooddata/core/user.rb,
lib/gooddata/rest/rest.rb,
lib/gooddata/cli/shared.rb,
lib/gooddata/connection.rb,
lib/gooddata/rest/phmap.rb,
lib/gooddata_brick_base.rb,
lib/gooddata/lcm/dsl/dsl.rb,
lib/gooddata/rest/client.rb,
lib/gooddata/rest/object.rb,
lib/gooddata/bricks/brick.rb,
lib/gooddata/bricks/utils.rb,
lib/gooddata/cli/terminal.rb,
lib/gooddata/commands/api.rb,
lib/gooddata/core/logging.rb,
lib/gooddata/core/project.rb,
lib/gooddata/data/guesser.rb,
lib/gooddata/mixins/links.rb,
lib/gooddata/models/links.rb,
lib/gooddata/models/model.rb,
lib/gooddata/commands/auth.rb,
lib/gooddata/commands/base.rb,
lib/gooddata/commands/role.rb,
lib/gooddata/commands/user.rb,
lib/gooddata/mixins/author.rb,
lib/gooddata/mixins/obj_id.rb,
lib/gooddata/models/client.rb,
lib/gooddata/models/domain.rb,
lib/gooddata/rest/resource.rb,
lib/gooddata/core/gd_logger.rb,
lib/gooddata/mixins/is_fact.rb,
lib/gooddata/mixins/md_json.rb,
lib/gooddata/mixins/md_lock.rb,
lib/gooddata/mixins/to_json.rb,
lib/gooddata/models/process.rb,
lib/gooddata/models/profile.rb,
lib/gooddata/models/project.rb,
lib/gooddata/models/segment.rb,
lib/gooddata/bricks/pipeline.rb,
lib/gooddata/commands/domain.rb,
lib/gooddata/core/nil_logger.rb,
lib/gooddata/lcm/types/param.rb,
lib/gooddata/mixins/is_label.rb,
lib/gooddata/mixins/not_fact.rb,
lib/gooddata/models/metadata.rb,
lib/gooddata/models/schedule.rb,
lib/gooddata/rest/connection.rb,
lib/gooddata/commands/process.rb,
lib/gooddata/commands/project.rb,
lib/gooddata/commands/runners.rb,
lib/gooddata/lcm/actions/help.rb,
lib/gooddata/lcm/brick_logger.rb,
lib/gooddata/lcm/dsl/type_dsl.rb,
lib/gooddata/mixins/inspector.rb,
lib/gooddata/mixins/is_folder.rb,
lib/gooddata/mixins/not_group.rb,
lib/gooddata/mixins/not_label.rb,
lib/gooddata/models/execution.rb,
lib/gooddata/models/from_wire.rb,
lib/gooddata/bricks/help_brick.rb,
lib/gooddata/commands/datasets.rb,
lib/gooddata/commands/projects.rb,
lib/gooddata/commands/scaffold.rb,
lib/gooddata/mixins/md_finders.rb,
lib/gooddata/mixins/not_metric.rb,
lib/gooddata/mixins/timestamps.rb,
lib/gooddata/mixins/uri_getter.rb,
lib/gooddata/models/invitation.rb,
lib/gooddata/models/ldm_layout.rb,
lib/gooddata/models/membership.rb,
lib/gooddata/models/user_group.rb,
lib/gooddata/helpers/csv_helper.rb,
lib/gooddata/helpers/erb_helper.rb,
lib/gooddata/lcm/dsl/params_dsl.rb,
lib/gooddata/mixins/contributor.rb,
lib/gooddata/mixins/data_getter.rb,
lib/gooddata/mixins/md_grantees.rb,
lib/gooddata/mixins/meta_getter.rb,
lib/gooddata/models/data_source.rb,
lib/gooddata/models/tab_builder.rb,
lib/gooddata/goodzilla/goodzilla.rb,
lib/gooddata/helpers/data_helper.rb,
lib/gooddata/lcm/types/base_type.rb,
lib/gooddata/mixins/is_attribute.rb,
lib/gooddata/mixins/is_dimension.rb,
lib/gooddata/mixins/md_id_to_uri.rb,
lib/gooddata/mixins/md_object_id.rb,
lib/gooddata/mixins/md_relations.rb,
lib/gooddata/mixins/rest_getters.rb,
lib/gooddata/models/data_product.rb,
lib/gooddata/models/project_role.rb,
lib/gooddata/models/subscription.rb,
lib/gooddata/rest/object_factory.rb,
lib/gooddata/bricks/base_pipeline.rb,
lib/gooddata/cli/commands/api_cmd.rb,
lib/gooddata/helpers/auth_helpers.rb,
lib/gooddata/mixins/not_attribute.rb,
lib/gooddata/mixins/rest_resource.rb,
lib/gooddata/models/datawarehouse.rb,
lib/gooddata/models/metadata/fact.rb,
lib/gooddata/models/style_setting.rb,
lib/gooddata/rest/rest_aggregator.rb,
lib/gooddata/cli/commands/auth_cmd.rb,
lib/gooddata/helpers/crypto_helper.rb,
lib/gooddata/lcm/types/class/class.rb,
lib/gooddata/lcm/types/scalar/bool.rb,
lib/gooddata/lcm/types/scalar/hash.rb,
lib/gooddata/lcm/types/special/any.rb,
lib/gooddata/mixins/content_getter.rb,
lib/gooddata/mixins/not_exportable.rb,
lib/gooddata/models/metadata/label.rb,
lib/gooddata/bricks/base_downloader.rb,
lib/gooddata/commands/datawarehouse.rb,
lib/gooddata/helpers/global_helpers.rb,
lib/gooddata/lcm/types/special/enum.rb,
lib/gooddata/lcm/user_bricks_helper.rb,
lib/gooddata/mixins/md_object_query.rb,
lib/gooddata/mixins/root_key_getter.rb,
lib/gooddata/mixins/root_key_setter.rb,
lib/gooddata/models/dataset_mapping.rb,
lib/gooddata/models/metadata/folder.rb,
lib/gooddata/models/metadata/metric.rb,
lib/gooddata/models/metadata/report.rb,
lib/gooddata/models/project_creator.rb,
lib/gooddata/cli/commands/domain_cmd.rb,
lib/gooddata/exceptions/export_clone.rb,
lib/gooddata/exceptions/import_clone.rb,
lib/gooddata/lcm/actions/base_action.rb,
lib/gooddata/lcm/actions/hello_world.rb,
lib/gooddata/lcm/helpers/tags_helper.rb,
lib/gooddata/lcm/types/scalar/object.rb,
lib/gooddata/lcm/types/scalar/string.rb,
lib/gooddata/lcm/types/special/array.rb,
lib/gooddata/models/ads_output_stage.rb,
lib/gooddata/models/execution_detail.rb,
lib/gooddata/models/metadata/dataset.rb,
lib/gooddata/models/module_constants.rb,
lib/gooddata/models/project_metadata.rb,
lib/gooddata/bricks/hello_world_brick.rb,
lib/gooddata/cli/commands/process_cmd.rb,
lib/gooddata/cli/commands/project_cmd.rb,
lib/gooddata/lcm/actions/collect_meta.rb,
lib/gooddata/lcm/helpers/check_helper.rb,
lib/gooddata/lcm/types/complex/tokens.rb,
lib/gooddata/lcm/types/scalar/integer.rb,
lib/gooddata/mixins/md_object_indexer.rb,
lib/gooddata/mixins/property_accessor.rb,
lib/gooddata/models/blueprint/to_wire.rb,
lib/gooddata/models/metadata/variable.rb,
lib/gooddata/models/notification_rule.rb,
lib/gooddata/exceptions/command_failed.rb,
lib/gooddata/exceptions/malformed_user.rb,
lib/gooddata/exceptions/maql_execution.rb,
lib/gooddata/lcm/actions/purge_clients.rb,
lib/gooddata/lcm/types/class/gd_client.rb,
lib/gooddata/lcm/types/class/gd_logger.rb,
lib/gooddata/lcm/types/complex/complex.rb,
lib/gooddata/lcm/types/complex/segment.rb,
lib/gooddata/models/metadata/attribute.rb,
lib/gooddata/models/metadata/dashboard.rb,
lib/gooddata/models/metadata/dimension.rb,
lib/gooddata/models/report_data_result.rb,
lib/gooddata/lcm/types/class/ads_client.rb,
lib/gooddata/lcm/types/class/gd_product.rb,
lib/gooddata/lcm/types/class/gd_project.rb,
lib/gooddata/lcm/types/class/smart_hash.rb,
lib/gooddata/exceptions/no_project_error.rb,
lib/gooddata/exceptions/object_migration.rb,
lib/gooddata/exceptions/validation_error.rb,
lib/gooddata/lcm/actions/collect_clients.rb,
lib/gooddata/lcm/actions/segments_filter.rb,
lib/gooddata/lcm/actions/synchronize_cas.rb,
lib/gooddata/lcm/actions/synchronize_ldm.rb,
lib/gooddata/mixins/data_property_reader.rb,
lib/gooddata/mixins/data_property_writer.rb,
lib/gooddata/mixins/meta_property_reader.rb,
lib/gooddata/mixins/meta_property_writer.rb,
lib/gooddata/models/blueprint/fact_field.rb,
lib/gooddata/core/splunk_logger_decorator.rb,
lib/gooddata/exceptions/invalid_env_error.rb,
lib/gooddata/exceptions/project_not_found.rb,
lib/gooddata/exceptions/segment_not_empty.rb,
lib/gooddata/lcm/actions/collect_segments.rb,
lib/gooddata/lcm/actions/synchronize_meta.rb,
lib/gooddata/models/blueprint/label_field.rb,
lib/gooddata/models/blueprint/to_manifest.rb,
lib/gooddata/models/channel_configuration.rb,
lib/gooddata/models/project_log_formatter.rb,
lib/gooddata/exceptions/filter_maqlization.rb,
lib/gooddata/helpers/global_helpers_params.rb,
lib/gooddata/lcm/actions/apply_custom_maql.rb,
lib/gooddata/lcm/actions/associate_clients.rb,
lib/gooddata/lcm/actions/execute_schedules.rb,
lib/gooddata/lcm/actions/provision_clients.rb,
lib/gooddata/lcm/actions/synchronize_users.rb,
lib/gooddata/models/blueprint/anchor_field.rb,
lib/gooddata/models/blueprint/bridge_field.rb,
lib/gooddata/models/metadata/dashboard_tab.rb,
lib/gooddata/exceptions/uncomputable_report.rb,
lib/gooddata/lcm/actions/collect_ca_metrics.rb,
lib/gooddata/lcm/actions/set_master_project.rb,
lib/gooddata/mixins/content_property_reader.rb,
lib/gooddata/mixins/content_property_writer.rb,
lib/gooddata/models/metadata/scheduled_mail.rb,
lib/gooddata/lcm/actions/collect_ldm_objects.rb,
lib/gooddata/lcm/actions/synchronize_clients.rb,
lib/gooddata/lcm/helpers/safe_failure_helper.rb,
lib/gooddata/lcm/types/complex/release_query.rb,
lib/gooddata/models/blueprint/date_dimension.rb,
lib/gooddata/models/blueprint/schema_builder.rb,
lib/gooddata/models/user_filters/user_filter.rb,
lib/gooddata/bricks/middleware/aws_middleware.rb,
lib/gooddata/bricks/middleware/dwh_middleware.rb,
lib/gooddata/lcm/actions/collect_data_product.rb,
lib/gooddata/lcm/actions/ensure_release_table.rb,
lib/gooddata/lcm/actions/update_release_table.rb,
lib/gooddata/lcm/helpers/release_table_helper.rb,
lib/gooddata/models/blueprint/attribute_field.rb,
lib/gooddata/models/blueprint/blueprint_field.rb,
lib/gooddata/models/blueprint/project_builder.rb,
lib/gooddata/models/blueprint/reference_field.rb,
lib/gooddata/bricks/middleware/base_middleware.rb,
lib/gooddata/bricks/middleware/context_manager.rb,
lib/gooddata/exceptions/attr_element_not_found.rb,
lib/gooddata/lcm/actions/synchronize_processes.rb,
lib/gooddata/lcm/actions/synchronize_schedules.rb,
lib/gooddata/lcm/actions/update_metric_formats.rb,
lib/gooddata/models/blueprint/schema_blueprint.rb,
lib/gooddata/models/metadata/report_definition.rb,
lib/gooddata/bricks/middleware/bench_middleware.rb,
lib/gooddata/cloud_resources/mssql/mssql_client.rb,
lib/gooddata/cloud_resources/mysql/mysql_client.rb,
lib/gooddata/lcm/actions/collect_tagged_objects.rb,
lib/gooddata/lcm/actions/create_segment_masters.rb,
lib/gooddata/lcm/actions/synchronize_ldm_layout.rb,
lib/gooddata/lcm/exceptions/lcm_execution_error.rb,
lib/gooddata/models/automated_data_distribution.rb,
lib/gooddata/models/blueprint/dashboard_builder.rb,
lib/gooddata/models/blueprint/dataset_blueprint.rb,
lib/gooddata/models/blueprint/project_blueprint.rb,
lib/gooddata/bricks/middleware/logger_middleware.rb,
lib/gooddata/bricks/middleware/stdout_middleware.rb,
lib/gooddata/exceptions/execution_limit_exceeded.rb,
lib/gooddata/exceptions/user_in_different_domain.rb,
lib/gooddata/lcm/actions/collect_client_projects.rb,
lib/gooddata/lcm/actions/collect_segment_clients.rb,
lib/gooddata/lcm/actions/synchronize_label_types.rb,
lib/gooddata/lcm/actions/synchronize_tag_objects.rb,
lib/gooddata/lcm/actions/synchronize_user_groups.rb,
lib/gooddata/lcm/types/complex/update_preference.rb,
lib/gooddata/models/metadata/dashboard/text_item.rb,
lib/gooddata/bricks/middleware/twitter_middleware.rb,
lib/gooddata/lcm/actions/synchronize_new_segments.rb,
lib/gooddata/lcm/actions/synchronize_user_filters.rb,
lib/gooddata/lcm/exceptions/lcm_execution_warning.rb,
lib/gooddata/lcm/types/complex/users_brick_config.rb,
lib/gooddata/models/client_synchronization_result.rb,
lib/gooddata/models/metadata/analytical_dashboard.rb,
lib/gooddata/models/metadata/visualization_object.rb,
lib/gooddata/bricks/middleware/gooddata_middleware.rb,
lib/gooddata/cloud_resources/cloud_resource_client.rb,
lib/gooddata/lcm/actions/collect_users_brick_users.rb,
lib/gooddata/lcm/actions/import_object_collections.rb,
lib/gooddata/lcm/actions/synchronize_color_palette.rb,
lib/gooddata/models/metadata/dashboard/filter_item.rb,
lib/gooddata/models/metadata/dashboard/iframe_item.rb,
lib/gooddata/models/metadata/dashboard/report_item.rb,
lib/gooddata/bricks/middleware/fs_upload_middleware.rb,
lib/gooddata/bricks/middleware/restforce_middleware.rb,
lib/gooddata/cloud_resources/cloud_resource_factory.rb,
lib/gooddata/lcm/actions/migrate_gdc_date_dimension.rb,
lib/gooddata/lcm/types/complex/synchronization_info.rb,
lib/gooddata/lcm/types/special/enum/synchronize_ldm.rb,
lib/gooddata/bricks/middleware/mask_logger_decorator.rb,
lib/gooddata/lcm/actions/synchronize_etls_in_segment.rb,
lib/gooddata/models/metadata/dashboard/headline_item.rb,
lib/gooddata/models/user_filters/user_filter_builder.rb,
lib/gooddata/bricks/middleware/fs_download_middleware.rb,
lib/gooddata/cloud_resources/bigquery/bigquery_client.rb,
lib/gooddata/cloud_resources/redshift/redshift_client.rb,
lib/gooddata/lcm/actions/synchronize_dataset_mappings.rb,
lib/gooddata/models/metadata/dashboard/dashboard_item.rb,
lib/gooddata/models/metadata/dashboard/geo_chart_item.rb,
lib/gooddata/models/user_filters/variable_user_filter.rb,
lib/gooddata/bricks/middleware/undot_params_middleware.rb,
lib/gooddata/lcm/actions/ensure_technical_users_domain.rb,
lib/gooddata/models/user_filters/mandatory_user_filter.rb,
lib/gooddata/bricks/middleware/context_logger_decorator.rb,
lib/gooddata/bricks/middleware/decode_params_middleware.rb,
lib/gooddata/cloud_resources/snowflake/snowflake_client.rb,
lib/gooddata/lcm/actions/ensure_technical_users_project.rb,
lib/gooddata/lcm/actions/collect_dynamic_schedule_params.rb,
lib/gooddata/lcm/actions/collect_projects_warning_status.rb,
lib/gooddata/lcm/actions/rename_existing_client_projects.rb,
lib/gooddata/models/metadata/dashboard/filter_apply_item.rb,
lib/gooddata/cloud_resources/postgresql/postgresql_client.rb,
lib/gooddata/lcm/actions/collect_multiple_projects_column.rb,
lib/gooddata/lcm/actions/synchronize_attribute_drillpaths.rb,
lib/gooddata/models/client_synchronization_result_details.rb,
lib/gooddata/bricks/middleware/execution_result_middleware.rb,
lib/gooddata/cloud_resources/blobstorage/blobstorage_client.rb,
lib/gooddata/lcm/actions/initialize_continue_on_error_option.rb,
lib/gooddata/lcm/actions/synchronize_kd_dashboard_permission.rb,
lib/gooddata/lcm/actions/synchronize_pp_dashboard_permission.rb,
lib/gooddata/models/metadata/analytical_visualization_object.rb,
lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb,
lib/gooddata/models/metadata/scheduled_mail/dashboard_attachment.rb
Overview
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.
Defined Under Namespace
Modules: Bricks, CLI, CloudResources, Command, ContextLoggerDecorator, ContextManager, Data, Extract, Helpers, LCM, LCM2, Mixin, Model, Rest, SmallGoodZilla, UserFilterBuilder Classes: AdsOutputStage, AnalyticalDashboard, AnalyticalVisualizationObject, App, Attribute, AttributeElementNotFound, AutomatedDataDistribution, BlobStorageClient, BrickFileLogger, ChannelConfiguration, Client, ClientSynchronizationResult, ClientSynchronizationResultDetails, CommandFailed, Dashboard, DashboardAttachment, DashboardItem, DashboardTab, DataProduct, DataSource, DataWarehouse, Dataset, DatasetMapping, Dimension, Domain, Execution, ExecutionDetail, ExecutionLimitExceeded, ExportCloneError, Fact, FilterApplyItem, FilterItem, FilterMaqlizationError, Folder, GdLogger, GeoChartItem, HeadlineItem, IframeItem, ImportCloneError, InvalidEnvError, Invitation, Label, LcmExecutionError, LcmExecutionWarning, LdmLayout, Links, MalformedUserError, MandatoryUserFilter, MaqlExecutionError, MdObject, Membership, Metric, NilLogger, NoProjectError, NotificationRule, ObjectsExportError, ObjectsImportError, ObjectsMigrationError, Process, Profile, Project, ProjectLogFormatter, ProjectMetadata, ProjectNotFound, ProjectRole, Report, ReportAttachment, ReportDataResult, ReportDefinition, ReportItem, Schedule, ScheduledMail, Segment, SegmentNotEmpty, SplunkLoggerDecorator, StyleSetting, Subscription, TextItem, UncomputableReport, UserFilter, UserGroup, UserInDifferentDomainError, ValidationError, Variable, VariableUserFilter, VisualizationObject
Constant Summary collapse
- VERSION =
File.open(File.('../../SDK_VERSION', File.dirname(__FILE__))) { |f| f.readline.strip }
- BRICKS_VERSION =
File.open(File.('../../VERSION', File.dirname(__FILE__))) { |f| f.readline.strip }
- DEFAULT_SSO_OPTIONS =
{ :url => '/gdc/app/account/bootstrap', :valid => 24 * 60 * 60 }
- DEFAULT_LOG_LEVEL =
Logger::INFO
- DEFAULT_LOG_OUTPUT =
STDOUT
- DEFAULT_LOGGER_CLASS =
Logger
- DEFAULT_RESTLOG_LEVEL =
Logger::DEBUG
- DEFAULT_RESTLOG_OUTPUT =
STDOUT
- DEFAULT_RESTLOGGER_CLASS =
Logger
- DEFAULT_SPLUNKLOG_LEVEL =
Logger::INFO
- DEFAULT_SPLUNKLOG_OUTPUT =
STDERR
- DisplayForm =
GoodData::Label
Class Attribute Summary collapse
-
.gd_logger ⇒ Object
Returns the value of attribute gd_logger.
-
.logger ⇒ Object
Returns the value of attribute logger.
-
.project ⇒ Object
Returns the value of attribute project.
-
.rest_logger ⇒ Object
Returns the value of attribute rest_logger.
-
.stats ⇒ Object
writeonly
Sets the attribute stats.
Class Method Summary collapse
-
.bricks_version ⇒ Object
LCM bricks version.
-
.connect(options = nil, second_options = nil, third_options = {}) ⇒ Object
Connect to the GoodData API.
-
.connect_sso(login, provider, url = GoodData::Rest::Connection::DEFAULT_URL, opts = {}) ⇒ GoodData::Rest::Client
Connect to GoodData using SSO.
-
.connection ⇒ Object
(also: client)
Returns the active GoodData connection earlier initialized via GoodData.connect call.
-
.delete(path, options = {}) ⇒ Object
Performs a HTTP DELETE request.
-
.disconnect ⇒ Object
Disconnect (logout) if logged in.
-
.download_from_project_webdav(file, where, options = {}) ⇒ Object
Download from project directory.
-
.download_from_user_webdav(file, where, options = {}) ⇒ Object
Download from user directory.
-
.gem_version_string ⇒ Object
Identifier of gem version.
-
.get(path, options = {}) ⇒ Object
Performs a HTTP GET request.
- .get_client(opts) ⇒ Object
- .get_client_and_project(opts) ⇒ Object
-
.init_module ⇒ Object
Initializes required dynamically loaded classes.
- .logging_http_off ⇒ Object
- .logging_http_on(level = DEFAULT_RESTLOG_LEVEL, output = DEFAULT_RESTLOG_OUTPUT, klass = DEFAULT_RESTLOGGER_CLASS) ⇒ Object
- .logging_http_on? ⇒ Boolean
- .logging_off ⇒ Object
-
.logging_on(level = DEFAULT_LOG_LEVEL, output = DEFAULT_LOG_OUTPUT, klass = DEFAULT_LOGGER_CLASS) ⇒ Object
Turn logging on.
- .logging_on? ⇒ Boolean
-
.poll_on_code(link, options = {}) ⇒ Hash
Generalizaton of poller.
-
.poll_on_response(link, options = {}, &bl) ⇒ Hash
Generalizaton of poller.
-
.post(path, data = {}, options = {}) ⇒ Object
Performs a HTTP POST request.
-
.project_webdav_path(options = {}) ⇒ String
Get WebDav directory for project data.
-
.put(path, data, options = {}) ⇒ Object
Performs a HTTP PUT request.
-
.release_info ⇒ Object
deprecated
Deprecated.
The release info endpoint has been deprecated without a replacement.
- .splunk_logging_off ⇒ Object
- .splunk_logging_on(logger) ⇒ Object
- .splunk_logging_on? ⇒ Boolean
-
.sso_url(login, provider, url, opts = DEFAULT_SSO_OPTIONS) ⇒ String
Generates SSO URL.
-
.upload_to_project_webdav(file, options = {}) ⇒ Object
Upload to project directory.
-
.upload_to_user_webdav(file, options = {}) ⇒ String
Upload to user directory.
-
.user ⇒ GoodData::Profile
(also: profile)
Gets currently logged user.
-
.user_webdav_path(options = {}) ⇒ String
Get WebDav directory for user data.
-
.version ⇒ Object
(also: sdk_version)
SDK version.
- .with_connection(options = nil, second_options = nil, third_options = {}, &block) ⇒ Object
-
.with_project(project, opts = { :client => GoodData.connection }, &bl) ⇒ Object
Perform block in context of another project than currently set.
Class Attribute Details
.gd_logger ⇒ Object
Returns the value of attribute gd_logger.
26 27 28 |
# File 'lib/gooddata/core/logging.rb', line 26 def gd_logger @gd_logger end |
.logger ⇒ Object
Returns the value of attribute logger.
26 27 28 |
# File 'lib/gooddata/core/logging.rb', line 26 def logger @logger end |
.project ⇒ Object
Returns the value of attribute project.
44 45 46 |
# File 'lib/gooddata/core/project.rb', line 44 def project @project end |
.rest_logger ⇒ Object
Returns the value of attribute rest_logger.
26 27 28 |
# File 'lib/gooddata/core/logging.rb', line 26 def rest_logger @rest_logger end |
.stats=(value) ⇒ Object (writeonly)
Sets the attribute stats
27 28 29 |
# File 'lib/gooddata/core/logging.rb', line 27 def stats=(value) @stats = value end |
Class Method Details
.bricks_version ⇒ Object
LCM bricks version
23 24 25 |
# File 'lib/gooddata/version.rb', line 23 def bricks_version BRICKS_VERSION end |
.connect(options = nil, second_options = nil, third_options = {}) ⇒ Object
Connect to the GoodData API
36 37 38 |
# File 'lib/gooddata/connection.rb', line 36 def connect( = nil, = nil, = {}) Rest::Client.connect(, , ) end |
.connect_sso(login, provider, url = GoodData::Rest::Connection::DEFAULT_URL, opts = {}) ⇒ GoodData::Rest::Client
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.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# 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.['GDCAuthSST'], x_gdc_authtt: response.['GDCAuthTT'] } ) ) end end |
.connection ⇒ Object Also known as: client
Returns the active GoodData connection earlier initialized via GoodData.connect call
23 24 25 26 |
# 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 |
.delete(path, options = {}) ⇒ Object
Performs a HTTP DELETE request.
Retuns the JSON response formatted as a Hash object.
Examples
GoodData.delete '/gdc/project/1'
65 66 67 |
# File 'lib/gooddata/core/rest.rb', line 65 def delete(path, = {}) connection.delete path, end |
.disconnect ⇒ Object
Disconnect (logout) if logged in
41 42 43 |
# File 'lib/gooddata/connection.rb', line 41 def disconnect Rest::Client.disconnect end |
.download_from_project_webdav(file, where, options = {}) ⇒ Object
Download from project directory
92 93 94 95 96 |
# File 'lib/gooddata/core/rest.rb', line 92 def download_from_project_webdav(file, where, = {}) = () url = project_webdav_path() connection.download(file, where, .merge(:staging_url => url)) end |
.download_from_user_webdav(file, where, options = {}) ⇒ Object
Download from user directory
106 107 108 109 |
# File 'lib/gooddata/core/rest.rb', line 106 def download_from_user_webdav(file, where, = {}) url = user_webdav_path({ :client => GoodData.client }.merge()) connection.download(file, where, .merge(:staging_url => url)) end |
.gem_version_string ⇒ Object
Identifier of gem version
29 30 31 |
# File 'lib/gooddata/version.rb', line 29 def gem_version_string "gooddata-gem/#{VERSION}/#{RUBY_PLATFORM}/#{RUBY_VERSION}" end |
.get(path, options = {}) ⇒ Object
Performs a HTTP GET request.
Retuns the JSON response formatted as a Hash object.
Examples
GoodData.get '/gdc/projects'
19 20 21 |
# File 'lib/gooddata/core/rest.rb', line 19 def get(path, = {}) connection.get(path, ) end |
.get_client(opts) ⇒ Object
288 289 290 291 292 293 |
# 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 |
.get_client_and_project(opts) ⇒ Object
295 296 297 298 299 300 301 302 303 304 305 306 |
# 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 |
.init_module ⇒ Object
Initializes required dynamically loaded classes
46 47 48 49 50 51 52 53 54 55 |
# 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 |
.logging_http_off ⇒ Object
62 63 64 |
# File 'lib/gooddata/core/logging.rb', line 62 def logging_http_off @rest_logger = NilLogger.new end |
.logging_http_on(level = DEFAULT_RESTLOG_LEVEL, output = DEFAULT_RESTLOG_OUTPUT, klass = DEFAULT_RESTLOGGER_CLASS) ⇒ Object
56 57 58 59 60 |
# 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 |
.logging_http_on? ⇒ Boolean
66 67 68 |
# File 'lib/gooddata/core/logging.rb', line 66 def logging_http_on? !@rest_logger.instance_of?(NilLogger) end |
.logging_off ⇒ Object
48 49 50 |
# File 'lib/gooddata/core/logging.rb', line 48 def logging_off @logger = NilLogger.new end |
.logging_on(level = DEFAULT_LOG_LEVEL, output = DEFAULT_LOG_OUTPUT, klass = DEFAULT_LOGGER_CLASS) ⇒ Object
42 43 44 45 46 |
# 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 |
.logging_on? ⇒ Boolean
52 53 54 |
# File 'lib/gooddata/core/logging.rb', line 52 def logging_on? !@logger.instance_of?(NilLogger) end |
.poll_on_code(link, options = {}) ⇒ Hash
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.
120 121 122 123 124 |
# File 'lib/gooddata/core/rest.rb', line 120 def poll_on_code(link, = {}) client = [:client] fail ArgumentError, 'No :client specified' if client.nil? client.poll_on_code(link, ) end |
.poll_on_response(link, options = {}, &bl) ⇒ Hash
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
135 136 137 138 139 |
# File 'lib/gooddata/core/rest.rb', line 135 def poll_on_response(link, = {}, &bl) client = [:client] fail ArgumentError, 'No :client specified' if client.nil? client.poll_on_response(link, , &bl) end |
.post(path, data = {}, options = {}) ⇒ Object
Performs a HTTP POST request.
Retuns the JSON response formatted as a Hash object.
Examples
client.post '/gdc/projects', { ... }
34 35 36 |
# File 'lib/gooddata/core/rest.rb', line 34 def post(path, data = {}, = {}) connection.post path, data, end |
.project_webdav_path(options = {}) ⇒ String
Get WebDav directory for project data
78 79 80 81 82 |
# File 'lib/gooddata/core/rest.rb', line 78 def project_webdav_path( = {}) = () project = [:project] project.project_webdav_path end |
.put(path, data, options = {}) ⇒ Object
Performs a HTTP PUT request.
Retuns the JSON response formatted as a Hash object.
Parameters
Examples
client.put '/gdc/projects', { ... }
51 52 53 |
# File 'lib/gooddata/core/rest.rb', line 51 def put(path, data, = {}) connection.put path, data, end |
.release_info ⇒ Object
The release info endpoint has been deprecated without a replacement.
Returns information about the GoodData API as a Hash (e.g. version, release time etc.)
59 60 61 |
# File 'lib/gooddata/client.rb', line 59 def release_info fail 'The release info endpoint has been deprecated without a replacement.' end |
.splunk_logging_off ⇒ Object
74 75 76 |
# File 'lib/gooddata/core/logging.rb', line 74 def splunk_logging_off gd_logger.logging_off :splunk end |
.splunk_logging_on(logger) ⇒ Object
70 71 72 |
# File 'lib/gooddata/core/logging.rb', line 70 def splunk_logging_on(logger) gd_logger.logging_on :splunk, logger end |
.splunk_logging_on? ⇒ Boolean
78 79 80 |
# File 'lib/gooddata/core/logging.rb', line 78 def splunk_logging_on? gd_logger.logging_on? :splunk end |
.sso_url(login, provider, url, opts = DEFAULT_SSO_OPTIONS) ⇒ String
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.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# 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 ? '[email protected]' : '[email protected]' 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 |
.upload_to_project_webdav(file, options = {}) ⇒ Object
Upload to project directory
85 86 87 88 89 |
# File 'lib/gooddata/core/rest.rb', line 85 def upload_to_project_webdav(file, = {}) = () url = project_webdav_path() connection.upload(file, .merge(:staging_url => url)) end |
.upload_to_user_webdav(file, options = {}) ⇒ String
Upload to user directory
71 72 73 74 |
# File 'lib/gooddata/core/rest.rb', line 71 def upload_to_user_webdav(file, = {}) url = user_webdav_path({ :client => GoodData.client }.merge()) connection.upload(file, .merge(staging_url: url)) end |
.user ⇒ GoodData::Profile Also known as: profile
Gets currently logged user
14 15 16 |
# File 'lib/gooddata/core/user.rb', line 14 def user GoodData::Profile.current end |
.user_webdav_path(options = {}) ⇒ String
Get WebDav directory for user data
100 101 102 103 |
# File 'lib/gooddata/core/rest.rb', line 100 def user_webdav_path( = {}) client = GoodData::Rest::Object.client({ :client => GoodData.client }.merge()) client.user_webdav_path end |
.version ⇒ Object Also known as: sdk_version
SDK version
15 16 17 |
# File 'lib/gooddata/version.rb', line 15 def version VERSION end |
.with_connection(options = nil, second_options = nil, third_options = {}, &block) ⇒ Object
45 46 47 48 49 50 |
# File 'lib/gooddata/connection.rb', line 45 def with_connection( = nil, = nil, = {}, &block) client = connect(, , ) block.call(client) ensure disconnect end |
.with_project(project, opts = { :client => GoodData.connection }, &bl) ⇒ Object
Perform block in context of another project than currently set
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# 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 |