Resources, resource collections, and methods

The system manages different types of resources, for example hypervisors, patterns, virtual images, and classic virtual system instances.

In the command-line interface, Jython objects are used to represent these resources and collections of these resources. Methods control the behavior of the Jython objects.

An individual resource managed by the system is represented in the command-line interface by a Jython object. This object has the same attributes as the Cloud Pak System resource on the graphical interface, with some additional methods and attributes to make it simpler to work with in the command-line interface environment. Help is available for resource objects, in general, and for each type of resource. You can get help for resources by entering the following command:
>>> help(deployer.resource)
There are additional Jython objects that represent collections of resources in the system. These resource collections (Jython objects) can be used to perform actions such as creating a resource or searching for an existing resource. Help is available for resource collection objects, in general, and for each type of resource collection. You can get help for resource collections by entering the following command:
>>> help(deployer.resourcecollection)
Methods on the Jython objects support the operations that can be performed on the resource in the system. When you call one of these methods in the command-line interface tool, the request is sent over HTTPS to the Cloud Pak System instance where it is run. The result passes back over the HTTPS connection to the command-line interface tool and is shown in one of the following ways:
  • As return values from the methods
  • As an updated state in the Jython objects
  • As Jython exceptions (if the result indicates an error condition)
All Jython classes, objects, and fields within the command-line interface are documented using standard Jython doc strings. The help() function provided in the command-line interface can be used to display the doc strings, as shown in the following examples:
>>> help(deployer.ipgroups)
An IPGroups object represents the collection of IP groups defined to the
Cloud Pak System.  Objects of this type are used to create, delete,
iterate over, list and search for IP groups on the system.

Additional help is available for the following methods:
   __contains__, create, delete, __delitem__, __getattr__, __getitem__,
   __iter__, __len__, list, __lshift__, __repr__, __rshift__, __str__,
   __unicode__
>>> help(deployer.ipgroup) 
An IPGroup object represents a particular IP group defined on the
Cloud Pak System.  Use the IP group object to query and
manipulate the IP group definition on the Cloud Pak System.  Attributes of
the IP group and relationships between the IP group and other
resources on the Cloud Pak System are represented as Jython
attributes on the IPGroup object.  Manipulate these Jython
attributes using standard Jython mechanisms to make changes to the
corresponding data on the Cloud Pak System.

Additional help is available for the following methods:
   __contains__, __delattr__, delete, __eq__, __hash__, isStatusTransient,
   __nonzero__, refresh, __repr__, __str__, __unicode__, waitFor

Additional help is available for the following properties:
   created, gateway, id, ips, name, netmask, networks, primarydns,
   secondarydns, subnetaddress, updated

Remember to append an underscore to the property name when asking for
help using a specific instance of a resource rather than the class.
For example, "help(deployer.pattern.name)" or "help(mypattern.name_)"
will work, but "help(mypattern.name)" will resolve the name of the pattern
referenced by mypattern and attempt to provide help for the resulting
string rather than the property itself.
>>> help(deployer.ipgroup.subnetaddress)
Subnet address associated with the IP group, represented as a string in
dotted decimal notation ('192.168.98.0', for example).