estuary-client.CollectionsApi
All URIs are relative to https://api.estuary.tech
Method | HTTP request | Description |
---|---|---|
collections_coluuid_commit_post | POST /collections/{coluuid}/commit | Produce a CID of the collection contents |
collections_coluuid_contents_delete | DELETE /collections/{coluuid}/contents | Deletes a content from a collection |
collections_coluuid_delete | DELETE /collections/{coluuid} | Deletes a collection |
collections_coluuid_get | GET /collections/{coluuid} | Get contents in a collection |
collections_coluuid_post | POST /collections/{coluuid} | Add contents to a collection |
collections_fs_add_post | POST /collections/fs/add | Add a file to a collection |
collections_get | GET /collections/ | List all collections |
collections_post | POST /collections/ | Create a new collection |
collections_coluuid_commit_post
str collections_coluuid_commit_post(coluuid)
Produce a CID of the collection contents
This endpoint is used to save the contents in a collection, producing a top-level CID that references all the current CIDs in the collection.
Example
from __future__ import print_function
import time
import estuary-client
from estuary-client.rest import ApiException
from pprint import pprint
# Configure API key authorization: bearerAuth
configuration = estuary-client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = estuary-client.CollectionsApi(estuary-client.ApiClient(configuration))
coluuid = 'coluuid_example' # str | coluuid
try:
# Produce a CID of the collection contents
api_response = api_instance.collections_coluuid_commit_post(coluuid)
pprint(api_response)
except ApiException as e:
print("Exception when calling CollectionsApi->collections_coluuid_commit_post: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
coluuid | str | coluuid |
Return type
str
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
collections_coluuid_contents_delete
str collections_coluuid_contents_delete(coluuid, contentid, body)
Deletes a content from a collection
This endpoint is used to delete an existing content from an existing collection. If two or more files with the same contentid exist in the collection, delete the one in the specified path
Example
from __future__ import print_function
import time
import estuary-client
from estuary-client.rest import ApiException
from pprint import pprint
# Configure API key authorization: bearerAuth
configuration = estuary-client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = estuary-client.CollectionsApi(estuary-client.ApiClient(configuration))
coluuid = 'coluuid_example' # str | Collection ID
contentid = 'contentid_example' # str | Content ID
body = estuary-client.MainDeleteContentFromCollectionBody() # MainDeleteContentFromCollectionBody | Variable to use when filtering for files (must be either 'path' or 'content_id')
try:
# Deletes a content from a collection
api_response = api_instance.collections_coluuid_contents_delete(coluuid, contentid, body)
pprint(api_response)
except ApiException as e:
print("Exception when calling CollectionsApi->collections_coluuid_contents_delete: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
coluuid | str | Collection ID | |
contentid | str | Content ID | |
body | MainDeleteContentFromCollectionBody | Variable to use when filtering for files (must be either 'path' or 'content_id') |
Return type
str
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
collections_coluuid_delete
collections_coluuid_delete(coluuid)
Deletes a collection
This endpoint is used to delete an existing collection.
Example
from __future__ import print_function
import time
import estuary-client
from estuary-client.rest import ApiException
from pprint import pprint
# Configure API key authorization: bearerAuth
configuration = estuary-client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = estuary-client.CollectionsApi(estuary-client.ApiClient(configuration))
coluuid = 'coluuid_example' # str | Collection ID
try:
# Deletes a collection
api_instance.collections_coluuid_delete(coluuid)
except ApiException as e:
print("Exception when calling CollectionsApi->collections_coluuid_delete: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
coluuid | str | Collection ID |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
collections_coluuid_get
str collections_coluuid_get(coluuid, dir=dir)
Get contents in a collection
This endpoint is used to get contents in a collection. If no colpath query param is passed
Example
from __future__ import print_function
import time
import estuary-client
from estuary-client.rest import ApiException
from pprint import pprint
# Configure API key authorization: bearerAuth
configuration = estuary-client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = estuary-client.CollectionsApi(estuary-client.ApiClient(configuration))
coluuid = 'coluuid_example' # str | coluuid
dir = 'dir_example' # str | Directory (optional)
try:
# Get contents in a collection
api_response = api_instance.collections_coluuid_get(coluuid, dir=dir)
pprint(api_response)
except ApiException as e:
print("Exception when calling CollectionsApi->collections_coluuid_get: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
coluuid | str | coluuid | |
dir | str | Directory | [optional] |
Return type
str
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
collections_coluuid_post
dict(str, str) collections_coluuid_post(coluuid, content_i_ds)
Add contents to a collection
This endpoint adds already-pinned contents (that have ContentIDs) to a collection.
Example
from __future__ import print_function
import time
import estuary-client
from estuary-client.rest import ApiException
from pprint import pprint
# Configure API key authorization: bearerAuth
configuration = estuary-client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = estuary-client.CollectionsApi(estuary-client.ApiClient(configuration))
coluuid = 'coluuid_example' # str | coluuid
content_i_ds = [estuary-client.list[int]()] # list[int] | Content IDs to add to collection
try:
# Add contents to a collection
api_response = api_instance.collections_coluuid_post(coluuid, content_i_ds)
pprint(api_response)
except ApiException as e:
print("Exception when calling CollectionsApi->collections_coluuid_post: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
coluuid | str | coluuid | |
content_i_ds | list[int] | Content IDs to add to collection |
Return type
dict(str, str)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
collections_fs_add_post
collections_fs_add_post(coluuid, content, path)
Add a file to a collection
This endpoint adds a file to a collection
Example
from __future__ import print_function
import time
import estuary-client
from estuary-client.rest import ApiException
from pprint import pprint
# Configure API key authorization: bearerAuth
configuration = estuary-client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = estuary-client.CollectionsApi(estuary-client.ApiClient(configuration))
coluuid = 'coluuid_example' # str | Collection ID
content = 'content_example' # str | Content
path = 'path_example' # str | Path to file
try:
# Add a file to a collection
api_instance.collections_fs_add_post(coluuid, content, path)
except ApiException as e:
print("Exception when calling CollectionsApi->collections_fs_add_post: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
coluuid | str | Collection ID | |
content | str | Content | |
path | str | Path to file |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
collections_get
list[CollectionsCollection] collections_get()
List all collections
This endpoint is used to list all collections. Whenever a user logs on estuary, it will list all collections that the user has access to. This endpoint provides a way to list all collections to the user.
Example
from __future__ import print_function
import time
import estuary-client
from estuary-client.rest import ApiException
from pprint import pprint
# Configure API key authorization: bearerAuth
configuration = estuary-client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = estuary-client.CollectionsApi(estuary-client.ApiClient(configuration))
try:
# List all collections
api_response = api_instance.collections_get()
pprint(api_response)
except ApiException as e:
print("Exception when calling CollectionsApi->collections_get: %s\n" % e)
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
collections_post
CollectionsCollection collections_post(body)
Create a new collection
This endpoint is used to create a new collection. A collection is a representaion of a group of objects added on the estuary. This endpoint can be used to create a new collection.
Example
from __future__ import print_function
import time
import estuary-client
from estuary-client.rest import ApiException
from pprint import pprint
# Configure API key authorization: bearerAuth
configuration = estuary-client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = estuary-client.CollectionsApi(estuary-client.ApiClient(configuration))
body = estuary-client.MainCreateCollectionBody() # MainCreateCollectionBody | Collection name and description
try:
# Create a new collection
api_response = api_instance.collections_post(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling CollectionsApi->collections_post: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
body | MainCreateCollectionBody | Collection name and description |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]