ListCertificates
Retrieves the list of device certificates for the specified device.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListDeviceCertificatesRequest =
cloudApi.iot.devices_device_service.ListDeviceCertificatesRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.DeviceServiceClient);
const result = await client.listCertificates(
ListDeviceCertificatesRequest.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 ListDeviceCertificatesRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(DeviceServiceStub)
response = service.ListCertificates(ListDeviceCertificatesRequest(device_id="deviceId"))
print(response)
ListDeviceCertificatesRequest
deviceId
: string
ID of the device to list certificates for.
ListDeviceCertificatesResponse
certificates
: DeviceCertificate
List of certificates for the specified device.
DeviceCertificate
A device certificate. For more information, see Managing device certificates.
deviceId
: string
ID of the device that the certificate belongs to.
fingerprint
: string
SHA256 hash of the certificate.
certificateData
: string
Public part of the certificate.
createdAt
: google.protobuf.Timestamp
Creation timestamp.