Skip to content

Commit 64aafaa

Browse files
billyb2github-actions[bot]
authored andcommitted
Update docs content from https://github.com/depot/app
1 parent 151bdb8 commit 64aafaa

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Diff for: content/container-builds/reference/api-overview.mdx

+37
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,43 @@ const headers = {Authorization: `Bearer ${process.env.DEPOT_TOKEN}`}
274274
await depot.build.v1.BuildService.finishBuild({buildId: 'build-id', result: {error: 'error message'}}, {headers})
275275
```
276276

277+
### Registry Service
278+
279+
Docs: [`depot.build.v1.RegistryService`](https://buf.build/depot/api/docs/main:depot.build.v1#depot.build.v1.RegistryService)
280+
281+
The Registry service provides access to the underlying registry that stores the images built by Depot. You can use this service to list and delete images.
282+
283+
### List the images for a project
284+
285+
To list the images for a project, you need to pass the ID of the project you want to list the images for. When listing more than 100 images, you can use the `pageSize` and `pageToken` fields to paginate the results.
286+
287+
```typescript
288+
const headers = {Authorization: `Bearer ${process.env.DEPOT_TOKEN}`}
289+
290+
const result = await depot.build.v1.RegistryService.listImages(
291+
{projectId: 'project-id', pageSize: 100, pageToken: undefined},
292+
{headers},
293+
)
294+
295+
console.log(result.images)
296+
console.log(result.nextPageToken)
297+
```
298+
299+
The images returned will consist of an image tag, digest, a pushedAt timestamp, and the size of the image in bytes.
300+
301+
### Delete images
302+
303+
To delete images, you need to pass the ID of the project and the list of image tags you want to removed.
304+
305+
```typescript
306+
const headers = {Authorization: `Bearer ${process.env.DEPOT_TOKEN}`}
307+
308+
await depot.build.v1.RegistryService.deleteImages(
309+
{projectId: 'project-id', imageTags: ['image-tag-1', 'image-tag-2']},
310+
{headers},
311+
)
312+
```
313+
277314
### BuildKit Service
278315

279316
Docs: [`depot.buildkit.v1.BuildKitService`](https://buf.build/depot/api/docs/main:depot.buildkit.v1#depot.buildkit.v1.BuildKitService)

0 commit comments

Comments
 (0)