Merge lp:~mpontillo/maas/update-constraints-docs--bugs-1637182-1637009 into lp:maas/trunk

Proposed by Mike Pontillo on 2016-10-28
Status: Merged
Approved by: Mike Pontillo on 2016-10-31
Approved revision: 5524
Merged at revision: 5522
Proposed branch: lp:~mpontillo/maas/update-constraints-docs--bugs-1637182-1637009
Merge into: lp:maas/trunk
Diff against target: 178 lines (+122/-34)
1 file modified
src/maasserver/api/machines.py (+122/-34)
To merge this branch: bzr merge lp:~mpontillo/maas/update-constraints-docs--bugs-1637182-1637009
Reviewer Review Type Date Requested Status
Mike Pontillo Approve on 2016-10-31
Review via email: mp+309617@code.launchpad.net

Commit Message

Fix documentation for 'machines acquire' related to constraints.

To post a comment you must log in.
Mike Pontillo (mpontillo) wrote :

Self-approving documentation-only change.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/api/machines.py'
2--- src/maasserver/api/machines.py 2016-10-27 20:07:05 +0000
3+++ src/maasserver/api/machines.py 2016-10-28 21:42:12 +0000
4@@ -1095,16 +1095,103 @@
5 multiple constraints are provided, they are combined using 'AND'
6 semantics.
7
8- :param name: Hostname of the desired machine.
9+ :param name: Hostname or FQDN of the desired machine. If a FQDN is
10+ specified, both the domain and the hostname portions must match.
11 :type name: unicode
12 :param system_id: system_id of the desired machine.
13 :type system_id: unicode
14 :param arch: Architecture of the returned machine (e.g. 'i386/generic',
15 'amd64', 'armhf/highbank', etc.).
16- :type arch: unicode
17- :param cpu_count: The minium number of CPUs the returned machine must
18- have.
19- :type cpu_count: int
20+
21+ If multiple architectures are specified, the machine to acquire may
22+ match any of the given architectures. To request multiple
23+ architectures, this parameter must be repeated in the request with
24+ each value.
25+ :type arch: unicode (accepts multiple)
26+ :param cpu_count: Minimum number of CPUs a returned machine must have.
27+
28+ A machine with additional CPUs may be allocated if there is no
29+ exact match, or if the 'mem' constraint is not also specified.
30+ :type cpu_count: positive integer
31+ :param mem: The minimum amount of memory (expressed in MB) the
32+ returned machine must have. A machine with additional memory may
33+ be allocated if there is no exact match, or the 'cpu_count'
34+ constraint is not also specified.
35+ :type mem: positive integer
36+ :param tags: Tags the machine must match in order to be acquired.
37+
38+ If multiple tag names are specified, the machine must be
39+ tagged with all of them. To request multiple tags, this parameter
40+ must be repeated in the request with each value.
41+ :type tags: unicode (accepts multiple)
42+ :param not_tags: Tags the machine must NOT match.
43+
44+ If multiple tag names are specified, the machine must NOT be
45+ tagged with ANY of them. To request exclusion of multiple tags,
46+ this parameter must be repeated in the request with each value.
47+ :type tags: unicode (accepts multiple)
48+ :param zone: Physical zone name the machine must be located in.
49+ :type zone: unicode
50+ :type not_in_zone: List of physical zones from which the machine must
51+ not be acquired.
52+
53+ If multiple zones are specified, the machine must NOT be
54+ associated with ANY of them. To request multiple zones to
55+ exclude, this parameter must be repeated in the request with each
56+ value.
57+ :type not_in_zone: unicode (accepts multiple)
58+ :param subnets: Subnets that must be linked to the machine.
59+
60+ "Linked to" means the node must be configured to acquire an address
61+ in the specified subnet, have a static IP address in the specified
62+ subnet, or have been observed to DHCP from the specified subnet
63+ during commissioning time (which implies that it *could* have an
64+ address on the specified subnet).
65+
66+ Subnets can be specified by one of the following criteria:
67+
68+ - <id>: match the subnet by its 'id' field
69+ - fabric:<fabric-spec>: match all subnets in a given fabric.
70+ - ip:<ip-address>: Match the subnet containing <ip-address> with
71+ the with the longest-prefix match.
72+ - name:<subnet-name>: Match a subnet with the given name.
73+ - space:<space-spec>: Match all subnets in a given space.
74+ - vid:<vid-integer>: Match a subnet on a VLAN with the specified
75+ VID. Valid values range from 0 through 4094 (inclusive). An
76+ untagged VLAN can be specified by using the value "0".
77+ - vlan:<vlan-spec>: Match all subnets on the given VLAN.
78+
79+ Note that (as of this writing), the 'fabric', 'space', 'vid', and
80+ 'vlan' specifiers are only useful for the 'not_spaces' version of
81+ this constraint, because they will most likely force the query
82+ to match ALL the subnets in each fabric, space, or VLAN, and thus
83+ not return any nodes. (This is not a particularly useful behavior,
84+ so may be changed in the future.)
85+
86+ If multiple subnets are specified, the machine must be associated
87+ with all of them. To request multiple subnets, this parameter must
88+ be repeated in the request with each value.
89+
90+ Note that this replaces the leagcy 'networks' constraint in MAAS
91+ 1.x.
92+ :type subnets: unicode (accepts multiple)
93+ :param not_subnets: Subnets that must NOT be linked to the machine.
94+
95+ See the 'subnets' constraint documentation above for more
96+ information about how each subnet can be specified.
97+
98+ If multiple subnets are specified, the machine must NOT be
99+ associated with ANY of them. To request multiple subnets to
100+ exclude, this parameter must be repeated in the request with each
101+ value. (Or a fabric, space, or VLAN specifier may be used to match
102+ multiple subnets).
103+
104+ Note that this replaces the leagcy 'not_networks' constraint in
105+ MAAS 1.x.
106+ :type not_subnets: unicode (accepts multiple)
107+ :param storage: A list of storage constraint identifiers, in the form:
108+ <label>:<size>(<tag>[,<tag>[,...])][,<label>:...]
109+ :type storage: unicode
110 :param interfaces: A labeled constraint map associating constraint
111 labels with interface properties that should be matched. Returned
112 nodes must have one or more interface matching the specified
113@@ -1135,35 +1222,36 @@
114 - vid: Matches an interface on a VLAN with the specified VID.
115 - tag: Matches an interface tagged with the specified tag.
116 :type interfaces: unicode
117- :param mem: The minimum amount of memory (expressed in MB) the
118- returned machine must have.
119- :type mem: float
120- :param tags: List of tags the returned machine must have.
121- :type tags: list of unicodes
122- :param not_tags: List of tags the acquired machine must not have.
123- :type tags: List of unicodes.
124- :param networks: List of networks (defined in MAAS) to which the
125- machine must be attached. A network can be identified by the name
126- assigned to it in MAAS; or by an `ip:` prefix followed by any IP
127- address that falls within the network; or a `vlan:` prefix
128- followed by a numeric VLAN tag, e.g. `vlan:23` for VLAN number 23.
129- Valid VLAN tags must be in the range of 1 to 4094 inclusive.
130- :type networks: list of unicodes
131- :param not_networks: List of networks (defined in MAAS) to which the
132- machine must not be attached. The returned machine won't be
133- attached to any of the specified networks. A network can be
134- identified by the name assigned to it in MAAS; or by an `ip:`
135- prefix followed by any IP address that falls within the network; or
136- a `vlan:` prefix followed by a numeric VLAN tag, e.g. `vlan:23` for
137- VLAN number 23. Valid VLAN tags must be in the range of 1 to 4094
138- inclusive.
139- :type not_networks: list of unicodes
140- :param zone: An optional name for a physical zone the acquired
141- machine should be located in.
142- :type zone: unicode
143- :type not_in_zone: Optional list of physical zones from which the
144- machine should not be acquired.
145- :type not_in_zone: List of unicodes.
146+ :param fabrics: Set of fabrics that the machine must be associated with
147+ in order to be acquired.
148+
149+ If multiple fabrics names are specified, the machine can be
150+ in any of the specified fabrics. To request multiple possible
151+ fabrics to match, this parameter must be repeated in the request
152+ with each value.
153+ :type fabrics: unicode (accepts multiple)
154+ :param not_fabrics: Fabrics the machine must NOT be associated with in
155+ order to be acquired.
156+
157+ If multiple fabrics names are specified, the machine must NOT be
158+ in ANY of them. To request exclusion of multiple fabrics, this
159+ parameter must be repeated in the request with each value.
160+ :type not_fabrics: unicode (accepts multiple)
161+ :param fabric_classes: Set of fabric class types whose fabrics the
162+ machine must be associated with in order to be acquired.
163+
164+ If multiple fabrics class types are specified, the machine can be
165+ in any matching fabric. To request multiple possible fabrics class
166+ types to match, this parameter must be repeated in the request
167+ with each value.
168+ :type fabric_classes: unicode (accepts multiple)
169+ :param not_fabric_classes: Fabric class types whose fabrics the machine
170+ must NOT be associated with in order to be acquired.
171+
172+ If multiple fabrics names are specified, the machine must NOT be
173+ in ANY of them. To request exclusion of multiple fabrics, this
174+ parameter must be repeated in the request with each value.
175+ :type not_fabric_classes: unicode (accepts multiple)
176 :param agent_name: An optional agent name to attach to the
177 acquired machine.
178 :type agent_name: unicode