Skip to main content

ListResources

Retrieves the resources (type and IDs) in the specified log group.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const ListResourcesRequest = cloudApi.cdn.resource_service.ListResourcesRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.LogGroupServiceClient);

const result = await client.listResources(
ListResourcesRequest.fromPartial({
folderId: "folderId",
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();

ListResourcesRequest

logGroupId : string

ID of the log group to list resources for.

To get a log group ID make a LogGroupService.List request.

type : string

Resource type to return resources for.

If not specified, ListResourcesResponse will contain information about all resource types.

ListResourcesResponse

resources : LogGroupResource

List of resources present in log group.

LogGroupResource

Log group resource.

type : string

Resource type.

Collected from log entries inside log group.

ids : string

List of resource IDs with the same resource type.