ListLogRecords
Lists logs for the specified instance group.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListInstanceGroupLogRecordsRequest =
cloudApi.compute.instancegroup_instance_group_service
.ListInstanceGroupLogRecordsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.InstanceGroupServiceClient);
const result = await client.listLogRecords(
ListInstanceGroupLogRecordsRequest.fromPartial({
instanceGroupId: "instanceGroupId",
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.compute.v1.instancegroup.instance_group_service_pb2_grpc import (
InstanceGroupServiceStub,
)
from yandex.cloud.compute.v1.instancegroup.instance_group_service_pb2 import (
ListInstanceGroupLogRecordsRequest,
)
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(InstanceGroupServiceStub)
response = service.ListLogRecords(
ListInstanceGroupLogRecordsRequest(
instance_group_id="instanceGroupId",
# page_size = 0,
# page_token = "pageToken",
# filter = "filter"
)
)
print(response)
ListInstanceGroupLogRecordsRequest
instanceGroupId
: string
ID of the InstanceGroup resource to list logs for. To get the instance group ID, use a InstanceGroupService.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 ListInstanceGroupLogRecordsResponse.next_page_token that can be used to get the next page of results in subsequent list requests.
pageToken
: string
Page token. To get the next page of results, set page_token to the ListInstanceGroupLogRecordsResponse.next_page_token returned by a previous list request.
filter
: string
A filter expression that filters resources listed in the response. Currently you can use filtering only on the InstanceGroup.name field.
ListInstanceGroupLogRecordsResponse
logRecords
: LogRecord
Lists logs for the specified instance group.
nextPageToken
: string
This token allows you to get the next page of results for list requests. If the number of results is larger than ListInstanceGroupLogRecordsRequest.page_size, use next_page_token as the value for the ListInstanceGroupLogRecordsRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results.
LogRecord
timestamp
: google.protobuf.Timestamp
Log timestamp in RFC3339 text format.
message
: string
The log message.