Skip to main content

estuary_client.CollectionsApi

All URIs are relative to //api.estuary.tech/

MethodHTTP requestDescription
collections_coluuid_commit_postPOST /collections/{coluuid}/commitProduce a CID of the collection contents
collections_coluuid_contents_deleteDELETE /collections/{coluuid}/contentsDeletes a content from a collection
collections_coluuid_deleteDELETE /collections/{coluuid}Deletes a collection
collections_coluuid_getGET /collections/{coluuid}Get contents in a collection
collections_coluuid_postPOST /collections/{coluuid}Add contents to a collection
collections_fs_add_postPOST /collections/fs/addAdd a file to a collection
collections_getGET /collections/List all collections
collections_postPOST /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

NameTypeDescriptionNotes
coluuidstrcoluuid

Return type

str

Authorization

bearerAuth

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(body, coluuid, contentid)

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))
body = estuary_client.MainDeleteContentFromCollectionBody() # MainDeleteContentFromCollectionBody | Variable to use when filtering for files (must be either 'path' or 'content_id')
coluuid = 'coluuid_example' # str | Collection ID
contentid = 'contentid_example' # str | Content ID

try:
# Deletes a content from a collection
api_response = api_instance.collections_coluuid_contents_delete(body, coluuid, contentid)
pprint(api_response)
except ApiException as e:
print("Exception when calling CollectionsApi->collections_coluuid_contents_delete: %s\n" % e)

Parameters

NameTypeDescriptionNotes
bodyMainDeleteContentFromCollectionBodyVariable to use when filtering for files (must be either 'path' or 'content_id')
coluuidstrCollection ID
contentidstrContent ID

Return type

str

Authorization

bearerAuth

HTTP request headers

  • Content-Type: /
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

collections_coluuid_delete

str 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_response = api_instance.collections_coluuid_delete(coluuid)
pprint(api_response)
except ApiException as e:
print("Exception when calling CollectionsApi->collections_coluuid_delete: %s\n" % e)

Parameters

NameTypeDescriptionNotes
coluuidstrCollection ID

Return type

str

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[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

NameTypeDescriptionNotes
coluuidstrcoluuid
dirstrDirectory[optional]

Return type

str

Authorization

bearerAuth

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

str collections_coluuid_post(body, coluuid)

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))
body = [56] # list[int] | Content IDs to add to collection
coluuid = 'coluuid_example' # str | Collection UUID

try:
# Add contents to a collection
api_response = api_instance.collections_coluuid_post(body, coluuid)
pprint(api_response)
except ApiException as e:
print("Exception when calling CollectionsApi->collections_coluuid_post: %s\n" % e)

Parameters

NameTypeDescriptionNotes
bodylist[int]Content IDs to add to collection
coluuidstrCollection UUID

Return type

str

Authorization

bearerAuth

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

str 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_response = api_instance.collections_fs_add_post(coluuid, content, path)
pprint(api_response)
except ApiException as e:
print("Exception when calling CollectionsApi->collections_fs_add_post: %s\n" % e)

Parameters

NameTypeDescriptionNotes
coluuidstrCollection ID
contentstrContent
pathstrPath to file

Return type

str

Authorization

bearerAuth

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[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

list[list[CollectionsCollection]]

Authorization

bearerAuth

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

NameTypeDescriptionNotes
bodyMainCreateCollectionBodyCollection name and description

Return type

CollectionsCollection

Authorization

bearerAuth

HTTP request headers

  • Content-Type: /
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]