Skip to main content

get_tags

Get the list of tags associated with a deployment. Learn more about organizing deployments with tags.

Parameters

mb.get_tags(deployment=...)
  • deployment: str The name of the deployment to inspect when fetching tags.
  • branch: Optional[str]: The branch of the deployment. By default it's the current branch of the session.

Returns

List[str]. If the deployment doesn't have any tags then an empty list is returned.

Examples

For the following examples, assume a deployment named example_deployment exists in the workspace.

Getting the tags for a deployment

Fetching the tags associated with a deployment on the current branch:

mb.get_tags(deployment="example_deployment")

Setting then getting the list of tags for a deployment

To see that tags were updated on a deployment, fetch the tags after adding them:

mb.add_tags(deployment="example_deployment", tags=["my_project"])
mb.get_tags(deployment="example_deployment")

This call would return ["my_project"].

See also