List
Retrieves the list of buses in the specified folder.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListBusesRequest =
cloudApi.serverless.eventrouter_bus_service.ListBusesRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.BusServiceClient);
const result = await client.list(
ListBusesRequest.fromPartial({
folderId: "folderId",
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.serverless.eventrouter.v1.bus_service_pb2_grpc import BusServiceStub
from yandex.cloud.serverless.eventrouter.v1.bus_service_pb2 import ListBusesRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(BusServiceStub)
response = service.List(
ListBusesRequest(
folder_id="folderId",
# page_size = 0,
# page_token = "pageToken",
# filter = "filter"
)
)
print(response)
ListBusesRequest
folderId
: string
ID of the folder to list buses in.
pageSize
: int64
Maximum number of buses to return.
pageToken
: string
Page token. To get the next page of results, set page_token
to the
ListBusesResponse.next_page_token returned by a previous list request.
filter
: string
Supported fields for filter: name created_at
ListBusesResponse
buses
: Bus
List of buses.
nextPageToken
: string
Token for getting the next page of the list of buses.
Bus
Status
STATUS_UNSPECIFIED
CREATING
ACTIVE
DELETING
id
: string
ID of the bus.
folderId
: string
ID of the folder that the bus belongs to.
cloudId
: string
ID of the cloud that the bus resides in.
createdAt
: google.protobuf.Timestamp
Creation timestamp.
name
: string
Name of the bus.
description
: string
Description of the bus.
labels
: string
Resource labels as key:value
pairs.
deletionProtection
: bool
Deletion protection.
status
: Status
Status of the bus.