Professional Documents
Culture Documents
09 OpenStack Guide v0
09 OpenStack Guide v0
PUT /api/2.0/subnets/{id}/
Please see the documentation for the 'create' operation for detailed descriptions of each
parameter.
Optional parameters
managed If False, MAAS should not manage this subnet. (Default: True)
Subnets
Manage subnets.
GET /api/2.0/subnets/
Create a subnet.
Required parameters
vlan VLAN this subnet belongs to. Defaults to the default VLAN for the provided fabric or
defaults to the default VLAN in the default fabric (if unspecified).
fabric Fabric for the subnet. Defaults to the fabric the provided VLAN belongs to, or defaults to
the default fabric.
vid VID of the VLAN this subnet belongs to. Only used when vlan is not provided. Picks the
VLAN with this VID in the provided fabric or the default fabric if one is not given.
rdns_mode How reverse DNS is handled for this subnet. One of: 0 (Disabled), 1 (Enabled), or 2
(RFC2317). Disabled means no reverse zone is created; Enabled means generate the reverse
zone; RFC2317 extends Enabled to create the necessary parent zone with the appropriate
CNAME resource records for the network, if the network is small enough to require the support
described in RFC2317.
Only managed subnets allow DHCP to be enabled on their related dynamic ranges. (Thus,
dynamic ranges become "informational only"; an indication that another DHCP server is
currently handling them, or that MAAS will handle them when the subnet is enabled for
management.)
Managed subnets do not allow IP allocation by default. The meaning of a "reserved" IP range is
reversed for an unmanaged subnet. (That is, for managed subnets, "reserved" means "MAAS
cannot allocate any IP address within this reserved block". For unmanaged subnets, "reserved"
means "MAAS must allocate IP addresses only from reserved IP ranges".
Tag
Manage a Tag.
Tags are properties that can be associated with a Node and serve as criteria for selecting and
allocating nodes.
DELETE /api/2.0/tags/{name}/
Returns 404 if the tag is not found. Returns 204 if the tag is successfully deleted.
GET /api/2.0/tags/{name}/
This is considered a maintenance operation, which should normally not be necessary. Adding
nodes or updating a tag's definition should automatically trigger the appropriate changes.
Returns 404 if the tag is not found. Returns 401 if the user does not have permission to update the
nodes. Returns 409 if 'definition' doesn't match the current definition.
PUT /api/2.0/tags/{name}/
param name The name of the Tag to be created. This should be a short name, and will be
used in the URL of the tag.
param comment A long form description of what the tag is meant for. It is meant as a
human readable description of the tag.
param definition An XPATH query that will be evaluated against the hardware_details
stored for all nodes (output of lshw -xml).
GET /api/2.0/tags/
List Tags.
POST /api/2.0/tags/
param name The name of the Tag to be created. This should be a short name, and will be
used in the URL of the tag.
param comment A long form description of what the tag is meant for. It is meant as a
human readable description of the tag.
param definition An XPATH query that will be evaluated against the hardware_details
stored for all nodes (output of lshw -xml).
param kernel_opts Can be None. If set, nodes associated with this tag will add this
string to their kernel options when booting. The value overrides the global 'kernel_opts'
setting. If more than one tag is associated with a node, the one with the lowest
alphabetical name will be picked (eg 01-my-tag will be taken over 99-tag-name).
User
DELETE /api/2.0/users/{username}/
Deletes a user
GET /api/2.0/users/{username}/
Users
GET /api/2.0/users/
List users.
GET /api/2.0/users/ op=whoami
POST /api/2.0/users/
This is not safe: the password is sent in plaintext. Avoid it for production, unless you are
confident that you can prevent eavesdroppers from observing the request.
MAAS version
This returns a JSON dictionary with information about this MAAS instance:
{
'version': '1.8.0',
'subversion': 'alpha10+bzr3750',
'capabilities': ['capability1', 'capability2', ...]
}
GET /api/2.0/version/
VLAN
DELETE /api/2.0/fabrics/{fabric_id}/vlans/{vid}/
PUT /api/2.0/fabrics/{fabric_id}/vlans/{vid}/
Update VLAN.
VLANs
GET /api/2.0/fabrics/{fabric_id}/vlans/
Create a VLAN.
Volume group
DELETE /api/2.0/nodes/{system_id}/volume-group/{id}/
Returns 404 if the machine or volume group is not found. Returns 409 if the machine is not
Ready.
GET /api/2.0/nodes/{system_id}/volume-group/{id}/
Returns 404 if the machine or volume group is not found. Returns 409 if the machine is not
Ready.
Returns 403 if no logical volume with id. Returns 404 if the machine or volume group is not
found. Returns 409 if the machine is not Ready.
PUT /api/2.0/nodes/{system_id}/volume-group/{id}/
Returns 404 if the machine or volume group is not found. Returns 409 if the machine is not
Ready.
Volume groups
GET /api/2.0/nodes/{system_id}/volume-groups/
POST /api/2.0/nodes/{system_id}/volume-groups/
Returns 404 if the machine is not found. Returns 409 if the machine is not Ready.
Zone
Any node is in a physical zone, or "zone" for short. The meaning of a physical zone is up to you:
it could identify e.g. a server rack, a network, or a data centre. Users can then allocate nodes from
specific physical zones, to suit their redundancy or performance requirements.
This functionality is only available to administrators. Other users can view physical zones, but
not modify them.
DELETE /api/2.0/zones/{name}/
Returns 404 if the zone is not found. Returns 204 if the zone is successfully deleted.
GET /api/2.0/zones/{name}/
PUT /api/2.0/zones/{name}/
Zones
GET /api/2.0/zones/
List zones.
POST /api/2.0/zones/
Power types
This is the list of the supported power types and their associated power parameters. Note that the
list of usable power types for a particular rack controller might be a subset of this list if the rack
controller in question is from an older version of MAAS.
ipmi (IPMI)
Power parameters:
power_driver (Power driver). Choices: 'LAN' (LAN [IPMI 1.5]), 'LAN_2_0' (LAN_2_0 [IPMI 2.0])
Default: 'LAN_2_0'.
power_address (IP address).
power_user (Power user).
power_pass (Power password).
mac_address (Power MAC).
Power parameters:
Power parameters:
vmware (VMware)
Power parameters:
Power parameters:
Power parameters:
Power parameters:
Power parameters:
Power parameters:
Power parameters:
Power parameters:
outlet_id (Outlet ID).
power_address (Power address).
power_user (Power user).
power_pass (Power password).
Power parameters:
Power parameters:
Power parameters:
Power parameters:
manual (Manual)
Power parameters:
moonshot (HP Moonshot - iLO4 (IPMI))
Power parameters:
Pod types
This is the list of the supported pod types and their associated parameters. Note that the list of
usable pod types for a particular rack controller might be a subset of this list if the rack controller
in question is from an older version of MAAS.
Parameters:
Parameters:
Note that some API endpoints support unauthenticated requests (i.e. anonymous access). See the
API documentation <api> for details.
Examples
Here are two examples on how to perform an authenticated GET request to retrieve the list of
nodes. The <key>, <secret>, <consumer_key> tokens are the three elements that compose the
API key (API key = '<consumer_key>:<key>:<secret>').
Python
import oauth.oauth as oauth
import httplib2
import uuid
oauth_request = oauth.OAuthRequest.from_consumer_and_token(
consumer_token, token=resource_token, http_url=site,
parameters={'oauth_nonce': uuid.uuid4().get_hex()})
oauth_request.sign_request(
oauth.OAuthSignatureMethod_PLAINTEXT(), consumer_token,
resource_token)
headers = oauth_request.to_header()
url = "%s%s" % (site, uri)
http = httplib2.Http()
return http.request(url, method, body=None, headers=headers)
Ruby
require 'oauth'
require 'oauth/signature/plaintext'