Get
Returns the specified broker.
To get the list of available brokers, make a List request.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetBrokerRequest = cloudApi.iot.broker_broker_service.GetBrokerRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.BrokerServiceClient);
const result = await client.get(
GetBrokerRequest.fromPartial({
brokerId: "brokerId",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.iot.broker.v1.broker_service_pb2_grpc import BrokerServiceStub
from yandex.cloud.iot.broker.v1.broker_service_pb2 import GetBrokerRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(BrokerServiceStub)
response = service.Get(GetBrokerRequest(broker_id="brokerId"))
print(response)
GetBrokerRequest
brokerId
: string
ID of the broker to return.
To get a broker ID make a BrokerService.List request.
Broker
A broker.
Status
STATUS_UNSPECIFIED
CREATING
Broker is being created.
ACTIVE
Broker is ready to use.
DELETING
Broker is being deleted.
id
: string
ID of the broker.
folderId
: string
ID of the folder that the broker belongs to.
createdAt
: google.protobuf.Timestamp
Creation timestamp.
name
: string
Name of the broker. The name is unique within the folder.
description
: string
Description of the broker. 0-256 characters long.
labels
: string
Resource labels as key:value
pairs. Maximum of 64 per resource.
status
: Status
Status of the broker.
logOptions
: LogOptions
Options for logging broker events
LogOptions
disabled
: bool
Is logging from broker disabled.
One of destination
Log entries destination.
logGroupId
: stringEntry should be written to log group resolved by ID.
folderId
: stringEntry should be written to default log group for specified folder.
minLevel
: yandex.cloud.logging.v1.LogLevel.Level
Minimum log entry level.
See LogLevel.Level for details.