---
title: Tag
description: Canonical makes open source secure, reliable and easy to use, providing
  support for Ubuntu and a portfolio of enterprise-grade technologies. Founded in
  2004, Canonical operates globally with team members in over 80 countries.
url: https://canonical-com-2934.demos.haus/maas/docs/tag?format=md
---

*Submit*

# Tag

Enter keyword arguments in the form `key=value`.

## [Delete a tag](https://canonical-com-2934.demos.haus/maas/docs/tag?format=md#p-14454-delete-a-tag)

```
maas $PROFILE tag delete [--help] [-d] [-k] name [data ...]
```

#### Positional arguments

* name

Deletes a tag by name.

#### Command-line options

| Option | Effect |
| --- | --- |
| –help, -h | Show this help message and exit. |
| -d, --debug | Display more information about API responses. |
| -k, --insecure | Disable SSL certificate check |

## [List devices by tag](https://canonical-com-2934.demos.haus/maas/docs/tag?format=md#p-14454-list-devices-by-tag)

```
maas $PROFILE tag devices [--help] [-d] [-k] name [data ...]
```

#### Positional arguments

* name

Get a JSON list containing device objects that match the given tag name.

#### Command-line options

| Option | Effect |
| --- | --- |
| –help, -h | Show this help message and exit. |
| -d, --debug | Display more information about API responses. |
| -k, --insecure | Disable SSL certificate check |

## [List machines by tag](https://canonical-com-2934.demos.haus/maas/docs/tag?format=md#p-14454-list-machines-by-tag)

```
maas $PROFILE tag machines [--help] [-d] [-k] name [data ...]
```

#### Positional arguments

* name

Get a JSON list containing machine objects that match the given tag name.

#### Command-line options

| Option | Effect |
| --- | --- |
| –help, -h | Show this help message and exit. |
| -d, --debug | Display more information about API responses. |
| -k, --insecure | Disable SSL certificate check |

## [List nodes by tag](https://canonical-com-2934.demos.haus/maas/docs/tag?format=md#p-14454-list-nodes-by-tag)

```
maas $PROFILE tag nodes [--help] [-d] [-k] name [data ...]
```

#### Positional arguments

* name

Get a JSON list containing node objects that match the given tag name.

#### Command-line options

| Option | Effect |
| --- | --- |
| –help, -h | Show this help message and exit. |
| -d, --debug | Display more information about API responses. |
| -k, --insecure | Disable SSL certificate check |

## [List rack controllers by tag](https://canonical-com-2934.demos.haus/maas/docs/tag?format=md#p-14454-list-rack-controllers-by-tag)

```
maas $PROFILE tag rack-controllers [--help] [-d] [-k] name [data ...]
```

#### Positional arguments

* name

Get a JSON list containing rack-controller objectsthat match the given tag name.

#### Command-line options

| Option | Effect |
| --- | --- |
| –help, -h | Show this help message and exit. |
| -d, --debug | Display more information about API responses. |
| -k, --insecure | Disable SSL certificate check |

## [Read a specific tag](https://canonical-com-2934.demos.haus/maas/docs/tag?format=md#p-14454-read-a-specific-tag)

```
maas $PROFILE tag read [--help] [-d] [-k] name [data ...]
```

#### Positional arguments

* name

Returns a JSON object containing information about a specific tag.

#### Command-line options

| Option | Effect |
| --- | --- |
| –help, -h | Show this help message and exit. |
| -d, --debug | Display more information about API responses. |
| -k, --insecure | Disable SSL certificate check |

## [Trigger a tag-node mapping rebuild](https://canonical-com-2934.demos.haus/maas/docs/tag?format=md#p-14454-trigger-a-tag-node-mapping-rebuild)

```
maas $PROFILE tag rebuild [--help] [-d] [-k] name [data ...]
```

#### Positional arguments

* name

Tells MAAS to rebuild the tag-to-node mappings. This is a maintenance operation and should not be necessary under normal circumstances. Adding nodes or updating a tag definition should automatically trigger the mapping rebuild.

#### Command-line options

| Option | Effect |
| --- | --- |
| –help, -h | Show this help message and exit. |
| -d, --debug | Display more information about API responses. |
| -k, --insecure | Disable SSL certificate check |

## [List region controllers by tag](https://canonical-com-2934.demos.haus/maas/docs/tag?format=md#p-14454-list-region-controllers-by-tag)

```
maas $PROFILE tag region-controllers [--help] [-d] [-k] name [data ...]
```

#### Positional arguments

* name

Get a JSON list containing region-controller objects that match the given tag name.

#### Command-line options

| Option | Effect |
| --- | --- |
| –help, -h | Show this help message and exit. |
| -d, --debug | Display more information about API responses. |
| -k, --insecure | Disable SSL certificate check |

## [Update a tag](https://canonical-com-2934.demos.haus/maas/docs/tag?format=md#p-14454-update-a-tag)

```
maas $PROFILE tag update [--help] [-d] [-k] name [data ...]
```

#### Positional arguments

* name

Update elements of a given tag.

#### Keyword “name”

Optional String. The new tag name. Because the name will be used in urls, it should be short.

#### Keyword “comment”

Optional String. A description of what the the tag will be used for in natural language.

#### Keyword “definition”

Optional String. An XPATH query that is evaluated against the hardware\_details stored for all nodes (i.e. the output of `lshw -xml`).

#### Command-line options

| Option | Effect |
| --- | --- |
| –help, -h | Show this help message and exit. |
| -d, --debug | Display more information about API responses. |
| -k, --insecure | Disable SSL certificate check |

## [Update nodes associated with this tag](https://canonical-com-2934.demos.haus/maas/docs/tag?format=md#p-14454-update-nodes-associated-with-this-tag)

```
maas $PROFILE tag update-nodes [--help] [-d] [-k] name [data ...]
```

#### Positional arguments

* name

Add or remove nodes associated with the given tag. Note that you must supply either the `add` or `remove` parameter.

#### Keyword “add”

Optional String. The system\_id to tag.

#### Keyword “remove”

Optional String. The system\_id to untag.

#### Keyword “definition”

Optional String. If given, the definition (XPATH expression) will be validated against the current definition of the tag. If the value does not match, MAAS assumes the worker is out of date and will drop the update.

#### Keyword “rack\_controller”

Optional String. The system ID of the rack controller that processed the given tag initially. If not given, the requester must be a MAAS admin. If given, the requester must be the rack controller.

#### Command-line options

| Option | Effect |
| --- | --- |
| –help, -h | Show this help message and exit. |
| -d, --debug | Display more information about API responses. |
| -k, --insecure | Disable SSL certificate check |

## [List tags](https://canonical-com-2934.demos.haus/maas/docs/tag?format=md#p-14454-list-tags)

```
maas $PROFILE tags read [--help] [-d] [-k] [data ...]
```

Outputs a JSON object containing an array of all currently defined tag objects.

#### Command-line options

| Option | Effect |
| --- | --- |
| –help, -h | Show this help message and exit. |
| -d, --debug | Display more information about API responses. |
| -k, --insecure | Disable SSL certificate check |

---

[Previous

subnet](https://canonical-com-2934.demos.haus/maas/docs/subnet)
[Next

user](https://canonical-com-2934.demos.haus/maas/docs/user)

Last updated 1 year, 5 months ago. [Help improve this document in the forum](https://discourse.maas.io/t/tag/6941).
