Skip to content

Commit

Permalink
deploy: 20eeba6
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Oct 28, 2024
1 parent bc32081 commit a02171d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions artifact-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,25 @@ get_url = await artifact_manager.get_file(prefix="collections/dataset-gallery/ex

---

### `list_files(prefix: str, dir_path: str=None) -> list`

Lists all files in the artifact.

**Parameters:**

- `prefix`: The path of the artifact, it can be a prefix relative to the current workspace (e.g., `"collections/dataset-gallery/example-dataset"`) or an absolute prefix with the workspace id (e.g., `"/my_workspace_id/collections/dataset-gallery/example-dataset"`).
- `dir_path`: Optional. The directory path within the artifact to list files. Default is `None`.

**Returns:** A list of files in the artifact.

**Example:**

```python
files = await artifact_manager.list_files(prefix="collections/dataset-gallery/example-dataset")
```

---

### `read(prefix: str, stage: bool = False, silent: bool = False) -> dict`

Reads and returns the manifest of an artifact or collection. If in staging mode, reads from `_manifest.yaml`.
Expand Down Expand Up @@ -547,6 +566,7 @@ The `Artifact Manager` provides an HTTP endpoint for retrieving artifact manifes

- `/{workspace}/artifacts/{prefix:path}` for fetching the artifact manifest.
- `/{workspace}/artifacts/{prefix:path}/__children__` for listing all artifacts in a collection.
- `/{workspace}/artifacts/{prefix:path}/__files__` for listing all files in the artifact.
- `/{workspace}/artifacts/{prefix:path}/__files__/{file_path:path}` for downloading a file from the artifact (will be redirected to a pre-signed URL).

### Path Parameters:
Expand All @@ -572,6 +592,8 @@ For `/{workspace}/artifacts/{prefix:path}`, the response will be a JSON object r

For `/{workspace}/artifacts/{prefix:path}/__children__`, the response will be a list of artifacts in the collection.

For `/{workspace}/artifacts/{prefix:path}/__files__`, the response will be a list of files in the artifact, each file is a dictionary with the `name` and `type` fields.

For `/{workspace}/artifacts/{prefix:path}/__files__/{file_path:path}`, the response will be a pre-signed URL to download the file.

### Example: Fetching a public artifact with download statistics
Expand Down

0 comments on commit a02171d

Please sign in to comment.