@cumulus/api-client
Version:
API client for working with the Cumulus archive API
154 lines • 6.93 kB
TypeScript
import { ApiExecutionRecord } from '@cumulus/types/api/executions';
import { ApiGatewayLambdaHttpProxyResponse, InvokeApiFunction } from './types';
/**
* Fetch an execution from the Cumulus API
*
* @param {Object} params - params
* @param {string} params.prefix - the prefix configured for the stack
* @param {string} params.arn - an execution arn
* @param {Function} params.callback - async function to invoke the api lambda
* that takes a prefix / user payload. Defaults
* to cumulusApiClient.invokeApi
* @returns {Promise<Object>} - the execution fetched by the API
*/
export declare const getExecution: (params: {
prefix: string;
arn: string;
callback?: InvokeApiFunction;
}) => Promise<ApiExecutionRecord>;
/**
* Fetch a list of executions from the Cumulus API
*
* @param {Object} params - params
* @param {string} params.prefix - the prefix configured for the stack
* @param {Function} params.callback - async function to invoke the api lambda
* that takes a prefix / user payload. Defaults
* to cumulusApiClient.invokeApi
* @returns {Promise<Object>} - the execution list fetched by the API
*/
export declare const getExecutions: (params: {
prefix: string;
query?: {
[key: string]: string | string[] | undefined;
fields?: string | string[] | undefined;
} | undefined;
callback?: InvokeApiFunction | undefined;
}) => Promise<ApiGatewayLambdaHttpProxyResponse>;
/**
* get execution status from the Cumulus API
*
* @param {Object} params - params
* @param {string} params.prefix - the prefix configured for the stack
* @param {string} params.arn - an execution arn
* @param {Function} params.callback - async function to invoke the api lambda
* that takes a prefix / user payload. Defaults
* to cumulusApiClient.invokeApi
* @returns {Promise<Object>} - the execution status fetched by the API
*/
export declare const getExecutionStatus: (params: {
prefix: string;
arn: string;
callback?: InvokeApiFunction;
}) => Promise<ApiGatewayLambdaHttpProxyResponse>;
/**
* Create an execution
* POST /executions
*
* @param {Object} params - params
* @param {string} params.prefix - the prefix configured for the stack
* @param {Object} params.body - execution object
* @param {Function} params.callback - async function to invoke the api lambda
* that takes a prefix / user payload. Defaults
* to cumulusApiClient.invokeApi
* @returns {Promise<Object>} - the response from the callback
*/
export declare const createExecution: (params: {
prefix: string;
body: ApiExecutionRecord;
callback?: InvokeApiFunction;
}) => Promise<ApiGatewayLambdaHttpProxyResponse>;
/**
* Update an execution
* PUT /executions/{executionArn}
*
* @param {Object} params - params
* @param {string} params.prefix - the prefix configured for the stack
* @param {Object} params.body - execution object
* @param {Function} params.callback - async function to invoke the api lambda
* that takes a prefix / user payload. Defaults
* to cumulusApiClient.invokeApi
* @returns {Promise<Object>} - the response from the callback
*/
export declare const updateExecution: (params: {
prefix: string;
body: ApiExecutionRecord;
callback?: InvokeApiFunction;
}) => Promise<ApiGatewayLambdaHttpProxyResponse>;
/**
* DELETE /executions/{executionArn}
*
* @param {Object} params - params
* @param {string} params.prefix - the prefix configured for the stack
* @param {Object} params.executionArn - the execution ARN
* @param {Function} params.callback - async function to invoke the api lambda
* that takes a prefix / user payload. Defaults
* to cumulusApiClient.invokeApi
* @returns {Promise<Object>} - the response from the callback
*/
export declare const deleteExecution: (params: {
prefix: string;
executionArn: string;
callback?: InvokeApiFunction;
}) => Promise<ApiGatewayLambdaHttpProxyResponse>;
/**
* Search executions by granules
* POST /executions/search-by-granules
* @param {Object} params - params
* @param {Object} params.body - body to pass the API lambda
* @param {Function} params.callback - async function to invoke the api lambda
* that takes a prefix / user payload. Defaults
* to cumulusApiClient.invokeApifunction to invoke the
* api lambda
* @returns {Promise<Object>} - the response from the callback
*/
export declare const searchExecutionsByGranules: (params: {
prefix: string;
payload: object;
query?: {
[key: string]: string | string[] | undefined;
} | undefined;
callback?: InvokeApiFunction | undefined;
}) => Promise<ApiGatewayLambdaHttpProxyResponse>;
/**
* Gets common workflows for a set of granules
* POST /executions/workflows-by-granules
* @param {Object} params - params
* @param {Object} params.body - body to pass the API lambda
* @param {Function} params.callback - async function to invoke the api lambda
* that takes a prefix / user payload. Defaults
* to cumulusApiClient.invokeApifunction to invoke the
* api lambda
* @returns {Promise<Object>} - the response from the callback
*/
export declare const workflowsByGranules: (params: {
prefix: string;
payload: object;
callback?: InvokeApiFunction;
}) => Promise<ApiGatewayLambdaHttpProxyResponse>;
/**
*
* POST /executions/workflows-by-granules
* @param {Object} params - params
* @param {Object} params.body - body to pass the API lambda
* @param {Function} params.callback - async function to invoke the api lambda
* that takes a prefix / user payload. Defaults
* to cumulusApiClient.invokeApifunction to invoke the
* api lambda
* @returns {Promise<Object>} - the response from the callback
*/
export declare const bulkDeleteByCollection: (params: {
prefix: string;
payload: object;
callback?: InvokeApiFunction;
}) => Promise<ApiGatewayLambdaHttpProxyResponse>;
//# sourceMappingURL=executions.d.ts.map