How to use the Object Paths API
Introduction
In order for the AOS to provide an S3 compatible interface, it is necessary that Objects can be accessed via one or more unique paths instead of their id.
Currently, these paths comply with the standardized specifications of AWS S3 and are represented in the format
<collection-version>.<collection-name>.<project-name>/<custom-path>/<object-filename>
which resembles the S3 path-style s3://bucket/key
where:
- bucket:
<collection-version>.<collection-name>.<project-name>
- key:
<custom-path>/<object-filename>
When an object is initialized, a default path is automatically created if no custom path is specified. This also applies when creating a reference to another collection. An object is thus always accessible via at least one path in each of its collections.
Example for a default object path
- Project name:
dummy-project
- Collection name:
sample-collection
- Collection version:
None
- Object filename:
example.file
This would correspond to the path: s3://latest.sample-collection.dummy-project/example.file
Example for a custom object path
- Project name:
dummy-project
- Collection name:
sample-collection
- Collection version:
1.2.3
- Custom object path:
/my-subdir
- Object filename:
example.file
This would correspond to the path: s3://1.2.3.sample-collection.dummy-project/my-subdir/example.file
Warning
The fully qualified paths of objects are unique, which implies some conditions that must be met:
- Project and Collection names are restricted to the following characters: [a-z0-9-] (i.e. alphanumeric lowercase and hyphens)
- Project names are unique
- Collection names are unique within a project
- Objects with equal filenames cannot have the same (custom) path within a collection
Create Custom Object Path
API example for creating an additional path associated with an object.
Note
As specified in S3, you always get the latest version of an object via a path. The request of a specific object version is currently not supported.
Info
This request needs at least APPEND permissions on the Object's Collection or the Project under which the Collection is registered.
1 2 3 4 5 6 7 8 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Set Object Path visibility
API example for modifying the visibility of an objects' path.
1 2 3 4 5 6 7 8 |
|
To make the specific path visible again just use the parameter "visibility": true
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
To make the specific path visible again just use the parameter visibility: true
.
1 2 3 4 5 6 7 8 9 10 11 12 |
|
To make the specific path visible again just use the parameter visibility=True
.
Get Object Paths
API example for fetching all paths associated with an object.
Info
This request needs at least READ permissions on the Object's Collection or the Project under which the Collection is registered.
1 2 3 4 |
|
1 2 3 4 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
To fetch only all of the active paths associated with an object just use the parameter include_inactive: false
.
1 2 3 4 5 6 7 8 9 10 11 12 |
|
To fetch only all of the active paths associated with an object just use the parameter include_inactive=False
.
Get all Object Paths in Collection
API example for fetching all paths associated with the objects in a Collection.
Info
This request needs at least READ permissions on the Collection or the Project under which the Collection is registered.
1 2 3 4 |
|
1 2 3 4 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
To fetch only all of the active paths of a collection just use the parameter include_inactive: false
.
1 2 3 4 5 6 7 8 9 10 11 |
|
To fetch only all of the active paths of a collection just use the parameter include_inactiv=False
.
Get Object by Path
API example for fetching an Object associated with the specific path.
1 2 3 4 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
To fetch all revisions of an Object associated with the specific path use the parameter with_revisions: true
.
1 2 3 4 5 6 7 8 9 10 11 |
|
To fetch all revisions of an Object associated with the specific path use the parameter with_revisions=True
.