add_tags
Add or replace tags associated with a deployment. Learn more about organizing deployments with tags.
Parameters
mb.add_tags(deployment=..., tags=, ...)
deployment
:str
The name of the deployment to update.tags
:List[str]
A list of tags to assign to the deployment.overwrite
:Optional[bool]
WhenFalse
, the tags in this request will be appended to any existing tags on the deployment. WhenTrue
the deployment's tags will be replaces with the tags in this request. The default isFalse
.branch
:Optional[str]
: The branch of the deployment to update. By default it's the current branch of the session.
Returns
No value is returned. A success message is printed if the tags are updated. An exception is raised if the deployment is not found.
Examples
For the following examples, assume a deployment named example_deployment
exists in the workspace.
Adding tags to a deployment
Specify one or more tags to append to the deployment with tags=
:
mb.add_tags(deployment="example_deployment", tags=["project_foo", "another tag"])
After this call the the tags on example_deployment
will include project_foo
and another tag
, in addition to any tags previously added to the deployment.
Replace existing tags with a new list
Use overwrite=True
to replace any existing tags on the deployment with new tags:
mb.add_tags(deployment="example_deployment", tags=["my_project"], overwrite=True)
After this call the only tags on example_deployment
will be my_project
.