-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Expand file tree
/
Copy pathdelete-datastore.js
More file actions
38 lines (33 loc) · 1.26 KB
/
Copy pathdelete-datastore.js
File metadata and controls
38 lines (33 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { fileURLToPath } from "node:url";
// snippet-start:[medical-imaging.JavaScript.datastore.deleteDatastoreV3]
import { DeleteDatastoreCommand } from "@aws-sdk/client-medical-imaging";
import { medicalImagingClient } from "../libs/medicalImagingClient.js";
/**
* @param {string} datastoreId - The ID of the data store to delete.
*/
export const deleteDatastore = async (datastoreId = "DATASTORE_ID") => {
const response = await medicalImagingClient.send(
new DeleteDatastoreCommand({ datastoreId }),
);
console.log(response);
// {
// '$metadata': {
// httpStatusCode: 200,
// requestId: 'f5beb409-678d-48c9-9173-9a001ee1ebb1',
// extendedRequestId: undefined,
// cfId: undefined,
// attempts: 1,
// totalRetryDelay: 0
// },
// datastoreId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
// datastoreStatus: 'DELETING'
// }
return response;
};
// snippet-end:[medical-imaging.JavaScript.datastore.deleteDatastoreV3]
// Invoke the following code if this file is being run directly.
if (process.argv[1] === fileURLToPath(import.meta.url)) {
await deleteDatastore();
}