Skip to main content

TriggerUsedCleanup

Forces obsolete used network to start cleanup process as soon as possible. Invocation does not wait for start or end of the cleanup process. Second invocation with the same network does nothing until network is completely cleaned-up.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const TriggerUsedNetworkCleanupRequest =
cloudApi.serverless.functions_network_service
.TriggerUsedNetworkCleanupRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.NetworkServiceClient);

const result = await client.triggerUsedCleanup(
TriggerUsedNetworkCleanupRequest.fromPartial({
networkId: "networkId",
})
);
console.log(result);
})();

TriggerUsedNetworkCleanupRequest

networkId : string

ID of the obsolete network to start the cleanup process for.

TriggerUsedNetworkCleanupResponse

networkCleanupTime : google.protobuf.Timestamp

Timestamp when cleanup of the specified network will be started.