npm.io
22.4.1 • Published 2h ago

@cumulus/api-client

Licence
Apache-2.0
Version
22.4.1
Deps
4
Size
867 kB
Vulns
0
Weekly
0
Stars
304

@cumulus/api-client

This module provides functions that facilitate programatic access to the Cumulus API for processing functions and integration testing. These methods utilize a 'private' internal API lambda that utilizes the same underlying code the 'public' API Gateway utilizes.

Usage

The various exports from this module provide wrappers around common calls to the Cumulus API. By default they're utilizing the provided cumulusApiClient.invokeApi method as a callback, but an option to provide an alternate/wrapped version (e.g. for validation) is built in to all methods.

npm install @cumulus/api-client

Example

const { granules } = require('@cumulus/api-client');

const granule = await granules.getGranule({
  prefix: process.env.STACKNAME,
  granuleId,
  collectionId
});

The above example call will return the parsed JSON body of the response from the API (e.g. JSON.parse(response.body)).

About Cumulus

Cumulus is a cloud-based data ingest, archive, distribution and management prototype for NASA's future Earth science data streams.

Cumulus Documentation

Contributing

To make a contribution, please see our contributing guidelines.

Keywords