Class Puppet::Type
In: lib/puppet/type.rb
Parent: Object

Methods

[]   []   []=   []=   add_property_parameter   alias   allattrs   attr_alias   attr_alias   attrclass   attrtype   autorequire   autorequire   builddepends   cache   cached   clear   copyparam   create   currentpropvalues   defaultprovider   delete   delete   deleting?   depthfirst?   depthfirst?   doc   each   eachautorequire   eachmetaparam   eachproperty   ensurable   ensurable?   evaluate   expirer   finish   flush   handle_param_options   has_key?   hash2resource   initvars   instances   insync?   isomorphic?   isomorphic?   log   managed?   metaparam?   metaparamclass   metaparamdoc   metaparams   name   namevar   new   newattr   newmetaparam   newparam   newproperty   newstate   noop   noop?   paramclass   paramdoc   parameter   parameters   parent   pathbuilder   property   propertybyname   propertychanges   propertydefined?   provide   provider   provider=   provider_hash   provider_hash_by_type   providers   providers_by_source   providify   purging   purging?   ref   relationship_params   remove   retrieve   schedule   scheduled?   self_refresh?   set_attr_alias   set_default   should   states   suitableprovider   tags=   title   to_hash   to_s   to_s   to_trans   unprovide   validate   validattr?   validparameter?   validproperties   validproperty?   validprovider?   value   version  

Included Modules

Puppet::Util Puppet::Util::Errors Puppet::Util::LogPaths Puppet::Util::Logging Puppet::Util::Cacher Puppet::FileCollection::Lookup Puppet::Util::Tagging Puppet::Util::ClassGen Puppet::Util::Warnings Enumerable Enumerable Puppet::Util::ClassGen Puppet::MetaType::Manager Puppet::Util Puppet::Util::Logging

Classes and Modules

Class Puppet::Type::RelationshipMetaparam

Attributes

catalog  [RW]  The catalog that this resource is stored in.
defaultprovider  [W] 
exported  [RW]  is the resource exported
name  [R] 
noop  [W] 
original_parameters  [R]  instance methods related to instance intrinsics e.g., initialize() and name()
parenttype  [RW] 
properties  [R] 
provider  [R] 
providerloader  [RW] 
self_refresh  [RW] 
title  [W]  In naming methods, I have tried to consistently name the method so that it is clear whether it operates on all attributes (thus has ‘attr’ in the method name, or whether it operates on a specific type of attributes.
virtual  [RW]  is the resource virtual (it should not :-))

Public Class methods

retrieve a named instance of the current type

add an instance by name to the class list of instances

Create an alias. We keep these in a separate hash so that we don‘t encounter the objects multiple times when iterating over them.

All parameters, in the appropriate order. The namevar comes first, then the provider, then the properties, and finally the params and metaparams in the order they were specified in the files.

Retrieve an attribute alias, if there is one.

Find the class associated with any given attribute.

What type of parameter are we dealing with? Cache the results, because this method gets called so many times.

Specify a block for generating a list of objects to autorequire. This makes it so that you don‘t have to manually specify things that you clearly require.

remove all of the instances of a single type

Copy an existing class parameter. This allows other types to avoid duplicating a parameter definition, and is mostly used by subclasses of the File class.

Force users to call this, so that we can merge objects if necessary.

Find the default provider.

remove a specified object

this is a retarded hack method to get around the difference between component children and file children

We need to add documentation for each provider.

iterate across each of the type‘s instances

Yield each of those autorequires in turn, yo.

Create the ‘ensure’ class. This is a separate method so other types can easily call it and create their own ‘ensure’ values.

Should we add the ‘ensure’ property to this class?

Deal with any options passed into parameters.

does the type have an object with the given name?

Convert a simple hash into a Resource instance. This is a convenience method, so people can create RAL resources with a hash and get the same behaviour as we get internally when we use Resource instances.

  This should only be used directly from Ruby -- it's not used when going through

normal Puppet usage.

all of the variables that must be initialized for each subclass

Retrieve all known instances. Either requires providers or must be overridden.

