List
Retrieves the list of log groups in the specified folder.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListLogGroupsRequest =
cloudApi.logging.log_group_service.ListLogGroupsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.LogGroupServiceClient);
const result = await client.list(
ListLogGroupsRequest.fromPartial({
folderId: "folderId",
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.logging.v1.log_group_service_pb2 import ListLogGroupsRequest
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.List(
ListLogGroupsRequest(
folder_id="folderId",
# page_size = 0,
# page_token = "pageToken",
# filter = "filter"
)
)
print(response)
ListLogGroupsRequest
folderId
: string
Folder ID of the log groups to return.
To get a folder ID make a yandex.cloud.resourcemanager.v1.FolderService.List request.
pageSize
: int64
The maximum number of results per page to return. If the number of available
results is larger than page_size
, the service returns a ListLogGroupsResponse.next_page_token
that can be used to get the next page of results in subsequent list requests.
Default value: 100.
pageToken
: string
Page token. To get the next page of results, set page_token
to the
ListLogGroupsResponse.next_page_token returned by a previous list request.
filter
: string
A filter expression that filters log groups listed in the response.
The expression must specify:
- The field name. Currently filtering can only be applied to the LogGroup.name field.
- An
=
operator. - The value in double quotes (
"
). Must be 3-63 characters long and match the regular expression[a-z][-a-z0-9]{1,61}[a-z0-9]
. Example of a filter:name=my-log-group
.
ListLogGroupsResponse
groups
: LogGroup
List of log groups in the specified folder.
nextPageToken
: string
Token for getting the next page of the list. If the number of results is greater than
the specified ListLogGroupsRequest.page_size, use next_page_token
as the value
for the ListLogGroupsRequest.page_token parameter in the next list request.
Each subsequent page will have its own next_page_token
to continue paging through the results.
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