Get
Returns the Service information in the specified resource container.
To get the list of available Services, make a List request.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetServiceRequest = cloudApi.billing.service_service.GetServiceRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ServiceControlServiceClient);
const result = await client.get(
GetServiceRequest.fromPartial({
id: "id",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.billing.v1.service_service_pb2 import GetServiceRequest
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.Get(GetServiceRequest(id="id"))
print(response)
GetServiceRequest
serviceId : string
ID of the Service.
resource : Resource
Resource container to get a service information in.
It is supported only resource-manager.cloud resource container now.
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.
Service
A Service.
Status
STATUS_UNSPECIFIEDENABLEDThe service is enabled.
PAUSEDThe service is paused.
DISABLEDThe service is disabled.
ENABLINGThe service is being enabled.
RESUMINGThe service is being resumed.
PAUSINGThe service is being paused.
DISABLINGThe service is being disabled.
ERRORThe service is in error state.
DEFAULTThe service could be auto enabled.
serviceId : string
ID of the service.
resource : Resource
Resource that the service belongs to.
updatedAt : google.protobuf.Timestamp
Time of the last status update of the service.
status : Status
Current status of the service.
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.