ListPasswords
Retrieves the list of passwords for the specified device.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListDevicePasswordsRequest =
cloudApi.iot.devices_device_service.ListDevicePasswordsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.DeviceServiceClient);
const result = await client.listPasswords(
ListDevicePasswordsRequest.fromPartial({
deviceId: "deviceId",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.iot.devices.v1.device_service_pb2_grpc import DeviceServiceStub
from yandex.cloud.iot.devices.v1.device_service_pb2 import ListDevicePasswordsRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(DeviceServiceStub)
response = service.ListPasswords(ListDevicePasswordsRequest(device_id="deviceId"))
print(response)
ListDevicePasswordsRequest
deviceId
: string
ID of the registry to list passwords in.
To get a registry ID make a RegistryService.List request.
ListDevicePasswordsResponse
passwords
: DevicePassword
List of passwords for the specified device.
DevicePassword
A device password.
deviceId
: string
ID of the device that the password belongs to.
id
: string
ID of the password.
createdAt
: google.protobuf.Timestamp
Creation timestamp.