CollectionsApi
All URIs are relative to https://api.estuary.tech
Method | HTTP request | Description |
---|---|---|
collectionsColuuidCommitPost | POST /collections/{coluuid}/commit | Produce a CID of the collection contents |
collectionsColuuidContentsDelete | DELETE /collections/{coluuid}/contents | Deletes a content from a collection |
collectionsColuuidDelete | DELETE /collections/{coluuid} | Deletes a collection |
collectionsColuuidGet | GET /collections/{coluuid} | Get contents in a collection |
collectionsColuuidPost | POST /collections/{coluuid} | Add contents to a collection |
collectionsFsAddPost | POST /collections/fs/add | Add a file to a collection |
collectionsGet | GET /collections/ | List all collections |
collectionsPost | POST /collections/ | Create a new collection |
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
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.CollectionsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: bearerAuth
ApiKeyAuth bearerAuth = (ApiKeyAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearerAuth.setApiKeyPrefix("Token");
CollectionsApi apiInstance = new CollectionsApi();
String coluuid = "coluuid_example"; // String | coluuid
try {
String result = apiInstance.collectionsColuuidCommitPost(coluuid);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CollectionsApi#collectionsColuuidCommitPost");
e.printStackTrace();
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
coluuid | String | coluuid |
Return type
String
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
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
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.CollectionsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: bearerAuth
ApiKeyAuth bearerAuth = (ApiKeyAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearerAuth.setApiKeyPrefix("Token");
CollectionsApi apiInstance = new CollectionsApi();
String coluuid = "coluuid_example"; // String | Collection ID
String contentid = "contentid_example"; // String | Content ID
MainDeleteContentFromCollectionBody body = new MainDeleteContentFromCollectionBody(); // MainDeleteContentFromCollectionBody | Variable to use when filtering for files (must be either 'path' or 'content_id')
try {
String result = apiInstance.collectionsColuuidContentsDelete(coluuid, contentid, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CollectionsApi#collectionsColuuidContentsDelete");
e.printStackTrace();
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
coluuid | String | Collection ID | |
contentid | String | Content ID | |
body | MainDeleteContentFromCollectionBody | Variable to use when filtering for files (must be either 'path' or 'content_id') |
Return type
String
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
Deletes a collection
This endpoint is used to delete an existing collection.
Example
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.CollectionsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: bearerAuth
ApiKeyAuth bearerAuth = (ApiKeyAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearerAuth.setApiKeyPrefix("Token");
CollectionsApi apiInstance = new CollectionsApi();
String coluuid = "coluuid_example"; // String | Collection ID
try {
apiInstance.collectionsColuuidDelete(coluuid);
} catch (ApiException e) {
System.err.println("Exception when calling CollectionsApi#collectionsColuuidDelete");
e.printStackTrace();
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
coluuid | String | Collection ID |
Return type
null (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
Get contents in a collection
This endpoint is used to get contents in a collection. If no colpath query param is passed
Example
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.CollectionsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: bearerAuth
ApiKeyAuth bearerAuth = (ApiKeyAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearerAuth.setApiKeyPrefix("Token");
CollectionsApi apiInstance = new CollectionsApi();
String coluuid = "coluuid_example"; // String | coluuid
String dir = "dir_example"; // String | Directory
try {
String result = apiInstance.collectionsColuuidGet(coluuid, dir);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CollectionsApi#collectionsColuuidGet");
e.printStackTrace();
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
coluuid | String | coluuid | |
dir | String | Directory | [optional] |
Return type
String
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
Add contents to a collection
This endpoint adds already-pinned contents (that have ContentIDs) to a collection.
Example
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.CollectionsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: bearerAuth
ApiKeyAuth bearerAuth = (ApiKeyAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearerAuth.setApiKeyPrefix("Token");
CollectionsApi apiInstance = new CollectionsApi();
String coluuid = "coluuid_example"; // String | coluuid
List<Integer> contentIDs = Arrays.asList(new List<Integer>()); // List<Integer> | Content IDs to add to collection
try {
Map<String, String> result = apiInstance.collectionsColuuidPost(coluuid, contentIDs);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CollectionsApi#collectionsColuuidPost");
e.printStackTrace();
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
coluuid | String | coluuid | |
contentIDs | List<Integer> | Content IDs to add to collection |
Return type
Map<String, String>
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
Add a file to a collection
This endpoint adds a file to a collection
Example
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.CollectionsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: bearerAuth
ApiKeyAuth bearerAuth = (ApiKeyAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearerAuth.setApiKeyPrefix("Token");
CollectionsApi apiInstance = new CollectionsApi();
String coluuid = "coluuid_example"; // String | Collection ID
String content = "content_example"; // String | Content
String path = "path_example"; // String | Path to file
try {
apiInstance.collectionsFsAddPost(coluuid, content, path);
} catch (ApiException e) {
System.err.println("Exception when calling CollectionsApi#collectionsFsAddPost");
e.printStackTrace();
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
coluuid | String | Collection ID | |
content | String | Content | |
path | String | Path to file |
Return type
null (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
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
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.CollectionsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: bearerAuth
ApiKeyAuth bearerAuth = (ApiKeyAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearerAuth.setApiKeyPrefix("Token");
CollectionsApi apiInstance = new CollectionsApi();
try {
List<CollectionsCollection> result = apiInstance.collectionsGet();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CollectionsApi#collectionsGet");
e.printStackTrace();
}
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
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
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.CollectionsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: bearerAuth
ApiKeyAuth bearerAuth = (ApiKeyAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearerAuth.setApiKeyPrefix("Token");
CollectionsApi apiInstance = new CollectionsApi();
MainCreateCollectionBody body = new MainCreateCollectionBody(); // MainCreateCollectionBody | Collection name and description
try {
CollectionsCollection result = apiInstance.collectionsPost(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CollectionsApi#collectionsPost");
e.printStackTrace();
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
body | MainCreateCollectionBody | Collection name and description |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json