GetByInstanceAndResource
Returns the subscription lock for specified subscription instance and resource.
- TypeScript
- Python
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);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.marketplace.licensemanager.v1.lock_service_pb2 import (
GetLockByInstanceAndResourceRequest,
)
from yandex.cloud.marketplace.licensemanager.saas.v1.lock_service_pb2_grpc import LockServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(LockServiceStub)
response = service.GetByInstanceAndResource(
GetLockByInstanceAndResourceRequest(instance_id="instanceId", resource_id="resourceId")
)
print(response)
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.