Model export and helpers for maasserver.
Functions
create_user(sender, instance, created, **kwargs) | |
get_callable(*args) | Convert a string version of a function name to the callable object. |
get_resolver(*args) | |
get_resource_uri_template(self) | URI template processor. |
get_script_prefix() | Returns the currently active script prefix. |
ignore_unused(*args) | Suppress warnings about unused variables. |
Classes
BootImage(*args, **kwargs) | Available boot image (i.e. |
BootSource(*args, **kwargs) | A source for boot resources. |
BootSourceSelection(*args, **kwargs) | A set of selections for a single BootSource. |
ComponentError(*args, **kwargs) | Error state of a major component of the system. |
Config(*args, **kwargs) | Configuration settings item. |
DHCPLease(*args, **kwargs) | A known mapping of an IP address to a MAC address. |
DownloadProgress(*args, **kwargs) | Progress report from a cluster for one of its boot-image downloads. |
FileStorage(*args, **kwargs) | A simple file storage keyed on file name. |
HandlerDocumentation(handler) | |
MAASAuthorizationBackend | |
MACAddress(*args, **kwargs) | A MACAddress represents a MAC address attached to a Node. |
ModelBackend | Authenticates against settings.AUTH_USER_MODEL. |
NODE_PERMISSION | Permissions relating to nodes. |
Network(*args, **kwargs) | Network(id, name, ip, netmask, vlan_tag, description) |
Node(*args, **kwargs) | A Node represents a physical machine used by the MAAS Server. |
NodeGroup(*args, **kwargs) | NodeGroup(id, created, updated, cluster_name, name, status, api_token_id, api_key, dhcp_key, uuid, maas_url) |
NodeGroupInterface(*args, **kwargs) | NodeGroupInterface(id, created, updated, ip, nodegroup_id, management, interface, subnet_mask, broadcast_ip, router_ip, ip_range_low, ip_range_high, foreign_dhcp_ip) |
SSHKey(*args, **kwargs) | An SSHKey represents a user public SSH key. |
Tag(*args, **kwargs) | A Tag is a label applied to a Node. |
User(*args, **kwargs) | Users within the Django authentication system are represented by this model. |
UserProfile(*args, **kwargs) | A User profile to store MAAS specific methods and fields. |
Zone(*args, **kwargs) | A Zone is an entity used to logically group nodes together. |
Bases: maasserver.models.timestampedmodel.TimestampedModel
Available boot image (i.e. kernel and initrd).
Each BootImage represents a type of boot for which a boot image is available. The maas-import-pxe-files script imports these, and the TFTP server provides them to booting nodes.
If a boot image is missing, that may mean that the import script has not been run yet, or has failed; or that it was not configured to provide that particular image.
Fields correspond directly to values used in the tftppath module.
Bases: maasserver.models.cleansave.CleanSave, maasserver.models.timestampedmodel.TimestampedModel
A source for boot resources.
Return the current BootSource as a dict.
The dict will contain the details of the BootSource and all its `BootSourceSelection`s.
If the BootSource has keyring_data, that data will be returned base64 encoded. Otherwise the BootSource will have a value in its keyring_filename field, and that file’s contents will be base64 encoded and returned.
Bases: maasserver.models.cleansave.CleanSave, maasserver.models.timestampedmodel.TimestampedModel
A set of selections for a single BootSource.
Return the current BootSourceSelection as a dict.
Bases: maasserver.models.cleansave.CleanSave, maasserver.models.timestampedmodel.TimestampedModel
Error state of a major component of the system.
Bases: django.db.models.base.Model
Configuration settings item.
Variables: |
|
---|
Bases: maasserver.models.cleansave.CleanSave, django.db.models.base.Model
A known mapping of an IP address to a MAC address.
These correspond to the latest-known DHCP leases handed out to nodes (or potential nodes – they may not have been enlisted yet!) by the node group worker’s DHCP server.
Bases: maasserver.models.cleansave.CleanSave, maasserver.models.timestampedmodel.TimestampedModel
Progress report from a cluster for one of its boot-image downloads.
Each download on each cluster controller gets its own record. The bytes_downloaded and last-change timestamp are updated with each progress report for that download. The creation timestamp reflects the time of the download’s first progress report.
A cluster may download a file of the same name as a file it has downloaded once already. The new download will have a new record.
The download is complete when bytes_downloaded equals size, provided there is no error. A download with a non-blank error is considered to have failed.
Variables: |
|
---|
Bases: maasserver.models.cleansave.CleanSave, django.db.models.base.Model
A simple file storage keyed on file name.
Variables: |
|
---|
URI where the content of the file can be retrieved anonymously.
Bases: maasserver.models.cleansave.CleanSave, maasserver.models.timestampedmodel.TimestampedModel
A MACAddress represents a MAC address attached to a Node.
Variables: |
|
---|
Return networks to which this MAC is connected, sorted by name.
Bases: maasserver.models.cleansave.CleanSave, django.db.models.base.Model
Network(id, name, ip, netmask, vlan_tag, description)
Validator for vlan_tag.
Validator for vlan_tag.
Return the QuerySet of the nodes connected to this network.
Return type: | django.db.models.query.QuerySet |
---|
Return self as IPNetwork.
Raises AddrFormatError: | |
---|---|
If the combination of self.ip and self.netmask is a malformed network address. |
Bases: maasserver.models.cleansave.CleanSave, maasserver.models.timestampedmodel.TimestampedModel
A Node represents a physical machine used by the MAAS Server.
Variables: |
|
---|
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. |
---|
Mark commissioned node as acquired by the given user and token.
Add a new MAC address to this Node.
Parameters: | mac_address (unicode) – The MAC address to be added. |
---|---|
Raises: | django.core.exceptions.ValidationError |
Check a node’s status transition against the node-status FSM.
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.
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 the distro series to install that node.
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.
Get power-type to use for this node.
If no power type has been set for the node, raise UnknownPowerType.
Return the primary MACAddress for this node.
IP addresses allocated to this node.
Mark allocated or reserved node as available again and power off.
Remove a MAC address from this Node.
Parameters: | mac_address (string) – The MAC address to be removed. |
---|
Set the distro series to install that node.
Set netboot on or off.
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
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.
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.
Return architecture and subarchitecture, as a tuple.
Install OS and self-test a new node.
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. |
---|
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. |
---|
The name of the queue for tasks specific to this node.
Bases: maasserver.models.timestampedmodel.TimestampedModel
NodeGroup(id, created, updated, cluster_name, name, status, api_token_id, api_key, dhcp_key, uuid, maas_url)
Accept this nodegroup’s enlistment.
Add all of the specified cards the Seamicro SM15000 chassis at the specified MAC.
Parameters: |
|
---|
Add all of the virtual machines inside a virsh controller.
Parameters: |
|
---|
Add the servers from a Cicso UCS Manager.
Parameters: |
|
---|
Set default boot source if none is currently defined.
Ensure that this nodegroup has a dhcp key.
This method persists the dhcp key without triggering the model signals (pre_save/post_save/etc) because it’s called from dhcp.configure_dhcp which, in turn, it called from the post_save signal of NodeGroup.
Return the list of interfaces for which MAAS manages DHCP.
Import the pxe files on this cluster controller.
The files are downloaded through the proxy defined in the config setting ‘http_proxy’ if defined.
Does this NodeGroup manage DNS on any interfaces?
This returns True when the NodeGroup is accepted, and has a NodeGroupInterface that’s set to manage both DHCP and DNS.
Reject this nodegroup’s enlistment.
The name of the queue for tasks specific to this nodegroup.
Bases: maasserver.models.cleansave.CleanSave, maasserver.models.timestampedmodel.TimestampedModel
NodeGroupInterface(id, created, updated, ip, nodegroup_id, management, interface, subnet_mask, broadcast_ip, router_ip, ip_range_low, ip_range_high, foreign_dhcp_ip)
Ensure that the network settings are all congruent.
Specifically, it ensures that the router address, the DHCP address range, and the broadcast address if given, all fall within the network defined by the interface’s IP address and the subnet mask.
If no broadcast address is given, the network’s default broadcast address will be used.
Validate the network.
This validates that the network defined by ip and subnet_mask is valid.
Return management status text as displayed to the user.
Return the network defined by the interface’s address and netmask.
Returns: | IPNetwork, or None if the netmask is unset. |
---|---|
Raises AddrFormatError: | |
If the combination of interface address and subnet mask is malformed. |
Bases: maasserver.models.cleansave.CleanSave, maasserver.models.timestampedmodel.TimestampedModel
An SSHKey represents a user public SSH key.
Users will be able to access allocated nodes using any of their registered keys.
Variables: |
|
---|
Return a compact HTML representation of this key.
Returns: | The HTML representation of this key. |
---|---|
Return type: | unicode |
Bases: maasserver.models.cleansave.CleanSave, maasserver.models.timestampedmodel.TimestampedModel
A Tag is a label applied to a Node.
Variables: |
|
---|
Find all nodes that match this tag, and update them.
Bases: maasserver.models.cleansave.CleanSave, django.db.models.base.Model
A User profile to store MAAS specific methods and fields.
Variables: | user – The related User. |
---|
Create a new Token and its related Consumer (OAuth authorisation).
Returns: | A tuple containing the Consumer and the Token that were created. |
---|---|
Return type: | tuple |
Delete the user’s OAuth token wich key token_key.
Parameters: | token_key (string) – The key of the token to be deleted. |
---|---|
Raises: | django.http.Http404 |
Fetches all the user’s OAuth tokens.
Returns: | A QuerySet of the tokens. |
---|---|
Return type: | django.db.models.query.QuerySet |
Bases: maasserver.models.cleansave.CleanSave, maasserver.models.timestampedmodel.TimestampedModel
A Zone is an entity used to logically group nodes together.
Variables: |
|
---|
Is this the default zone?