ListDeviceTopicAliases
Retrieves the list of device topic aliases for the specified registry.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListDeviceTopicAliasesRequest =
cloudApi.iot.devices_registry_service.ListDeviceTopicAliasesRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.RegistryServiceClient);
const result = await client.listDeviceTopicAliases(
ListDeviceTopicAliasesRequest.fromPartial({
registryId: "registryId",
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.iot.devices.v1.registry_service_pb2 import ListDeviceTopicAliasesRequest
from yandex.cloud.containerregistry.v1.registry_service_pb2_grpc import RegistryServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(RegistryServiceStub)
response = service.ListDeviceTopicAliases(
ListDeviceTopicAliasesRequest(
registry_id="registryId",
# page_size = 0,
# page_token = "pageToken"
)
)
print(response)
ListDeviceTopicAliasesRequest
registryId
: string
ID of the registry to list aliases for device topic.
To get a registry ID make a RegistryService.List request.
pageSize
: int64
The maximum number of results per page that should be returned. If the number of available
results is larger than page_size
, the service returns a ListDeviceTopicAliasesResponse.next_page_token
that can be used to get the next page of results in subsequent list requests.
Default value: 100.
pageToken
: string
Page token. To get the next page of results, set page_token
to the
ListDeviceTopicAliasesResponse.next_page_token returned by a previous list request.
ListDeviceTopicAliasesResponse
aliases
: DeviceAlias
List of device aliases for the specified registry.
nextPageToken
: string
Token for getting the next page of the list. If the number of results is greater than
the specified ListDeviceTopicAliasesRequest.page_size, use next_page_token
as the value
for the ListDeviceTopicAliasesRequest.page_token parameter in the next list request.
Each subsequent page will have its own next_page_token
to continue paging through the results.
DeviceAlias
A device topic alias.
Alias is an alternate name of a device topic assigned by the user. Map alias to canonical topic name prefix, e.g. my/custom/alias
match to $device/abcdef/events
. For more information, see Using topic aliases.
deviceId
: string
ID of the device that the alias belongs to.
topicPrefix
: string
Prefix of a canonical topic name to be aliased, e.g. $devices/abcdef
.
alias
: string
Alias of a device topic.