Returns a ResourceList of tags. The default is the first 20 tags, but appending .all() returns an object representing all matching tags.

The examples below demonstrate how to use .all() and list slicing to obtain the tags you want.

Required arguments

None

Optional keyword arguments

NameTypeDescriptionRequired?
query string When specified, the API returns only tags containing the specified string. false
sort string The attribute to sort returned tags by. name and created_at are valid. The default sort order is ascending. To sort the tags in descending order, include a minus sign (for example, -name). false

Returns

A ResourceList of tag models.

If you append a list slicing operator ([]), the SDK returns a Python generator. You can iterate over a generator as you would a list.

Examples

Example 1 returns all tags, or the first 20 if there are more than 20.

tags = apiclient.tags.list()

Example 2 returns all tags as a ResourceList.

tags = apiclient.tags.list().all()