@cumulus/api-client 18.2.1 → 18.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/granules.d.ts +169 -139
- package/granules.d.ts.map +1 -1
- package/granules.js +183 -176
- package/granules.js.map +1 -1
- package/package.json +5 -5
- package/src/granules.ts +190 -183
- package/tsconfig.tsbuildinfo +1 -1
package/src/granules.ts
CHANGED
|
@@ -15,21 +15,30 @@ type AssociateExecutionRequest = {
|
|
|
15
15
|
executionArn: string
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
const encodeGranulesURIComponent = (
|
|
19
|
+
granuleId: string,
|
|
20
|
+
collectionId: string | undefined
|
|
21
|
+
): string =>
|
|
22
|
+
(collectionId
|
|
23
|
+
? `/granules/${encodeURIComponent(collectionId)}/${encodeURIComponent(granuleId)}`
|
|
24
|
+
: `/granules/${encodeURIComponent(granuleId)}`); // Fetching a granule without a collectionId is supported but deprecated
|
|
25
|
+
|
|
18
26
|
/**
|
|
19
27
|
* GET raw response from /granules/{granuleId} or /granules/{collectionId}/{granuleId}
|
|
20
28
|
*
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
25
|
-
* @param
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
29
|
+
* @param params - params
|
|
30
|
+
* @param params.prefix - the prefix configured for the stack
|
|
31
|
+
* @param params.granuleId - a granule ID
|
|
32
|
+
* @param [params.collectionId] - a collection ID
|
|
33
|
+
* @param [params.query] - query to pass the API lambda
|
|
34
|
+
* @param params.expectedStatusCodes - the statusCodes which the granule API is
|
|
35
|
+
* is expecting for the invokeApi Response,
|
|
36
|
+
* default is 200
|
|
37
|
+
* @param params.callback - async function to invoke the api lambda
|
|
38
|
+
* that takes a prefix / user payload,
|
|
39
|
+
* cumulusApiClient.invokeApifunction
|
|
40
|
+
* is the default to invoke the api lambda
|
|
41
|
+
* @returns - the granule fetched by the API
|
|
33
42
|
*/
|
|
34
43
|
export const getGranuleResponse = async (params: {
|
|
35
44
|
prefix: string,
|
|
@@ -48,12 +57,7 @@ export const getGranuleResponse = async (params: {
|
|
|
48
57
|
callback = invokeApi,
|
|
49
58
|
} = params;
|
|
50
59
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// Fetching a granule without a collectionId is supported but deprecated
|
|
54
|
-
if (!collectionId) {
|
|
55
|
-
path = `/granules/${granuleId}`;
|
|
56
|
-
}
|
|
60
|
+
const path = encodeGranulesURIComponent(granuleId, collectionId);
|
|
57
61
|
|
|
58
62
|
return await callback({
|
|
59
63
|
prefix,
|
|
@@ -70,15 +74,17 @@ export const getGranuleResponse = async (params: {
|
|
|
70
74
|
/**
|
|
71
75
|
* GET granule record from /granules/{granuleId} or /granules/{collectionId}/{granuleId}
|
|
72
76
|
*
|
|
73
|
-
* @param
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
77
|
-
* @param
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
77
|
+
* @param params - params
|
|
78
|
+
* @param params.prefix - the prefix configured for the stack
|
|
79
|
+
* @param params.granuleId - a granule ID
|
|
80
|
+
* @param [params.collectionId] - a collection ID
|
|
81
|
+
* @param [params.query] - query to pass the API lambda
|
|
82
|
+
* @param params.callback - async function to invoke the api lambda
|
|
83
|
+
* that takes a prefix / user payload. Defaults
|
|
84
|
+
* to cumulusApiClient.invokeApifunction to
|
|
85
|
+
* invoke the
|
|
86
|
+
* api lambda
|
|
87
|
+
* @returns - the granule fetched by the API
|
|
82
88
|
*/
|
|
83
89
|
export const getGranule = async (params: {
|
|
84
90
|
prefix: string,
|
|
@@ -94,13 +100,16 @@ export const getGranule = async (params: {
|
|
|
94
100
|
/**
|
|
95
101
|
* Wait for a granule to be present in the database (using pRetry)
|
|
96
102
|
*
|
|
97
|
-
* @param
|
|
98
|
-
* @param
|
|
99
|
-
* @param
|
|
100
|
-
* @param
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
103
|
+
* @param params - params
|
|
104
|
+
* @param params.prefix - the prefix configured for the stack
|
|
105
|
+
* @param params.granuleId - granuleId to wait for
|
|
106
|
+
* @param [params.status] - expected granule status
|
|
107
|
+
* @param [params.retries] - number of times to retry
|
|
108
|
+
* @param [params.pRetryOptions] - options for pRetry
|
|
109
|
+
* @param [params.callback] - async function to invoke the api lambda
|
|
110
|
+
* that takes a prefix / user payload. Defaults
|
|
111
|
+
* to cumulusApiClient.invokeApifunction to invoke the
|
|
112
|
+
* api lambda
|
|
104
113
|
*/
|
|
105
114
|
export const waitForGranule = async (params: {
|
|
106
115
|
prefix: string,
|
|
@@ -156,16 +165,17 @@ export const waitForGranule = async (params: {
|
|
|
156
165
|
* Reingest a granule from the Cumulus API
|
|
157
166
|
* PATCH /granules/{}
|
|
158
167
|
*
|
|
159
|
-
* @param
|
|
160
|
-
* @param
|
|
161
|
-
* @param
|
|
162
|
-
* @param
|
|
163
|
-
* @param
|
|
164
|
-
* @param
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
168
|
+
* @param params - params
|
|
169
|
+
* @param params.prefix - the prefix configured for the stack
|
|
170
|
+
* @param params.granuleId - a granule ID
|
|
171
|
+
* @param [params.collectionId] - a collection ID
|
|
172
|
+
* @param params.workflowName - Optional WorkflowName
|
|
173
|
+
* @param params.executionArn - Optional executionArn
|
|
174
|
+
* @param params.callback - async function to invoke the api lambda
|
|
175
|
+
* that takes a prefix / user payload. Defaults
|
|
176
|
+
* to cumulusApiClient.invokeApifunction to invoke the
|
|
177
|
+
* api lambda
|
|
178
|
+
* @returns - the granule fetched by the API
|
|
169
179
|
*/
|
|
170
180
|
export const reingestGranule = async (params: {
|
|
171
181
|
prefix: string,
|
|
@@ -184,12 +194,7 @@ export const reingestGranule = async (params: {
|
|
|
184
194
|
callback = invokeApi,
|
|
185
195
|
} = params;
|
|
186
196
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
// Fetching a granule without a collectionId is supported but deprecated
|
|
190
|
-
if (!collectionId) {
|
|
191
|
-
path = `/granules/${granuleId}`;
|
|
192
|
-
}
|
|
197
|
+
const path = encodeGranulesURIComponent(granuleId, collectionId);
|
|
193
198
|
|
|
194
199
|
return await callback({
|
|
195
200
|
prefix: prefix,
|
|
@@ -214,14 +219,15 @@ export const reingestGranule = async (params: {
|
|
|
214
219
|
* Removes a granule from CMR via the Cumulus API
|
|
215
220
|
* PATCH /granules/{granuleId}
|
|
216
221
|
*
|
|
217
|
-
* @param
|
|
218
|
-
* @param
|
|
219
|
-
* @param
|
|
220
|
-
* @param
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
222
|
+
* @param params - params
|
|
223
|
+
* @param params.prefix - the prefix configured for the stack
|
|
224
|
+
* @param params.granuleId - a granule ID
|
|
225
|
+
* @param [params.collectionId] - a collection ID
|
|
226
|
+
* @param params.callback - async function to invoke the api lambda
|
|
227
|
+
* that takes a prefix / user payload. Defaults
|
|
228
|
+
* to cumulusApiClient.invokeApifunction to invoke the
|
|
229
|
+
* api lambda
|
|
230
|
+
* @returns - the granule fetched by the API
|
|
225
231
|
*/
|
|
226
232
|
export const removeFromCMR = async (params: {
|
|
227
233
|
prefix: string,
|
|
@@ -231,12 +237,7 @@ export const removeFromCMR = async (params: {
|
|
|
231
237
|
}): Promise<ApiGatewayLambdaHttpProxyResponse> => {
|
|
232
238
|
const { prefix, granuleId, collectionId, callback = invokeApi } = params;
|
|
233
239
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
// Fetching a granule without a collectionId is supported but deprecated
|
|
237
|
-
if (!collectionId) {
|
|
238
|
-
path = `/granules/${granuleId}`;
|
|
239
|
-
}
|
|
240
|
+
const path = encodeGranulesURIComponent(granuleId, collectionId);
|
|
240
241
|
|
|
241
242
|
return await callback({
|
|
242
243
|
prefix: prefix,
|
|
@@ -257,15 +258,17 @@ export const removeFromCMR = async (params: {
|
|
|
257
258
|
* Run a workflow with the given granule as the payload
|
|
258
259
|
* PATCH /granules/{granuleId}
|
|
259
260
|
*
|
|
260
|
-
* @param
|
|
261
|
-
* @param
|
|
262
|
-
* @param
|
|
263
|
-
* @param
|
|
264
|
-
* @param
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
261
|
+
* @param params - params
|
|
262
|
+
* @param params.prefix - the prefix configured for the stack
|
|
263
|
+
* @param params.granuleId - a granule ID
|
|
264
|
+
* @param [params.collectionId] - a collection ID
|
|
265
|
+
* @param params.workflow - workflow to be run with given granule
|
|
266
|
+
* @param params.callback - async function to invoke the api lambda
|
|
267
|
+
* that takes a prefix / user payload. Defaults
|
|
268
|
+
* to cumulusApiClient.invokeApifunction to invoke the
|
|
269
|
+
* api lambda
|
|
270
|
+
* @param [params.meta] - metadata
|
|
271
|
+
* @returns - the granule fetched by the API
|
|
269
272
|
*/
|
|
270
273
|
export const applyWorkflow = async (params: {
|
|
271
274
|
prefix: string,
|
|
@@ -284,12 +287,7 @@ export const applyWorkflow = async (params: {
|
|
|
284
287
|
callback = invokeApi,
|
|
285
288
|
} = params;
|
|
286
289
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
// Fetching a granule without a collectionId is supported but deprecated
|
|
290
|
-
if (!collectionId) {
|
|
291
|
-
path = `/granules/${granuleId}`;
|
|
292
|
-
}
|
|
290
|
+
const path = encodeGranulesURIComponent(granuleId, collectionId);
|
|
293
291
|
|
|
294
292
|
return await callback({
|
|
295
293
|
prefix: prefix,
|
|
@@ -310,15 +308,16 @@ export const applyWorkflow = async (params: {
|
|
|
310
308
|
* Delete a granule from Cumulus via the API lambda
|
|
311
309
|
* DELETE /granules/${granuleId}
|
|
312
310
|
*
|
|
313
|
-
* @param
|
|
314
|
-
* @param
|
|
315
|
-
* @param
|
|
316
|
-
* @param
|
|
317
|
-
* @param
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
311
|
+
* @param params - params
|
|
312
|
+
* @param params.pRetryOptions - pRetry options object
|
|
313
|
+
* @param params.prefix - the prefix configured for the stack
|
|
314
|
+
* @param params.granuleId - a granule ID
|
|
315
|
+
* @param [params.collectionId] - a collection ID
|
|
316
|
+
* @param params.callback - async function to invoke the api lambda
|
|
317
|
+
* that takes a prefix / user payload. Defaults
|
|
318
|
+
* to cumulusApiClient.invokeApifunction to invoke the
|
|
319
|
+
* api lambda
|
|
320
|
+
* @returns - the delete confirmation from the API
|
|
322
321
|
*/
|
|
323
322
|
export const deleteGranule = async (params: {
|
|
324
323
|
prefix: string,
|
|
@@ -335,12 +334,7 @@ export const deleteGranule = async (params: {
|
|
|
335
334
|
callback = invokeApi,
|
|
336
335
|
} = params;
|
|
337
336
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
// Fetching a granule without a collectionId is supported but deprecated
|
|
341
|
-
if (!collectionId) {
|
|
342
|
-
path = `/granules/${granuleId}`;
|
|
343
|
-
}
|
|
337
|
+
const path = encodeGranulesURIComponent(granuleId, collectionId);
|
|
344
338
|
|
|
345
339
|
return await callback({
|
|
346
340
|
prefix: prefix,
|
|
@@ -357,15 +351,16 @@ export const deleteGranule = async (params: {
|
|
|
357
351
|
* Move a granule via the API
|
|
358
352
|
* PATCH /granules/{granuleId}
|
|
359
353
|
*
|
|
360
|
-
* @param
|
|
361
|
-
* @param
|
|
362
|
-
* @param
|
|
363
|
-
* @param
|
|
364
|
-
* @param
|
|
365
|
-
*
|
|
366
|
-
*
|
|
367
|
-
*
|
|
368
|
-
*
|
|
354
|
+
* @param params - params
|
|
355
|
+
* @param params.prefix - the prefix configured for the stack
|
|
356
|
+
* @param params.granuleId - a granule ID
|
|
357
|
+
* @param [params.collectionId] - a collection ID
|
|
358
|
+
* @param params.destinations - move granule destinations
|
|
359
|
+
* @param params.callback - async function to invoke the api lambda
|
|
360
|
+
* that takes a prefix / user payload. Defaults
|
|
361
|
+
* to cumulusApiClient.invokeApifunction to invoke
|
|
362
|
+
* the api lambda
|
|
363
|
+
* @returns - the move response from the API
|
|
369
364
|
*/
|
|
370
365
|
export const moveGranule = async (params: {
|
|
371
366
|
prefix: string,
|
|
@@ -382,12 +377,7 @@ export const moveGranule = async (params: {
|
|
|
382
377
|
callback = invokeApi,
|
|
383
378
|
} = params;
|
|
384
379
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
// Fetching a granule without a collectionId is supported but deprecated
|
|
388
|
-
if (!collectionId) {
|
|
389
|
-
path = `/granules/${granuleId}`;
|
|
390
|
-
}
|
|
380
|
+
const path = encodeGranulesURIComponent(granuleId, collectionId);
|
|
391
381
|
|
|
392
382
|
return await callback({
|
|
393
383
|
prefix: prefix,
|
|
@@ -407,14 +397,15 @@ export const moveGranule = async (params: {
|
|
|
407
397
|
/**
|
|
408
398
|
* Removed a granule from CMR and delete from Cumulus via the API
|
|
409
399
|
*
|
|
410
|
-
* @param
|
|
411
|
-
* @param
|
|
412
|
-
* @param
|
|
413
|
-
* @param
|
|
414
|
-
*
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
*
|
|
400
|
+
* @param params - params
|
|
401
|
+
* @param params.prefix - the prefix configured for the stack
|
|
402
|
+
* @param params.granuleId - a granule ID
|
|
403
|
+
* @param [params.collectionId] - a collection ID
|
|
404
|
+
* @param params.callback - async function to invoke the api lambda
|
|
405
|
+
* that takes a prefix / user payload. Defaults
|
|
406
|
+
* to cumulusApiClient.invokeApifunction to invoke the
|
|
407
|
+
* api lambda
|
|
408
|
+
* @returns - the delete confirmation from the API
|
|
418
409
|
*/
|
|
419
410
|
export const removePublishedGranule = async (params: {
|
|
420
411
|
prefix: string,
|
|
@@ -432,13 +423,16 @@ export const removePublishedGranule = async (params: {
|
|
|
432
423
|
/**
|
|
433
424
|
* Query granules stored in cumulus
|
|
434
425
|
* GET /granules
|
|
435
|
-
*
|
|
436
|
-
* @param
|
|
437
|
-
* @param
|
|
438
|
-
*
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
*
|
|
426
|
+
*
|
|
427
|
+
* @param params - params
|
|
428
|
+
* @param params.prefix - the prefix configured for the stack
|
|
429
|
+
* @param [params.query] - query to pass the API lambda
|
|
430
|
+
* @param [params.query.fields]
|
|
431
|
+
* @param params.callback - async function to invoke the api lambda
|
|
432
|
+
* that takes a prefix / user payload. Defaults
|
|
433
|
+
* to cumulusApiClient.invokeApifunction to invoke the
|
|
434
|
+
* api lambda
|
|
435
|
+
* @returns - the response from the callback
|
|
442
436
|
*/
|
|
443
437
|
export const listGranules = async (params: {
|
|
444
438
|
prefix: string,
|
|
@@ -464,13 +458,15 @@ export const listGranules = async (params: {
|
|
|
464
458
|
/**
|
|
465
459
|
* Create granule into cumulus.
|
|
466
460
|
* POST /granules
|
|
467
|
-
*
|
|
468
|
-
* @param
|
|
469
|
-
* @param
|
|
470
|
-
*
|
|
471
|
-
*
|
|
472
|
-
*
|
|
473
|
-
*
|
|
461
|
+
*
|
|
462
|
+
* @param params - params
|
|
463
|
+
* @param params.prefix - the prefix configured for the stack
|
|
464
|
+
* @param [params.body] - granule to pass the API lambda
|
|
465
|
+
* @param params.callback - async function to invoke the api lambda
|
|
466
|
+
* that takes a prefix / user payload. Defaults
|
|
467
|
+
* to cumulusApiClient.invokeApifunction to invoke the
|
|
468
|
+
* api lambda
|
|
469
|
+
* @returns - the response from the callback
|
|
474
470
|
*/
|
|
475
471
|
export const createGranule = async (params: {
|
|
476
472
|
prefix: string,
|
|
@@ -496,13 +492,15 @@ export const createGranule = async (params: {
|
|
|
496
492
|
* be removed if not specified and in some cases replaced with defaults.
|
|
497
493
|
* Granule execution association history will be retained.
|
|
498
494
|
* PUT /granules/{collectionId}/{granuleId}
|
|
499
|
-
*
|
|
500
|
-
* @param
|
|
501
|
-
* @param
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
*
|
|
505
|
-
*
|
|
495
|
+
*
|
|
496
|
+
* @param params - params
|
|
497
|
+
* @param params.prefix - the prefix configured for the stack
|
|
498
|
+
* @param [params.body] - granule to pass the API lambda
|
|
499
|
+
* @param params.callback - async function to invoke the api lambda
|
|
500
|
+
* that takes a prefix / user payload. Defaults
|
|
501
|
+
* to cumulusApiClient.invokeApifunction to invoke the
|
|
502
|
+
* api lambda
|
|
503
|
+
* @returns - the response from the callback
|
|
506
504
|
*/
|
|
507
505
|
export const replaceGranule = async (params: {
|
|
508
506
|
prefix: string,
|
|
@@ -511,12 +509,14 @@ export const replaceGranule = async (params: {
|
|
|
511
509
|
}): Promise<ApiGatewayLambdaHttpProxyResponse> => {
|
|
512
510
|
const { prefix, body, callback = invokeApi } = params;
|
|
513
511
|
|
|
512
|
+
const path = encodeGranulesURIComponent(body.granuleId, body.collectionId);
|
|
513
|
+
|
|
514
514
|
return await callback({
|
|
515
515
|
prefix,
|
|
516
516
|
payload: {
|
|
517
517
|
httpMethod: 'PUT',
|
|
518
518
|
resource: '/{proxy+}',
|
|
519
|
-
path
|
|
519
|
+
path,
|
|
520
520
|
headers: {
|
|
521
521
|
'Content-Type': 'application/json',
|
|
522
522
|
'Cumulus-API-Version': '2',
|
|
@@ -532,13 +532,17 @@ export const replaceGranule = async (params: {
|
|
|
532
532
|
* not be overwritten if not specified, null values will be removed and in
|
|
533
533
|
* some cases replaced with defaults.
|
|
534
534
|
* PATCH /granules/{granuleId}
|
|
535
|
-
*
|
|
536
|
-
* @param
|
|
537
|
-
* @param
|
|
538
|
-
*
|
|
539
|
-
*
|
|
540
|
-
*
|
|
541
|
-
* @
|
|
535
|
+
*
|
|
536
|
+
* @param params - params
|
|
537
|
+
* @param params.prefix - the prefix configured for the stack
|
|
538
|
+
* @param [params.body] - granule to pass the API lambda
|
|
539
|
+
* @param params.granuleId - a granule ID
|
|
540
|
+
* @param [params.collectionId] - a collection ID
|
|
541
|
+
* @param params.callback - async function to invoke the api lambda
|
|
542
|
+
* that takes a prefix / user payload. Defaults
|
|
543
|
+
* to cumulusApiClient.invokeApifunction to invoke the
|
|
544
|
+
* api lambda
|
|
545
|
+
* @returns - the response from the callback
|
|
542
546
|
*/
|
|
543
547
|
export const updateGranule = async (params: {
|
|
544
548
|
prefix: string,
|
|
@@ -549,12 +553,7 @@ export const updateGranule = async (params: {
|
|
|
549
553
|
}): Promise<ApiGatewayLambdaHttpProxyResponse> => {
|
|
550
554
|
const { prefix, granuleId, collectionId, body, callback = invokeApi } = params;
|
|
551
555
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
// Fetching a granule without a collectionId is supported but deprecated
|
|
555
|
-
if (!collectionId) {
|
|
556
|
-
path = `/granules/${granuleId}`;
|
|
557
|
-
}
|
|
556
|
+
const path = encodeGranulesURIComponent(granuleId, collectionId);
|
|
558
557
|
|
|
559
558
|
return await callback({
|
|
560
559
|
prefix,
|
|
@@ -572,13 +571,15 @@ export const updateGranule = async (params: {
|
|
|
572
571
|
/**
|
|
573
572
|
* Associate an execution with a granule in cumulus.
|
|
574
573
|
* POST /granules/{granuleId}/execution
|
|
575
|
-
*
|
|
576
|
-
* @param
|
|
577
|
-
* @param
|
|
578
|
-
*
|
|
579
|
-
*
|
|
580
|
-
*
|
|
581
|
-
*
|
|
574
|
+
*
|
|
575
|
+
* @param params - params
|
|
576
|
+
* @param params.prefix - the prefix configured for the stack
|
|
577
|
+
* @param [params.body] - granule and execution info to pass the API lambda
|
|
578
|
+
* @param params.callback - async function to invoke the api lambda
|
|
579
|
+
* that takes a prefix / user payload. Defaults
|
|
580
|
+
* to cumulusApiClient.invokeApifunction to invoke the
|
|
581
|
+
* api lambda
|
|
582
|
+
* @returns - the response from the callback
|
|
582
583
|
*/
|
|
583
584
|
export const associateExecutionWithGranule = async (params: {
|
|
584
585
|
prefix: string,
|
|
@@ -587,12 +588,14 @@ export const associateExecutionWithGranule = async (params: {
|
|
|
587
588
|
}): Promise<ApiGatewayLambdaHttpProxyResponse> => {
|
|
588
589
|
const { prefix, body, callback = invokeApi } = params;
|
|
589
590
|
|
|
591
|
+
const path = encodeGranulesURIComponent(body.granuleId, undefined);
|
|
592
|
+
|
|
590
593
|
return await callback({
|
|
591
594
|
prefix,
|
|
592
595
|
payload: {
|
|
593
596
|
httpMethod: 'POST',
|
|
594
597
|
resource: '/{proxy+}',
|
|
595
|
-
path:
|
|
598
|
+
path: `${path}/executions`,
|
|
596
599
|
headers: { 'Content-Type': 'application/json' },
|
|
597
600
|
body: JSON.stringify(body),
|
|
598
601
|
},
|
|
@@ -602,13 +605,15 @@ export const associateExecutionWithGranule = async (params: {
|
|
|
602
605
|
/**
|
|
603
606
|
* Bulk operations on granules stored in cumulus
|
|
604
607
|
* POST /granules/bulk
|
|
605
|
-
*
|
|
606
|
-
* @param
|
|
607
|
-
* @param
|
|
608
|
-
*
|
|
609
|
-
*
|
|
610
|
-
*
|
|
611
|
-
*
|
|
608
|
+
*
|
|
609
|
+
* @param params - params
|
|
610
|
+
* @param params.prefix - the prefix configured for the stack
|
|
611
|
+
* @param params.body - body to pass the API lambda
|
|
612
|
+
* @param params.callback - async function to invoke the api lambda
|
|
613
|
+
* that takes a prefix / user payload. Defaults
|
|
614
|
+
* to cumulusApiClient.invokeApifunction to invoke the
|
|
615
|
+
* api lambda
|
|
616
|
+
* @returns - the response from the callback
|
|
612
617
|
*/
|
|
613
618
|
export const bulkGranules = async (params: {
|
|
614
619
|
prefix: string,
|
|
@@ -635,13 +640,15 @@ export const bulkGranules = async (params: {
|
|
|
635
640
|
/**
|
|
636
641
|
* Bulk delete granules stored in cumulus
|
|
637
642
|
* POST /granules/bulkDelete
|
|
638
|
-
*
|
|
639
|
-
* @param
|
|
640
|
-
* @param
|
|
641
|
-
*
|
|
642
|
-
*
|
|
643
|
-
*
|
|
644
|
-
*
|
|
643
|
+
*
|
|
644
|
+
* @param params - params
|
|
645
|
+
* @param params.prefix - the prefix configured for the stack
|
|
646
|
+
* @param params.body - body to pass the API lambda
|
|
647
|
+
* @param params.callback - async function to invoke the api lambda
|
|
648
|
+
* that takes a prefix / user payload. Defaults
|
|
649
|
+
* to cumulusApiClient.invokeApifunction to invoke the
|
|
650
|
+
* api lambda
|
|
651
|
+
* @returns - the response from the callback
|
|
645
652
|
*/
|
|
646
653
|
export const bulkDeleteGranules = async (params: {
|
|
647
654
|
prefix: string,
|
|
@@ -691,15 +698,15 @@ export const bulkReingestGranules = async (params: {
|
|
|
691
698
|
* Bulk Granule Operations
|
|
692
699
|
* POST /granules/bulk
|
|
693
700
|
*
|
|
694
|
-
* @param
|
|
695
|
-
* @param
|
|
696
|
-
* @param
|
|
697
|
-
* @param
|
|
698
|
-
* @param
|
|
699
|
-
*
|
|
700
|
-
*
|
|
701
|
-
*
|
|
702
|
-
* @returns
|
|
701
|
+
* @param params - params
|
|
702
|
+
* @param params.prefix - the prefix configured for the stack
|
|
703
|
+
* @param params.granules - the granules to have bulk operation on
|
|
704
|
+
* @param params.workflowName - workflowName for the bulk operation execution
|
|
705
|
+
* @param params.callback - async function to invoke the api lambda
|
|
706
|
+
* that takes a prefix / user payload. Defaults
|
|
707
|
+
* to cumulusApiClient.invokeApifunction to invoke the
|
|
708
|
+
* api lambda
|
|
709
|
+
* @returns - the response from the callback
|
|
703
710
|
*/
|
|
704
711
|
export const bulkOperation = async (params: {
|
|
705
712
|
prefix: string,
|