Sha256: fb456a6bae06afdf2f805c0cf37b6416aeabc295bace9da748f0e7e47e41f7d1

Contents?: true

Size: 1.85 KB

Versions: 24

Compression:

Stored size: 1.85 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_relative '../rest/resource'

module GoodData
  class ExecutionDetail < Rest::Resource
    attr_reader :dirty, :json

    alias_method :data, :json

    # Initializes object instance from raw wire JSON
    #
    # @param json Json used for initialization
    def initialize(json)
      super
      @json = json
    end

    # Timestamp when execution was created
    def created
      Time.parse(json['executionDetail']['created'])
    end

    # Has execution failed?
    def error?
      status == :error
    end

    # Timestamp when execution was finished
    def finished
      Time.parse(json['executionDetail']['finished'])
    end

    # Log for execution
    def log
      @client.get(json['executionDetail']['links']['log'])
    end

    # Filename of log
    def log_filename
      @client.get(json['executionDetail']['logFileName'])
    end

    # Is execution ok?
    def ok?
      status == :ok
    end

    # Timestamp when execution was started
    def started
      Time.parse(json['executionDetail']['started'])
    end

    # Status of execution
    def status
      json['executionDetail']['status'].downcase.to_sym
    end

    # Timestamp when execution was updated
    def updated
      Time.parse(json['executionDetail']['updated'])
    end

    # Returns URL
    #
    # @return [String] Schedule URL
    def uri
      @json['executionDetail']['links']['self'] if @json && @json['executionDetail'] && @json['executionDetail']['links']
    end

    # Compares two executions - based on their URI
    def ==(other)
      other.respond_to?(:uri) && other.uri == uri && other.respond_to?(:to_hash) && other.to_hash == to_hash
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
gooddata-2.3.1-java lib/gooddata/models/execution_detail.rb
gooddata-2.3.1 lib/gooddata/models/execution_detail.rb
gooddata-2.3.0-java lib/gooddata/models/execution_detail.rb
gooddata-2.3.0 lib/gooddata/models/execution_detail.rb
gooddata-2.2.0-java lib/gooddata/models/execution_detail.rb
gooddata-2.2.0 lib/gooddata/models/execution_detail.rb
gooddata-2.1.19-java lib/gooddata/models/execution_detail.rb
gooddata-2.1.19 lib/gooddata/models/execution_detail.rb
gooddata-2.1.17-java lib/gooddata/models/execution_detail.rb
gooddata-2.1.17 lib/gooddata/models/execution_detail.rb
gooddata-2.1.15-java lib/gooddata/models/execution_detail.rb
gooddata-2.1.15 lib/gooddata/models/execution_detail.rb
gooddata-2.1.14-java lib/gooddata/models/execution_detail.rb
gooddata-2.1.14 lib/gooddata/models/execution_detail.rb
gooddata-2.1.13-java lib/gooddata/models/execution_detail.rb
gooddata-2.1.13 lib/gooddata/models/execution_detail.rb
gooddata-2.1.12-java lib/gooddata/models/execution_detail.rb
gooddata-2.1.12 lib/gooddata/models/execution_detail.rb
gooddata-2.1.11-java lib/gooddata/models/execution_detail.rb
gooddata-2.1.11 lib/gooddata/models/execution_detail.rb