Sha256: 95ec942d9e3ce47ed2ee01dfaa8e0b5559210e07069e0cb4a30f4c2f9d85f092

Contents?: true

Size: 1.28 KB

Versions: 41

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

Puppet::DataTypes.create_type('ResourceInstance') do
  interface <<-PUPPET
    attributes => {
      'target'        => Target,
      'type'          => Variant[String[1], Type[Resource]],
      'title'         => String[1],
      'state'         => Optional[Hash[String[1], Data]],
      'desired_state' => Optional[Hash[String[1], Data]],
      'events'        => Optional[Array[Hash[String[1], Data]]]
    },
    functions => {
      add_event               => Callable[[Hash[String[1], Data]], Array[Hash[String[1], Data]]],
      set_state               => Callable[[Hash[String[1], Data]], Hash[String[1], Data]],
      overwrite_state         => Callable[[Hash[String[1], Data]], Hash[String[1], Data]],
      set_desired_state       => Callable[[Hash[String[1], Data]], Hash[String[1], Data]],
      overwrite_desired_state => Callable[[Hash[String[1], Data]], Hash[String[1], Data]],
      reference               => Callable[[], String],
      '[]'                    => Callable[[String[1]], Data]
    }
  PUPPET

  load_file('bolt/resource_instance')
  # Needed for Puppet to recognize Bolt::ResourceInstance as a Puppet object when deserializing
  Bolt::ResourceInstance.include(Puppet::Pops::Types::PuppetObject)
  implementation_class Bolt::ResourceInstance
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
bolt-2.13.0 bolt-modules/boltlib/lib/puppet/datatypes/resourceinstance.rb