ResolveAgent
Resolve agent service account for the service in the specified resource container.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ResolveServiceAgentRequest =
cloudApi.iam.service_control_service.ResolveServiceAgentRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ServiceControlServiceClient);
const result = await client.resolveAgent(
ResolveServiceAgentRequest.fromPartial({
serviceId: "serviceId",
// microserviceId: "microserviceId",
resource: {
id: "id",
type: "type",
},
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.iam.v1.service_control_service_pb2 import ResolveServiceAgentRequest
from yandex.cloud.iam.v1.resource_pb2 import Resource
from yandex.cloud.iam.v1.service_control_service_pb2_grpc import ServiceControlServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ServiceControlServiceStub)
response = service.ResolveAgent(
ResolveServiceAgentRequest(
service_id="serviceId",
# microservice_id = "microserviceId",
resource=Resource(id="id", type="type"),
)
)
print(response)
ResolveServiceAgentRequest
serviceId
: string
ID of the Service.
microserviceId
: string
ID of the Microservice.
resource
: Resource
Resource container.
Resource
A Resource. For more information, see Resource.
id
: string
ID of the resource.
type
: string
The type of the resource, e.g. resource-manager.folder, billing.account, compute.snapshot, etc.
ServiceAgent
serviceAccountId
: string
ID of the agent service account.
serviceId
: string
ID of the service.
microserviceId
: string
ID of the microservice.