Node objects.
Functions
SET_DEFAULT(collector, field, sub_objs, using) | |
generate_hostname(size) | Generate a hostname using only non-ambiguous characters. |
generate_node_system_id() | |
get_db_state(instance, field_name) | Get the persisted state of a given field for a given model instance. |
get_object_or_404(klass, *args, **kwargs) | Uses get() to return an object, or raises a Http404 exception if the object does not exist. |
patch_pgarray_types() | Monkey-patch incompatibility with recent versions of djorm_pgarray. |
strip_domain(hostname) | Return hostname with the domain part removed. |
uuid1([node, clock_seq]) | Generate a UUID from a host ID, sequence number, and the current time. |
validate_hostname(hostname) | Validator for hostnames. |
Classes
BooleanField(*args, **kwargs) | |
CharField(*args, **kwargs) | |
CleanSave | Mixin for model classes. |
Config(*args, **kwargs) | Configuration settings item. |
DHCPLease(*args, **kwargs) | A known mapping of an IP address to a MAC address. |
DISTRO_SERIES | List of supported ubuntu releases. |
DefaultMeta | Base class for model Meta classes in the maasserver app. |
ForeignKey(to[, to_field, rel_class, ...]) | |
IntegerField([verbose_name, name, ...]) | |
JSONObjectField([verbose_name, name, ...]) | A field that will store any jsonizable python object. |
MAC(value) | A MAC address represented as a database value. |
Manager() | |
ManyToManyField(to[, db_constraint]) | |
NODE_PERMISSION | Permissions relating to nodes. |
NODE_STATUS | The vocabulary of a Node‘s possible statuses. |
Node(*args, **kwargs) | A Node represents a physical machine used by the MAAS Server. |
NodeManager() | A utility to manage the collection of Nodes. |
Q(*args, **kwargs) | Encapsulates filters as objects that can then be combined logically (using & and |). |
Tag(*args, **kwargs) | A Tag is a label applied to a Node. |
TimestampedModel(*args, **kwargs) | Abstract base model with creation/update timestamps. |
Token(*args, **kwargs) | Token(id, key, secret, verifier, token_type, timestamp, is_approved, user_id, consumer_id, callback, callback_confirmed) |
User(*args, **kwargs) | Users within the Django authentication system are represented by this model. |
Zone(*args, **kwargs) | A Zone is an entity used to logically group nodes together. |
imap | imap(func, *iterables) –> imap object |
islice | islice(iterable, [start,] stop [, step]) –> islice object |
repeat | repeat(object [,times]) -> create an iterator which returns the object |
Exceptions
NodeStateViolation | Operation on node not possible given node’s current state. |
PermissionDenied | The user did not have permission to do that |
UnknownPowerType | Raised when a node has an unknown power type. |
ValidationError(message[, code, params]) | An error while validating data. |
Bases: maasserver.models.cleansave.CleanSave, maasserver.models.timestampedmodel.TimestampedModel
A Node represents a physical machine used by the MAAS Server.
Variables: |
|
---|
Fully qualified domain name for this node.
If MAAS manages DNS for this node, the domain part of the hostname (if present), is replaced by the domain configured on the cluster controller. If not, simply return the node’s hostname.
Return status text as displayed to the user.
The UI representation is taken from NODE_STATUS_CHOICES_DICT and may interpolate the variable “owner” to reflect the username of the node’s current owner, if any.
Add a new MAC address to this Node.
Parameters: | mac_address (unicode) – The MAC address to be added. |
---|---|
Raises: | django.core.exceptions.ValidationError |
Remove a MAC address from this Node.
Parameters: | mac_address (string) – The MAC address to be removed. |
---|
Accept this node’s (anonymous) enlistment.
This call makes sense only on a node in Declared state, i.e. one that has been anonymously enlisted and is now waiting for a MAAS user to accept that enlistment as authentic. Calling it on a node that is in Ready or Commissioning state, however, is not an error – it probably just means that somebody else has beaten you to it.
Returns: | This node if it has made the transition from Declared, or None if it was already in an accepted state. |
---|
Set 5 character hostname using non-ambiguous characters.
Using 5 letters from the set ‘abcdefghjkmnpqrtwxy346789’ we get 9,765,625 combinations (pow(25, 5)).
Note that having a hostname starting with a number is perfectly valid, see http://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names
Get power-type to use for this node.
If no power type has been set for the node, raise UnknownPowerType.
Determine any special kernel parameters for this node.
Returns: | (tag, kernel_options) tag is a Tag object or None. If None, the kernel_options came from the global setting. kernel_options, a string indicating extra kernel_options that should be used when booting this node. May be None if no tags match and no global setting has been configured. |
---|
Return effective power parameters, including any defaults.
Mark commissioned node as acquired by the given user and token.
Should this node be installed with the traditional installer?
By default, nodes should be installed with the traditional installer, so this returns True when no use-fastpath-installer tag has been defined.
Should this node be installed with the Fast Path installer?
By default, nodes should be installed with the traditional installer, so this returns True when the use-fastpath-installer has been defined and False when it hasn’t.
Set this node to be installed with the traditional installer.
By default, nodes should be installed with the Traditional installer.
Raises: | RuntimeError when the use-traditional-installer tag is defined with an expression. The reason is that the tag evaluation machinery will eventually ignore whatever changes you make with this method. |
---|
Set this node to be installed with the Fast Path Installer.
By default, nodes should be installed with the Traditional Installer.
Raises: | RuntimeError when the use-fastpath-installer tag is defined with an expression. The reason is that the tag evaluation machinery will eventually ignore whatever changes you make with this method. |
---|