Sha256: 278c139b2fdd9c04537097a5063461685278c60891fb919b35e6e6c4485df630

Contents?: true

Size: 1.65 KB

Versions: 44

Compression:

Stored size: 1.65 KB

Contents

require 'puppet/indirector/face'

Puppet::Indirector::Face.define(:resource, '0.0.1') do
  copyright "Puppet Labs", 2011
  license   "Apache 2 license; see COPYING"

  summary "API only: interact directly with resources via the RAL."
  description <<-'EOT'
    API only: this face provides a Ruby API with functionality similar to the
    puppet resource (or ralsh) subcommand.
  EOT

  get_action(:destroy).summary "Invalid for this subcommand."

  search = get_action(:search)
  search.summary "API only: get all resources of a single type."
  search.arguments "<resource_type>"
  search.returns "An array of Puppet::Resource objects."
  search.examples <<-'EOT'
    Get a list of all user resources (API example):

        all_users = Puppet::Face[:resource, '0.0.1'].search("user")
  EOT

  find = get_action(:find)
  find.summary "API only: get a single resource."
  find.arguments "<type>/<title>"
  find.returns "A Puppet::Resource object."
  find.examples <<-'EOT'
    Print information about a user on this system (API example):

        puts Puppet::Face[:resource, '0.0.1'].find("user/luke").to_pson
  EOT

  save = get_action(:save)
  save.summary "API only: create a new resource."
  save.description <<-EOT
    API only: creates a new resource.
  EOT
  save.arguments "<resource_object>"
  save.returns "The same resource object passed as an argument."
  save.examples <<-'EOT'
    Create a new file resource (API example):

        my_resource = Puppet::Resource.new(
          :file,
          "/tmp/demonstration",
          :parameters => {:ensure => :present, :content => "some\nthing\n"}
        )

        Puppet::Face[:resource, '0.0.1'].save(my_resource)
  EOT
end

Version data entries

44 entries across 44 versions & 4 rubygems

Version Path
puppet-parse-0.1.4 lib/vendor/puppet/face/resource.rb
puppet-parse-0.1.3 lib/vendor/puppet/face/resource.rb
puppet-parse-0.1.2 lib/vendor/puppet/face/resource.rb
puppet-parse-0.1.1 lib/vendor/puppet/face/resource.rb
puppet-2.7.26 lib/puppet/face/resource.rb
puppet-2.7.25 lib/puppet/face/resource.rb
puppet-2.7.24 lib/puppet/face/resource.rb
puppet-2.7.23 lib/puppet/face/resource.rb
puppet-2.7.22 lib/puppet/face/resource.rb
puppet-parse-0.1.0 lib/vendor/puppet/face/resource.rb
puppet-parse-0.0.6 lib/vendor/puppet/face/resource.rb
puppet-2.7.21 lib/puppet/face/resource.rb
puppet-parse-0.0.5 lib/vendor/puppet/face/resource.rb
puppet-parse-0.0.4 lib/vendor/puppet/face/resource.rb
puppet-parse-0.0.2 lib/vendor/puppet/face/resource.rb
puppet-2.7.20 lib/puppet/face/resource.rb
puppet-2.7.20.rc1 lib/puppet/face/resource.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/puppet-2.7.18/lib/puppet/face/resource.rb
puppet-2.7.19 lib/puppet/face/resource.rb
supply_drop-0.11.0 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/face/resource.rb