16
16
Login to the web interface on your MAAS. Click on the username in the
17
17
top right corner and select 'Preferences' from the menu which appears.
20
19
.. image:: media/maascli-prefs.*
22
A new page will load...
21
A new page will load...
25
23
.. image:: media/maascli-key.*
27
25
The very first item is a list of MAAS keys. One will have already been
32
30
$ maas-cli login <profile-name> <hostname> <key>
34
The profile created is an easy way of associating your credentials with any
35
subsequent call to the API. So an example login might look like this::
37
$ maas-cli login maas http://10.98.0.13/MAAS/api/1.0 AWSCRMzqMNy:jjk...5e1FenoP82Qm5te2
39
which creates the profile 'maas' and registers it with the given key at the
40
specified API endpoint.
41
If you omit the credentials, they will be prompted for in the console. It is
42
also possible to use a hyphen, '-' in place of the credentials. In this case a
43
single line will be read from stdin, stripped of any whitespace and used as the
44
credentials, which can be useful if you are devolping scripts for specific
46
If an empty string is passed instead of the credentials, the profile will be
47
logged in anonymously (and consequently some of the API calls will not be
32
The profile created is an easy way of associating your credentials
33
with any subsequent call to the API. So an example login might look
36
$ maas-cli login maas http://10.98.0.13/MAAS/api/1.0
37
AWSCRMzqMNy:jjk...5e1FenoP82Qm5te2
39
which creates the profile 'maas' and registers it with the given key
40
at the specified API endpoint. If you omit the credentials, they will
41
be prompted for in the console. It is also possible to use a hyphen,
42
'-' in place of the credentials. In this case a single line will be
43
read from stdin, stripped of any whitespace and used as the
44
credentials, which can be useful if you are devolping scripts for
45
specific tasks. If an empty string is passed instead of the
46
credentials, the profile will be logged in anonymously (and
47
consequently some of the API calls will not be available)
159
156
Releases the node given by *<system_id>*
161
158
:samp:`start <system_id>`
163
160
Powers up the node identified by *<system_id>* (where MAAS has
164
161
information for power management for this node).
166
163
:samp:`stop <system_id>`
168
165
Powers off the node identified by *<system_id>* (where MAAS has
169
166
information for power management for this node).
171
168
:samp:`delete <system_id>`
173
170
Removes the given node from the MAAS database.
175
172
:samp:`read <system_id>`
177
174
Returns all the current known information about the node specified
180
177
:samp:`update <system_id> [parameters...]`
182
179
Used to change or set specific values for the node. The valid
183
180
parameters are listed below::
186
183
The new hostname for this node.
189
186
Sets the architecture type, where <value>
190
187
is a string containing a valid architecture type,
191
188
e.g. "i386/generic"
193
190
distro_series=<value>
194
Sets the series of Ubuntu to use.
197
Sets the type of power management used on the node, e.g. "ipmi" or
200
power_parameters_{param1}... =<value>
201
Set the given power parameters. Note that the valid options for these
191
Sets the distro series of Ubuntu to use (e.g. "precise").
194
Apply the given dotted decimal value as the broadcast IP address
197
power_parameters_{param1}... =<value>
198
Set the given power parameters. Note that the valid options for these
202
199
depend on the power type chosen.
204
power_parameters_skip_check 'true' | 'false'
205
Whether to sanity check the supplied parameters against this node's
201
power_parameters_skip_check 'true' | 'false'
202
Whether to sanity check the supplied parameters against this node's
206
203
declared power type. The default is 'false'.
212
208
Example: Setting the power parameters for an ipmi enabled node::
320
313
Disables the SSL certificate check.
322
315
:samp:`register uuid=<value> name=<value> interfaces=<json_string>`
324
317
Registers a new node group with the given name and uuid. The
325
318
interfaces parameter must be supplied in the form of a JSON string
326
319
comprising the key/value data for the interface to be used, for
356
348
node-group-interface
357
349
^^^^^^^^^^^^^^^^^^^^
358
For managing the interfaces. See also
359
:ref:`node_group_interfaces <node_group_interfaces>`
350
For managing the interfaces. See also :ref:`node-group-interfaces`
361
Usage: maas-cli *<profile>* node-group-interface [-d --debug] [-h
352
Usage: maas-cli *<profile>* node-group-interfaces [-d --debug] [-h
362
353
--help] [-k --insecure] read | update | delete [parameters...]
364
355
..program:: maas-cli node-group-interface
366
357
:samp:`read <uuid> <interface>`
368
359
Returns the current settings for the given UUID and interface
370
361
:samp:`update [parameters]`
372
363
Changes the settings for the interface according to the given
375
366
management= 0 | 1 | 2
376
The service to be managed on the interface ( 0= none, 1=DHCP, 2=DHCP
367
The service to be managed on the interface ( 0= none, 1=DHCP, 2=DHCP
379
370
subnet_mask=<value>
380
371
Apply the given dotted decimal value as the subnet mask.
382
373
broadcast_ip=<value>
383
Apply the given dotted decimal value as the broadcast IP address for
374
Apply the given dotted decimal value as the broadcast IP address for
386
377
router_ip=<value>
387
Apply the given dotted decimal value as the default router address
378
Apply the given dotted decimal value as the default router address
390
381
ip_range_low=<value>
391
382
The lowest value of IP address to allocate via DHCP
393
384
ip_range_high=<value>
394
The highest value of IP address to allocate via DHCP
385
The highest value of IP address to allocate via DHCP
396
387
:samp:`delete <uuid> <interface>`
398
389
Removes the entry for the given UUID and interface.
403
394
Configuring DHCP and DNS.
405
To enable MAAS to manage DHCP and DNS, it needs to be supplied with the relevant
396
To enable MAAS to manage DHCP and DNS, it needs to be supplied with the relevant
406
397
interface information. To do this we need to first determine the UUID of the
407
398
node group affected::
409
400
$ uuid=$(maas-cli <profile> node-groups list | grep uuid | cut -d\" -f4)
411
402
Once we have the UUID we can use this to update the node-group-interface for
412
403
that nodegroup, and pass it the relevant interface details::
418
409
broadcast_ip=192.168.123.255 \
419
410
router_ip=192.168.123.1 \
421
Replacing the example values with those required for this network. The only
422
non-obvious parameter is 'management' which takes the values 0 (no management), 1
423
(manage DHCP) and 2 (manage DHCP and DNS).
412
Replacing the example values with those required for this network. The
413
only non-obvious parameter is 'management' which takes the values 0
414
(no management), 1 (manage DHCP) and 2 (manage DHCP and DNS).
426
417
.. _node-group-interfaces:
427
419
node-group-interfaces
428
420
^^^^^^^^^^^^^^^^^^^^^
452
444
Lists the current stored configurations for the given identifier
453
445
<label> in a key:value format which should be easy to decipher.
456
447
:samp:`new <label> ip=<value> interface=<if_device> [parameters...]`
458
449
Creates a new interface group. The required parameters are the IP
459
450
address and the network interface this appies to (e.g. eth0). In
460
451
order to do anything useful, further parameters are required::
462
management= 0 | 1 | 2
453
management= 0 | 1 | 2
463
454
The service to be managed on the interface
464
455
( 0= none, 1=DHCP, 2=DHCP and DNS).
466
457
subnet_mask=<value>
467
458
Apply the given dotted decimal value as the subnet mask.
470
461
Apply the given dotted decimal value as the
471
462
broadcast IP address for this subnet.
474
465
Apply the given dotted decimal value as the
475
466
default router address for this subnet.
481
472
The highest value of IP address to allocate via DHCP
489
Usage: maas-cli <profile> tag read | update-nodes | rebuild | update |
477
The tag command is used to manually alter tags, tagged nodes or
478
rebuild the automatic tags.
480
For more information on how to use them effectively, please see
483
Usage: maas-cli <profile> tag read | update-nodes | rebuild
484
| update | nodes | delete
492
487
.. program:: maas-cli tag
494
489
:samp:`read <tag_name>`
496
491
Returns information on the tag specified by <name>
498
:samp:`update-nodes <tag_name> [add=<system_id>] [remove=<system_id>] [nodegroup=<system_id>]`
493
:samp:`update-nodes <tag_name> [add=<system_id>] [remove=<system_id>]
494
[nodegroup=<system_id>]`
500
496
Applies or removes the given tag from a list of nodes specified by
501
497
either or both of add="<system_id>" and remove="<system_id>". The
508
Triggers a rebuild of the tag to node mapping.
510
:samp:`update <tag_name> [name=<value>] | [comment=<value>]|[definition=<value>]`
504
Triggers a rebuild of the tag to node mapping.
506
:samp:`update <tag_name> [name=<value>] | [comment=<value>]|
507
[definition=<value>]`
512
509
Updates the tag identified by tag_name. Any or all of name,comment
513
510
and definition may be supplied as parameters. If no parameters are
514
511
supplied, this command returns the current values.
522
519
Deletes the given tag.
526
Tags are a really useful way of identifying nodes with particular
529
.. only:: html For more information on how to use them effectively, please see :ref:`deploy-tags`
525
Tags are a really useful way of identifying nodes with particular
530
For more information on how to use them effectively, please see
531
533
Usage: maas-cli <profile> tag [-d --debug] [-h --help] [-k
532
--insecure] list | new
534
--insecure] list | create
534
536
.. program:: maas-cli tag
536
538
:samp:`-d, --debug`
538
540
Displays debug information listing the API responses.
540
542
:samp:`-h, --help`
542
544
Display usage information.
544
:samp:`-k, --insecure`
546
:samp:`-k, --insecure`
546
548
Disables the SSL certificate check.
550
552
Returns a JSON object listing all the current tags known by the MAAS server
552
554
:samp:`create name=<value> definition=<value> [comment=<value>]`
554
556
Creates a new tag with the given name and definition. A comment is
555
557
optional. Names must be unique, obviously - an error will be
556
returned if the given name already exists. The definition is in the form of
557
an XPath expression which parses the XML returned by running ``lshw`` on the
558
returned if the given name already exists. The definition is in the
559
form of an XPath expression which parses the XML returned by
560
running ``lshw`` on the node.
561
563
Adding a tag to all nodes which have an Intel GPU::
563
565
$ maas-cli maas tags new name='intel-gpu' \
564
566
comment='Machines which have an Intel display driver' \
565
definition='contains(//node[@id="display"]/vendor, "Intel")
567
definition='contains(//node[@id="display"]/vendor, "Intel")'
570
573
Because the ``maas-cli`` command exposes all of the API, it also lists
571
574
some command options which are not really intended for end users, such
572
575
as the "file" and "boot-images" options.