Files
ghaymah-dns-net-sec-tests/scripts/delete_old_gateway.js
T

26 lines
837 B
JavaScript

const { getAuth } = require('./auth_manager');
async function main() {
const { token } = await getAuth();
const oldGatewayId = '3d5666fe-95db-4e73-b6b2-dd0e41fca7f6';
console.log(`Soft deleting old terminal gateway ${oldGatewayId}...`);
const res = await fetch('https://graphql.ghaymah.systems/v1/graphql', {
method: 'POST',
headers: { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json' },
body: JSON.stringify({
query: `mutation DeleteOldGateway($id: uuid!) {
update_ghaymah_cloud_resources_by_pk(
pk_columns: { id: $id },
_set: { deleted: true }
) {
id message
}
}`,
variables: { id: oldGatewayId }
})
});
console.log('Delete result:\n', JSON.stringify(await res.json(), null, 2));
}
main().catch(console.error);