ListRecordSets
Retrieves the list of record sets in the specified folder.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListDnsZoneRecordSetsRequest =
  cloudApi.dns.dns_zone_service.ListDnsZoneRecordSetsRequest;
(async () => {
  const authToken = process.env["YC_OAUTH_TOKEN"];
  const session = new Session({ oauthToken: authToken });
  const client = session.client(serviceClients.DnsZoneServiceClient);
  const result = await client.listRecordSets(
    ListDnsZoneRecordSetsRequest.fromPartial({
      // dnsZoneId: "dnsZoneId",
      // pageSize: 0,
      // pageToken: "pageToken",
      // filter: "filter"
    })
  );
  console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.dns.v1.dns_zone_service_pb2_grpc import DnsZoneServiceStub
from yandex.cloud.dns.v1.dns_zone_service_pb2 import ListDnsZoneRecordSetsRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(DnsZoneServiceStub)
response = service.ListRecordSets(
    ListDnsZoneRecordSetsRequest(
        # dns_zone_id = "dnsZoneId",
        # page_size = 0,
        # page_token = "pageToken",
        # filter = "filter"
    )
)
print(response)
ListDnsZoneRecordSetsRequest
dnsZoneId : string
ID of the DNS zone to list record sets in.
To get a DNS zone ID, make a DnsZoneService.List request.
pageSize : int64
The maximum number of results per page to return. If the number of available
results is larger than page_size, the service returns a ListDnsZoneRecordSetsResponse.next_page_token
that can be used to get the next page of results in subsequent list requests.
pageToken : string
Page token. To get the next page of results, set page_token to the
ListDnsZoneRecordSetsResponse.next_page_token returned by a previous list request.
filter : string
A filter expression that filters record sets listed in the response. The expression consists of one or more conditions united by AND operator: <condition1> [AND <condition2> [<...> AND <conditionN>]].
Each condition has the form <field> <operator> <value>, where:
- <field>is the field name. Currently you can use filtering only on the RecordSet.name and RecordSet.type fields.
- <operator>is a logical operator, one of- =,- !=,- IN,- NOT IN.
- <value>represents a value. 3.1. In case of single value condition (- =or- !=), the value is a string in double (- ") or single (- ') quotes. C-style escape sequences are supported (- \"turns to- ",- \'to- ',- \\to backslash). 3.2. In case of a list of values condition (- INor- NOT IN), the value is- (<string1>, <string2>, .., <stringN>), where- <string>is a string in double (- ") or single (- ') quotes.
Examples of a filter: name="my-record-set", type IN ("MX","A") AND name="works.on.my.machine.".
ListDnsZoneRecordSetsResponse
recordSets : RecordSet
List of record sets in the specified DNS zone.
nextPageToken : string
Token for getting the next page of the list. If the number of results is greater than
the specified ListDnsZoneRecordSetsRequest.page_size, use next_page_token as the value
for the ListDnsZoneRecordSetsRequest.page_token parameter in the next list request.
Each subsequent page will have its own next_page_token to continue paging through the results.
RecordSet
A record set. For details about the concept, see Resource record.
name : string
Domain name.
type : string
Record type.
ttl : int64
Time to live in seconds.
data : string
Data of the record set.