Skip to main content

GetByInstanceAndResource

Returns the subscription lock for specified subscription instance and resource.

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

const GetLockByInstanceAndResourceRequest =
cloudApi.marketplace.licensemanager_lock_service
.GetLockByInstanceAndResourceRequest;

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

const result = await client.getByInstanceAndResource(
GetLockByInstanceAndResourceRequest.fromPartial({
instanceId: "instanceId",
resourceId: "resourceId",
})
);
console.log(result);
})();

GetLockByInstanceAndResourceRequest

instanceId : string

ID of the subscription instance.

resourceId : string

ID of the resource to which the subscription will be locked.

Lock

State

  • STATE_UNSPECIFIED

  • UNLOCKED

    Subscription unlocked.

  • LOCKED

    Subscription locked to the resource.

  • DELETED

    Subscription lock deleted.

id : string

ID of the subscription lock.

instanceId : string

ID of the subscription instance.

resourceId : string

ID of the resource.

startTime : google.protobuf.Timestamp

Timestamp of the start of the subscription lock.

endTime : google.protobuf.Timestamp

Timestamp of the end of the subscription lock.

createdAt : google.protobuf.Timestamp

Creation timestamp.

updatedAt : google.protobuf.Timestamp

Update timestamp.

state : State

Subscription lock state.

templateId : string

ID of the subscription template.