Get
Returns the specified log group.
To get the list of all available log groups, make a List request.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetLogGroupRequest =
cloudApi.logging.log_group_service.GetLogGroupRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.LogGroupServiceClient);
const result = await client.get(
GetLogGroupRequest.fromPartial({
logGroupId: "logGroupId",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.logging.v1.log_group_service_pb2 import GetLogGroupRequest
from yandex.cloud.logging.v1.log_group_service_pb2_grpc import LogGroupServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(LogGroupServiceStub)
response = service.Get(GetLogGroupRequest(log_group_id="logGroupId"))
print(response)
GetLogGroupRequest
logGroupId
: string
ID of the log group to return.
To get a log group ID make a LogGroupService.List request.
LogGroup
Status
Possible log group statuses.
STATUS_UNSPECIFIED
Unknown status. Should never occur.
CREATING
Log group is creating.
ACTIVE
Log group is ready to accept messages,
DELETING
Log group is being deleted. No messages will be accepted.
ERROR
Log group is in failed state.
id
: string
Log group ID.
folderId
: string
Log group folder ID.
cloudId
: string
Log group cloud ID.
createdAt
: google.protobuf.Timestamp
Log group creation time.
name
: string
Log group name.
description
: string
Log group description.
labels
: string
Log group labels.
status
: Status
Status of the log group.
retentionPeriod
: google.protobuf.Duration
Log group entry retention period.
Entries will be present in group during this period.
dataStream
: string
Data stream name