Environment profile clouds
Use the command-line interface to work with environment profile clouds.
EnvironmentProfileClouds object
The EnvironmentProfileClouds object manipulates the clouds and IP groups associated with an environment profile. This object behaves much like a dict object with Cloud objects as keys. For more information, see EnvironmentProfileClouds methods. References to these objects can be obtained using the clouds attributes of EnvironmentProfile objects.
EnvironmentProfileClouds methods
The EnvironmentProfileClouds object has the following methods:
- addCloud
- Adds a cloud group to the list of cloud groups for an environment
profile. This method accepts the following parameters:
- A Cloud object that represents the cloud group to be added.
- An optional alias for the cloud in this environment profile. If no alias is provided, the name of the cloud group is used.
- clear
- Dissociates all cloud groups from this environment profile.
- __contains__
- Indicates if the specified cloud group is associated with this
environment profile. This method is called automatically when you
use the Python
inoperator. - __delitem__
- Dissociates a cloud group from this environment profile. This
method is called automatically when you use the Python
delstatement. - get
- Returns an EnvironmentProfileCloud object
that describes how a cloud group is used in this environment profile.
This method accepts the same parameters as thedict object
method of the same name:
- A Cloud object representing the cloud group about which information is to be returned
- An optional default value that is returned if the cloud group is not used by the environment profile
- __getitem__
- Returns an EnvironmentProfileCloud object
that describes how a cloud group is used in this environment profile.
This method accepts a single parameter that must be a Cloud object representing the cloud group
about which information is to be returned. This method is started
automatically when you access an item using the Python
[]syntax. - has_key
- Indicates if the specified cloud group is associated with this environment profile. This method accepts a single parameter that must be a Cloud object representing the cloud group about which information is to be returned.
- items
- Returns a list of (Cloud, EnvironmentProfileCloud) tuples that describe the cloud groups associated with the environment profile.
- __iter__
- Returns an iteration over Cloud objects representing the cloud groups in the environment profile.
- iteritems
- Returns an iteration over (Cloud, EnvironmentProfileCloud) tuples representing the cloud groups associated with the environment profile.
- iterkeys
- Returns an iteration over Cloud objects representing the cloud groups in the environment profile.
- itervalues
- Returns an iteration over the EnvironmentProfileCloud objects associated with the environment profile.
- keys
- Returns a list of Cloud objects representing the cloud groups in the environment profile. The objects contain only necessary attributes, for example, ID and name.
- __len__
- Returns the number of cloud groups associated with the environment profile.
- __repr__
- Returns a string representation of the cloud groups and IP groups associated with the environment profile.
- __setitem__
- Associates a cloud group with the environment profile and assigns
an alias to it. This method is called automatically when you assign
a value to an item in an EnvironmentProfileClouds object.
The key for the item must be a Cloud object and
the assigned value must be a string, as shown in the following example:
>>> myep = deployer.environmentprofiles['My profile'][0] >>> mycloud = deployer.clouds['My cloud'][0] >>> myep.clouds[mycloud] = 'alias for my cloud' - __str__
- Returns a string representation of the cloud groups and IP groups associated with the environment profile.
- __unicode__
- Returns a string representation of the cloud groups and IP groups associated with the environment profile.
- values
- Returns a list of the EnvironmentProfileCloud objects associated with the environment profile.
EnvironmentProfileCloud object
An EnvironmentProfileCloud object is used to access and modify information about a particular cloud group in an environment profile. For more information about individual attributes and methods, see EnvironmentProfileCloud methods and EnvironmentProfileCloud attributes.
EnvironmentProfileCloud methods
The EnvironmentProfileCloud object has the following methods:
- __eq__
- This method is used automatically by Python to determine if two EnvironmentProfileCloud objects are equal. That is, if they represent the same cloud in the same environment profile.
- __nonzero__
- This method is used by Python whenever an EnvironmentProfileCloud object
is used in a boolean context. It always returns
True. - __repr__
- This method returns a string representation of the EnvironmentProfileCloud object and the IP groups it contains.
- __str__
- This method returns a string representation of the EnvironmentProfileCloud object and the IP groups it contains.
- __unicode__
- This method returns a string representation of the EnvironmentProfileCloud object and the IP groups it contains.
EnvironmentProfileCloud attributes
The EnvironmentProfileCloud object has the following attributes:
- alias
- The alias attribute can be used to examine and modify the alias assigned to a cloud group in an environment profile. Its value must be a string.
- ipgroups
- The ipgroups attribute references an EnvironmentProfileClouds object that contains
additional information about how the IP groups within the cloud group
are used by the environment profile. For additional help on using
this object, enter the following command:
>>> help(deployer.environmentprofilecloudipgroups)