ListPasswords
Retrieves the list of passwords for the specified broker.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListBrokerPasswordsRequest =
cloudApi.iot.broker_broker_service.ListBrokerPasswordsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.BrokerServiceClient);
const result = await client.listPasswords(
ListBrokerPasswordsRequest.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 ListBrokerPasswordsRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(BrokerServiceStub)
response = service.ListPasswords(ListBrokerPasswordsRequest(broker_id="brokerId"))
print(response)
ListBrokerPasswordsRequest
brokerId
: string
ID of the broker to list passwords in.
To get a broker ID make a BrokerService.List request.
ListBrokerPasswordsResponse
passwords
: BrokerPassword
List of passwords for the specified broker.
BrokerPassword
A broker password.
brokerId
: string
ID of the broker that the password belongs to.
id
: string
ID of the password.
createdAt
: google.protobuf.Timestamp
Creation timestamp.