Skip to content

Commit f363431

Browse files
authored
Merge branch 'main' into add-api-ref-to-nav
2 parents 35eb524 + 22502e5 commit f363431

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/template/tags.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,31 @@ Template.remove_tags('my-template', 'staging')
144144
Removing a tag does not delete the build artifact. Other tags pointing to the same build will continue to work.
145145
</Warning>
146146

147+
### List tags
148+
149+
Retrieve all tags for a template. Each tag includes the tag name, the associated build ID, and when the tag was assigned.
150+
151+
<CodeGroup>
152+
153+
```typescript JavaScript & TypeScript
154+
import { Template } from 'e2b'
155+
156+
const tags = await Template.getTags('my-template')
157+
for (const tag of tags) {
158+
console.log(`Tag: ${tag.tag}, Build: ${tag.buildId}, Created: ${tag.createdAt}`)
159+
}
160+
```
161+
162+
```python Python
163+
from e2b import Template
164+
165+
tags = Template.get_tags('my-template')
166+
for tag in tags:
167+
print(f"Tag: {tag.tag}, Build: {tag.build_id}, Created: {tag.created_at}")
168+
```
169+
170+
</CodeGroup>
171+
147172
## Use cases
148173

149174
### Semantic versioning

0 commit comments

Comments
 (0)