Is this type‘s name isomorphic with the object? That is, if the name conflicts, does it necessarily mean that the objects conflict? Defaults to true.

Is the parameter in question a meta-parameter?

Find the metaparameter class associated with a given metaparameter name.

initialize the type instance

Create a new metaparam. Requires a block and a name, stores it in the @parameters array, and does some basic checking on it.

Create a new parameter. Requires a block and a name, stores it in the @parameters array, and does some basic checking on it.

Create a new property. The first parameter must be the name of the property; this is how users will refer to the property when creating new instances. The second parameter is a hash of options; the options are:

Find the parameter class associated with a given parameter name.

Return the parameter names

Return the property class associated with a name

Create a new provider of a type. This method must be called directly on the type that it‘s implementing.

Just list all of the providers.

Return a list of one suitable provider per source, with the default provider first.

Make sure we have a :provider parameter defined. Only gets called if there are providers.

Create an alias to an existing attribute. This will cause the aliased attribute to be valid when setting and retrieving values on the instance.

Return an array of all of the suitable providers.

Create a block to validate that our object is set up entirely. This will be run before the object is operated on.

does the name reflect a valid parameter?

does the name reflect a valid property?

Public Instance methods

abstract accessing parameters and properties, and normalize access to always be symbols, not strings This returns a value, not an object. It returns the ‘is’ value, but you can also specifically return ‘is’ and ‘should’ values using ‘object.is(:property)’ or ‘object.should(:property)’.

Abstract setting parameters and properties, and normalize access to always be symbols, not strings. This sets the ‘shouldvalue on properties, and otherwise just sets the appropriate parameter.

Create a new property if it is valid but doesn‘t exist Returns: true if a new parameter was added, false otherwise

Return either the attribute alias or the attribute.

Figure out of there are any objects we can automatically add as dependencies.

Build the dependencies associated with an individual object.

Get a hash of the current properties. Returns a hash with the actual property instance as the key and the current value as the, um, value.

remove a property from the object; useful in testing or in cleanup when an error has been encountered

Are we deleting this resource?

iterate across the existing properties

This method is responsible for collecting property changes we always descend into the children before we evaluate our current properties. This returns any changes resulting from testing, thus ‘collect’ rather than ‘each’.

Let the catalog determine whether a given cached value is still valid or has expired.

Set up all of our autorequires.

Flush the provider, if it supports it. This is called by the transaction.

if all contained objects are in sync, then we‘re in sync FIXME I don‘t think this is used on the type instances any more, it‘s really only used for testing

create a log at specified level

is the instance a managed instance? A ‘yes’ here means that the instance was created from the language, vs. being created in order resolve other questions, such as finding a package in a list

For now, leave the ‘name’ method functioning like it used to. Once ‘title’ works everywhere, I‘ll switch it.

Create the actual attribute instance. Requires either the attribute name or class as the first argument, then an optional hash of attributes to set during initialization.

Are we running in noop mode?

Look up our parent in the catalog, if we have one.

Create the path for logging and such.

Return an actual property instance by name; to return the value, use ‘resource[param]’ LAK:NOTE(20081028) Since the ‘parameter’ method is now a superset of this method, this one should probably go away at some point.

Retrieve the changes associated with all of the properties.

Is the named property defined?

Mark that we‘re purging.

Is this resource being purged? Used by transactions to forbid deletion when there are dependencies.

Return the "type[name]" style reference.

Remove an object. The argument determines whether the object‘s subscriptions get eliminated, too.

retrieve the current value of all contained properties

Look up the schedule and set it appropriately. This is done after the instantiation phase, so that the schedule can be anywhere in the file.

Check whether we are scheduled to run right now or not.

For any parameters or properties that have defaults and have not yet been set, set them now. This method can be handed a list of attributes, and if so it will only set defaults for those attributes.

retrieve the ‘shouldvalue for a specified property

Define the initial list of tags.

Retrieve the title of an object. If no title was set separately, then use the object‘s name.

Convert our object to a hash. This just includes properties.

convert to a string

Convert to a transportable object

Return a specific value for an attribute.

[Validate]