Sha256: 017b633298e4e65876514e5104097c5661b8f9761602e412e022e0c2396ae8f1

Contents?: true

Size: 1.89 KB

Versions: 32

Compression:

Stored size: 1.89 KB

Contents

# frozen_string_literal: true

# For each target that you execute an action on, Bolt returns a `Result` object
# and adds the `Result` to a `ResultSet` object. A `Result` object contains
# information about the action you executed on the target.
#
# @param target
#   The target the result is from.
# @param value
#   The output or return of executing on the target.
#
# @!method []
#   Accesses the `value` hash directly and returns the value for the key. This
#   function does not use dot nation. Call the function directly on the `Result`.
#   For example, `$result['key']`.
# @!method action
#   The type of result. For example, `task` or `command`.
# @!method error
#   An object constructed from the `_error` field of the result's `value`.
# @!method message
#   The `_output` field of the result's value.
# @!method ok
#   Whether the result was successful.
# @!method sensitive
#   The `_sensitive` field of the result's value, wrapped in a `Sensitive` object.
#   Call `unwrap()` to extract the value.
# @!method status
#   Either `success` if the result was successful or `failure`.
# @!method to_data
#   A serialized representation of `Result`.
#
Puppet::DataTypes.create_type('Result') do
  interface <<-PUPPET
    attributes => {
      'value' => Hash[String[1], Data],
      'target' => Target
    },
    functions => {
      error => Callable[[], Optional[Error]],
      message => Callable[[], Optional[String]],
      sensitive => Callable[[], Optional[Sensitive[Data]]],
      action => Callable[[], String],
      status => Callable[[], String],
      to_data => Callable[[], Hash],
      ok => Callable[[], Boolean],
      '[]' => Callable[[String[1]], Variant[Data, Sensitive[Data]]]
    }
  PUPPET

  load_file('bolt/result')

  # Needed for Puppet to recognize Bolt::Result as a Puppet object when deserializing
  Bolt::Result.include(Puppet::Pops::Types::PuppetObject)
  implementation_class Bolt::Result
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
bolt-3.29.0 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.28.0 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.27.4 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.27.2 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.27.1 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.26.2 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.26.1 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.25.0 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.24.0 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.23.1 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.23.0 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.22.1 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.22.0 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.21.0 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.20.0 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.19.0 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.18.0 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.17.0 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.16.1 bolt-modules/boltlib/lib/puppet/datatypes/result.rb
bolt-3.16.0 bolt-modules/boltlib/lib/puppet/datatypes/result.rb