DNS ゾーン内の指定した種類のレコード セットをListsします。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}?api-version=2018-05-01
With optional parameters:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}?$top={$top}&$recordsetnamesuffix={$recordsetnamesuffix}&api-version=2018-05-01
URI パラメーター
名前 |
/ |
必須 |
型 |
説明 |
recordType
|
path |
True
|
RecordType
|
列挙するレコード セットの種類。
|
resourceGroupName
|
path |
True
|
string
|
リソース グループの名前。
|
subscriptionId
|
path |
True
|
string
|
Microsoft Azure サブスクリプションを一意に識別する Azure サブスクリプション ID を指定します。
|
zoneName
|
path |
True
|
string
|
DNS ゾーンの名前 (終了ドットなし)。
|
api-version
|
query |
True
|
string
|
API バージョンを指定します。
|
$recordsetnamesuffix
|
query |
|
string
|
レコード セットの列挙をフィルター処理するために使用する必要があるレコード セット名のサフィックス ラベル。 このパラメーターを指定した場合、Enumeration は で終わるレコードのみを返します。
|
$top
|
query |
|
integer
int32
|
返されるレコード セットの最大数。 指定しない場合、 は最大 100 個のレコード セットを返します。
|
応答
例
List A recordsets
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/A?api-version=2018-05-01
import com.azure.resourcemanager.dns.models.RecordType;
/** Samples for RecordSets ListByType. */
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListARecordset.json
*/
/**
* Sample code: List A recordsets.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listARecordsets(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().listByType("rg1", "zone1", RecordType.A, null, null,
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.dns import DnsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-dns
# USAGE
python list_arecordset.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DnsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.record_sets.list_by_type(
resource_group_name="rg1",
zone_name="zone1",
record_type="A",
)
for item in response:
print(item)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListARecordset.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdns_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListARecordset.json
func ExampleRecordSetsClient_NewListByTypePager_listARecordsets() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdns.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRecordSetsClient().NewListByTypePager("rg1", "zone1", armdns.RecordTypeA, &armdns.RecordSetsClientListByTypeOptions{Top: nil,
Recordsetnamesuffix: nil,
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.RecordSetListResult = armdns.RecordSetListResult{
// Value: []*armdns.RecordSet{
// {
// Name: to.Ptr("record1"),
// Type: to.Ptr("Microsoft.Network/dnsZones/A"),
// Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/A/record1"),
// Properties: &armdns.RecordSetProperties{
// ARecords: []*armdns.ARecord{
// {
// IPv4Address: to.Ptr("127.0.0.1"),
// }},
// TTL: to.Ptr[int64](3600),
// Fqdn: to.Ptr("record1.zone1"),
// Metadata: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DnsManagementClient } = require("@azure/arm-dns");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
*
* @summary Lists the record sets of a specified type in a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListARecordset.json
*/
async function listARecordsets() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const recordType = "A";
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.recordSets.listByType(resourceGroupName, zoneName, recordType)) {
resArray.push(item);
}
console.log(resArray);
}
listARecordsets().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"nextLink": "https://servicehost/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/A?api-version=2018-05-01&$skipToken=skipToken",
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/A/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/A",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"ARecords": [
{
"ipv4Address": "127.0.0.1"
}
]
}
}
]
}
List AAAA recordsets
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/AAAA?api-version=2018-05-01
import com.azure.resourcemanager.dns.models.RecordType;
/** Samples for RecordSets ListByType. */
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListAAAARecordset.json
*/
/**
* Sample code: List AAAA recordsets.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listAAAARecordsets(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().listByType("rg1", "zone1", RecordType.AAAA, null,
null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.dns import DnsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-dns
# USAGE
python list_aaaa_recordset.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DnsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.record_sets.list_by_type(
resource_group_name="rg1",
zone_name="zone1",
record_type="AAAA",
)
for item in response:
print(item)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListAAAARecordset.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdns_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListAAAARecordset.json
func ExampleRecordSetsClient_NewListByTypePager_listAaaaRecordsets() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdns.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRecordSetsClient().NewListByTypePager("rg1", "zone1", armdns.RecordTypeAAAA, &armdns.RecordSetsClientListByTypeOptions{Top: nil,
Recordsetnamesuffix: nil,
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.RecordSetListResult = armdns.RecordSetListResult{
// Value: []*armdns.RecordSet{
// {
// Name: to.Ptr("record1"),
// Type: to.Ptr("Microsoft.Network/dnsZones/AAAA"),
// Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/AAAA/record1"),
// Properties: &armdns.RecordSetProperties{
// AaaaRecords: []*armdns.AaaaRecord{
// {
// IPv6Address: to.Ptr("::1"),
// }},
// TTL: to.Ptr[int64](3600),
// Fqdn: to.Ptr("record1.zone1"),
// Metadata: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DnsManagementClient } = require("@azure/arm-dns");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
*
* @summary Lists the record sets of a specified type in a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListAAAARecordset.json
*/
async function listAaaaRecordsets() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const recordType = "AAAA";
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.recordSets.listByType(resourceGroupName, zoneName, recordType)) {
resArray.push(item);
}
console.log(resArray);
}
listAaaaRecordsets().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"nextLink": "https://servicehost/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/AAAA?api-version=2018-05-01&$skipToken=skipToken",
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/AAAA/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/AAAA",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"AAAARecords": [
{
"ipv6Address": "::1"
}
]
}
}
]
}
List CAA recordsets
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CAA?api-version=2018-05-01
import com.azure.resourcemanager.dns.models.RecordType;
/** Samples for RecordSets ListByType. */
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCaaRecordset.json
*/
/**
* Sample code: List CAA recordsets.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listCAARecordsets(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().listByType("rg1", "zone1", RecordType.CAA, null,
null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.dns import DnsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-dns
# USAGE
python list_caa_recordset.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DnsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.record_sets.list_by_type(
resource_group_name="rg1",
zone_name="zone1",
record_type="CAA",
)
for item in response:
print(item)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCaaRecordset.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdns_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCaaRecordset.json
func ExampleRecordSetsClient_NewListByTypePager_listCaaRecordsets() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdns.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRecordSetsClient().NewListByTypePager("rg1", "zone1", armdns.RecordTypeCAA, &armdns.RecordSetsClientListByTypeOptions{Top: nil,
Recordsetnamesuffix: nil,
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.RecordSetListResult = armdns.RecordSetListResult{
// Value: []*armdns.RecordSet{
// {
// Name: to.Ptr("record1"),
// Type: to.Ptr("Microsoft.Network/dnsZones/CAA"),
// Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CAA/record1"),
// Properties: &armdns.RecordSetProperties{
// TTL: to.Ptr[int64](3600),
// CaaRecords: []*armdns.CaaRecord{
// {
// Flags: to.Ptr[int32](0),
// Tag: to.Ptr("issue"),
// Value: to.Ptr("ca.contoso.com"),
// }},
// Fqdn: to.Ptr("record1.zone1"),
// Metadata: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DnsManagementClient } = require("@azure/arm-dns");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
*
* @summary Lists the record sets of a specified type in a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCaaRecordset.json
*/
async function listCaaRecordsets() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const recordType = "CAA";
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.recordSets.listByType(resourceGroupName, zoneName, recordType)) {
resArray.push(item);
}
console.log(resArray);
}
listCaaRecordsets().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"nextLink": "https://servicehost/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CAA?api-version=2018-05-01&$skipToken=skipToken",
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CAA/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/CAA",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"caaRecords": [
{
"flags": 0,
"tag": "issue",
"value": "ca.contoso.com"
}
]
}
}
]
}
List CNAME recordsets
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CNAME?api-version=2018-05-01
import com.azure.resourcemanager.dns.models.RecordType;
/** Samples for RecordSets ListByType. */
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCNAMERecordset.json
*/
/**
* Sample code: List CNAME recordsets.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listCNAMERecordsets(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().listByType("rg1", "zone1", RecordType.CNAME, null,
null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.dns import DnsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-dns
# USAGE
python list_cname_recordset.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DnsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.record_sets.list_by_type(
resource_group_name="rg1",
zone_name="zone1",
record_type="CNAME",
)
for item in response:
print(item)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCNAMERecordset.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdns_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCNAMERecordset.json
func ExampleRecordSetsClient_NewListByTypePager_listCnameRecordsets() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdns.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRecordSetsClient().NewListByTypePager("rg1", "zone1", armdns.RecordTypeCNAME, &armdns.RecordSetsClientListByTypeOptions{Top: nil,
Recordsetnamesuffix: nil,
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.RecordSetListResult = armdns.RecordSetListResult{
// Value: []*armdns.RecordSet{
// {
// Name: to.Ptr("record1"),
// Type: to.Ptr("Microsoft.Network/dnsZones/CNAME"),
// Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CNAME/record1"),
// Properties: &armdns.RecordSetProperties{
// CnameRecord: &armdns.CnameRecord{
// Cname: to.Ptr("contoso.com"),
// },
// TTL: to.Ptr[int64](3600),
// Fqdn: to.Ptr("record1.zone1"),
// Metadata: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DnsManagementClient } = require("@azure/arm-dns");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
*
* @summary Lists the record sets of a specified type in a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCNAMERecordset.json
*/
async function listCnameRecordsets() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const recordType = "CNAME";
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.recordSets.listByType(resourceGroupName, zoneName, recordType)) {
resArray.push(item);
}
console.log(resArray);
}
listCnameRecordsets().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"nextLink": "https://servicehost/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CNAME?api-version=2018-05-01&$skipToken=skipToken",
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CNAME/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/CNAME",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"CNAMERecord": {
"cname": "contoso.com"
}
}
}
]
}
List MX recordsets
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/MX?api-version=2018-05-01
import com.azure.resourcemanager.dns.models.RecordType;
/** Samples for RecordSets ListByType. */
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListMXRecordset.json
*/
/**
* Sample code: List MX recordsets.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listMXRecordsets(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().listByType("rg1", "zone1", RecordType.MX, null, null,
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.dns import DnsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-dns
# USAGE
python list_mx_recordset.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DnsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.record_sets.list_by_type(
resource_group_name="rg1",
zone_name="zone1",
record_type="MX",
)
for item in response:
print(item)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListMXRecordset.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdns_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListMXRecordset.json
func ExampleRecordSetsClient_NewListByTypePager_listMxRecordsets() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdns.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRecordSetsClient().NewListByTypePager("rg1", "zone1", armdns.RecordTypeMX, &armdns.RecordSetsClientListByTypeOptions{Top: nil,
Recordsetnamesuffix: nil,
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.RecordSetListResult = armdns.RecordSetListResult{
// Value: []*armdns.RecordSet{
// {
// Name: to.Ptr("record1"),
// Type: to.Ptr("Microsoft.Network/dnsZones/MX"),
// Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/MX/record1"),
// Properties: &armdns.RecordSetProperties{
// MxRecords: []*armdns.MxRecord{
// {
// Exchange: to.Ptr("mail.contoso.com"),
// Preference: to.Ptr[int32](0),
// }},
// TTL: to.Ptr[int64](3600),
// Fqdn: to.Ptr("record1.zone1"),
// Metadata: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DnsManagementClient } = require("@azure/arm-dns");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
*
* @summary Lists the record sets of a specified type in a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListMXRecordset.json
*/
async function listMxRecordsets() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const recordType = "MX";
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.recordSets.listByType(resourceGroupName, zoneName, recordType)) {
resArray.push(item);
}
console.log(resArray);
}
listMxRecordsets().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"nextLink": "https://servicehost/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/MX?api-version=2018-05-01&$skipToken=skipToken",
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/MX/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/MX",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"MXRecords": [
{
"preference": 0,
"exchange": "mail.contoso.com"
}
]
}
}
]
}
List NS recordsets
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NS?api-version=2018-05-01
import com.azure.resourcemanager.dns.models.RecordType;
/** Samples for RecordSets ListByType. */
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListNSRecordset.json
*/
/**
* Sample code: List NS recordsets.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listNSRecordsets(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().listByType("rg1", "zone1", RecordType.NS, null, null,
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.dns import DnsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-dns
# USAGE
python list_ns_recordset.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DnsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.record_sets.list_by_type(
resource_group_name="rg1",
zone_name="zone1",
record_type="NS",
)
for item in response:
print(item)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListNSRecordset.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdns_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListNSRecordset.json
func ExampleRecordSetsClient_NewListByTypePager_listNsRecordsets() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdns.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRecordSetsClient().NewListByTypePager("rg1", "zone1", armdns.RecordTypeNS, &armdns.RecordSetsClientListByTypeOptions{Top: nil,
Recordsetnamesuffix: nil,
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.RecordSetListResult = armdns.RecordSetListResult{
// Value: []*armdns.RecordSet{
// {
// Name: to.Ptr("record1"),
// Type: to.Ptr("Microsoft.Network/dnsZones/NS"),
// Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NS/record1"),
// Properties: &armdns.RecordSetProperties{
// NsRecords: []*armdns.NsRecord{
// {
// Nsdname: to.Ptr("ns1.contoso.com"),
// }},
// TTL: to.Ptr[int64](3600),
// Fqdn: to.Ptr("record1.zone1"),
// Metadata: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DnsManagementClient } = require("@azure/arm-dns");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
*
* @summary Lists the record sets of a specified type in a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListNSRecordset.json
*/
async function listNsRecordsets() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const recordType = "NS";
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.recordSets.listByType(resourceGroupName, zoneName, recordType)) {
resArray.push(item);
}
console.log(resArray);
}
listNsRecordsets().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"nextLink": "https://servicehost/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NS?api-version=2018-05-01&$skipToken=skipToken",
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NS/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/NS",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"NSRecords": [
{
"nsdname": "ns1.contoso.com"
}
]
}
}
]
}
List PTR recordsets
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/0.0.127.in-addr.arpa/PTR?api-version=2018-05-01
import com.azure.resourcemanager.dns.models.RecordType;
/** Samples for RecordSets ListByType. */
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListPTRRecordset.json
*/
/**
* Sample code: List PTR recordsets.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listPTRRecordsets(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().listByType("rg1", "0.0.127.in-addr.arpa",
RecordType.PTR, null, null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.dns import DnsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-dns
# USAGE
python list_ptr_recordset.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DnsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.record_sets.list_by_type(
resource_group_name="rg1",
zone_name="0.0.127.in-addr.arpa",
record_type="PTR",
)
for item in response:
print(item)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListPTRRecordset.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdns_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListPTRRecordset.json
func ExampleRecordSetsClient_NewListByTypePager_listPtrRecordsets() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdns.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRecordSetsClient().NewListByTypePager("rg1", "0.0.127.in-addr.arpa", armdns.RecordTypePTR, &armdns.RecordSetsClientListByTypeOptions{Top: nil,
Recordsetnamesuffix: nil,
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.RecordSetListResult = armdns.RecordSetListResult{
// Value: []*armdns.RecordSet{
// {
// Name: to.Ptr("1"),
// Type: to.Ptr("Microsoft.Network/dnsZones/PTR"),
// Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/0.0.127.in-addr.arpa/PTR/1"),
// Properties: &armdns.RecordSetProperties{
// PtrRecords: []*armdns.PtrRecord{
// {
// Ptrdname: to.Ptr("localhost"),
// }},
// TTL: to.Ptr[int64](3600),
// Fqdn: to.Ptr("1.0.0.127.in-addr.arpa"),
// Metadata: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DnsManagementClient } = require("@azure/arm-dns");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
*
* @summary Lists the record sets of a specified type in a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListPTRRecordset.json
*/
async function listPtrRecordsets() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "0.0.127.in-addr.arpa";
const recordType = "PTR";
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.recordSets.listByType(resourceGroupName, zoneName, recordType)) {
resArray.push(item);
}
console.log(resArray);
}
listPtrRecordsets().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"nextLink": "https://servicehost/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/0.0.127.in-addr.arpa/PTR?api-version=2018-05-01&$skipToken=skipToken",
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/0.0.127.in-addr.arpa/PTR/1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "1",
"type": "Microsoft.Network/dnsZones/PTR",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "1.0.0.127.in-addr.arpa",
"PTRRecords": [
{
"ptrdname": "localhost"
}
]
}
}
]
}
List SOA recordsets
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SOA?api-version=2018-05-01
import com.azure.resourcemanager.dns.models.RecordType;
/** Samples for RecordSets ListByType. */
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSOARecordset.json
*/
/**
* Sample code: List SOA recordsets.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listSOARecordsets(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().listByType("rg1", "zone1", RecordType.SOA, null,
null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.dns import DnsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-dns
# USAGE
python list_soa_recordset.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DnsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.record_sets.list_by_type(
resource_group_name="rg1",
zone_name="zone1",
record_type="SOA",
)
for item in response:
print(item)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSOARecordset.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdns_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSOARecordset.json
func ExampleRecordSetsClient_NewListByTypePager_listSoaRecordsets() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdns.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRecordSetsClient().NewListByTypePager("rg1", "zone1", armdns.RecordTypeSOA, &armdns.RecordSetsClientListByTypeOptions{Top: nil,
Recordsetnamesuffix: nil,
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.RecordSetListResult = armdns.RecordSetListResult{
// Value: []*armdns.RecordSet{
// {
// Name: to.Ptr("@"),
// Type: to.Ptr("Microsoft.Network/dnsZones/SOA"),
// Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SOA/@"),
// Properties: &armdns.RecordSetProperties{
// SoaRecord: &armdns.SoaRecord{
// Email: to.Ptr("hostmaster.contoso.com"),
// ExpireTime: to.Ptr[int64](2419200),
// Host: to.Ptr("ns1.contoso.com"),
// MinimumTTL: to.Ptr[int64](300),
// RefreshTime: to.Ptr[int64](3600),
// RetryTime: to.Ptr[int64](300),
// SerialNumber: to.Ptr[int64](1),
// },
// TTL: to.Ptr[int64](3600),
// Fqdn: to.Ptr("zone1"),
// Metadata: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DnsManagementClient } = require("@azure/arm-dns");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
*
* @summary Lists the record sets of a specified type in a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSOARecordset.json
*/
async function listSoaRecordsets() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const recordType = "SOA";
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.recordSets.listByType(resourceGroupName, zoneName, recordType)) {
resArray.push(item);
}
console.log(resArray);
}
listSoaRecordsets().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"nextLink": "https://servicehost/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SOA?api-version=2018-05-01&$skipToken=skipToken",
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SOA/@",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "@",
"type": "Microsoft.Network/dnsZones/SOA",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "zone1",
"SOARecord": {
"host": "ns1.contoso.com",
"email": "hostmaster.contoso.com",
"serialNumber": 1,
"refreshTime": 3600,
"retryTime": 300,
"expireTime": 2419200,
"minimumTTL": 300
}
}
}
]
}
List SRV recordsets
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SRV?api-version=2018-05-01
import com.azure.resourcemanager.dns.models.RecordType;
/** Samples for RecordSets ListByType. */
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSRVRecordset.json
*/
/**
* Sample code: List SRV recordsets.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listSRVRecordsets(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().listByType("rg1", "zone1", RecordType.SRV, null,
null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.dns import DnsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-dns
# USAGE
python list_srv_recordset.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DnsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.record_sets.list_by_type(
resource_group_name="rg1",
zone_name="zone1",
record_type="SRV",
)
for item in response:
print(item)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSRVRecordset.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdns_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSRVRecordset.json
func ExampleRecordSetsClient_NewListByTypePager_listSrvRecordsets() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdns.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRecordSetsClient().NewListByTypePager("rg1", "zone1", armdns.RecordTypeSRV, &armdns.RecordSetsClientListByTypeOptions{Top: nil,
Recordsetnamesuffix: nil,
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.RecordSetListResult = armdns.RecordSetListResult{
// Value: []*armdns.RecordSet{
// {
// Name: to.Ptr("record1"),
// Type: to.Ptr("Microsoft.Network/dnsZones/SRV"),
// Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SRV/record1"),
// Properties: &armdns.RecordSetProperties{
// SrvRecords: []*armdns.SrvRecord{
// {
// Port: to.Ptr[int32](80),
// Priority: to.Ptr[int32](0),
// Target: to.Ptr("contoso.com"),
// Weight: to.Ptr[int32](10),
// }},
// TTL: to.Ptr[int64](3600),
// Fqdn: to.Ptr("record1.zone1"),
// Metadata: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DnsManagementClient } = require("@azure/arm-dns");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
*
* @summary Lists the record sets of a specified type in a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSRVRecordset.json
*/
async function listSrvRecordsets() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const recordType = "SRV";
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.recordSets.listByType(resourceGroupName, zoneName, recordType)) {
resArray.push(item);
}
console.log(resArray);
}
listSrvRecordsets().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"nextLink": "https://servicehost/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SRV?api-version=2018-05-01&$skipToken=skipToken",
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SRV/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/SRV",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"SRVRecords": [
{
"priority": 0,
"weight": 10,
"port": 80,
"target": "contoso.com"
}
]
}
}
]
}
List TXT recordsets
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TXT?api-version=2018-05-01
import com.azure.resourcemanager.dns.models.RecordType;
/** Samples for RecordSets ListByType. */
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListTXTRecordset.json
*/
/**
* Sample code: List TXT recordsets.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listTXTRecordsets(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().listByType("rg1", "zone1", RecordType.TXT, null,
null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.dns import DnsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-dns
# USAGE
python list_txt_recordset.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = DnsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.record_sets.list_by_type(
resource_group_name="rg1",
zone_name="zone1",
record_type="TXT",
)
for item in response:
print(item)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListTXTRecordset.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdns_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListTXTRecordset.json
func ExampleRecordSetsClient_NewListByTypePager_listTxtRecordsets() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdns.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRecordSetsClient().NewListByTypePager("rg1", "zone1", armdns.RecordTypeTXT, &armdns.RecordSetsClientListByTypeOptions{Top: nil,
Recordsetnamesuffix: nil,
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.RecordSetListResult = armdns.RecordSetListResult{
// Value: []*armdns.RecordSet{
// {
// Name: to.Ptr("record1"),
// Type: to.Ptr("Microsoft.Network/dnsZones/TXT"),
// Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TXT/record1"),
// Properties: &armdns.RecordSetProperties{
// TTL: to.Ptr[int64](3600),
// TxtRecords: []*armdns.TxtRecord{
// {
// Value: []*string{
// to.Ptr("string1"),
// to.Ptr("string2")},
// }},
// Fqdn: to.Ptr("record1.zone1"),
// Metadata: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DnsManagementClient } = require("@azure/arm-dns");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists the record sets of a specified type in a DNS zone.
*
* @summary Lists the record sets of a specified type in a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListTXTRecordset.json
*/
async function listTxtRecordsets() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const recordType = "TXT";
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.recordSets.listByType(resourceGroupName, zoneName, recordType)) {
resArray.push(item);
}
console.log(resArray);
}
listTxtRecordsets().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"nextLink": "https://servicehost/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TXT?api-version=2018-05-01&$skipToken=skipToken",
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TXT/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/TXT",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"TXTRecords": [
{
"value": [
"string1",
"string2"
]
}
]
}
}
]
}
定義
AaaaRecord
AAAA レコード。
名前 |
型 |
説明 |
ipv6Address
|
string
|
この AAAA レコードの IPv6 アドレス。
|
ARecord
A レコード。
名前 |
型 |
説明 |
ipv4Address
|
string
|
この A レコードの IPv4 アドレス。
|
CaaRecord
CAA レコード。
名前 |
型 |
説明 |
flags
|
integer
|
この CAA のフラグは、0 ~ 255 の整数として記録されます。
|
tag
|
string
|
この CAA レコードのタグ。
|
value
|
string
|
この CAA レコードの値。
|
CloudError
サービスからのエラー応答。
CloudErrorBody
サービスからのエラー応答。
名前 |
型 |
説明 |
code
|
string
|
エラーの識別子。 コードは不変であり、プログラムによって使用されることを意図しています。
|
details
|
CloudErrorBody[]
|
エラーに関する追加の詳細の一覧。
|
message
|
string
|
ユーザー インターフェイスでの表示に適したエラーを説明するメッセージ。
|
target
|
string
|
特定のエラーのターゲット。 たとえば、エラーが発生したプロパティの名前です。
|
CnameRecord
CNAME レコード。
名前 |
型 |
説明 |
cname
|
string
|
この CNAME レコードの正規名。
|
MxRecord
MX レコード。
名前 |
型 |
説明 |
exchange
|
string
|
この MX レコードのメール ホストのドメイン名。
|
preference
|
integer
|
この MX レコードの基本設定値。
|
NsRecord
NS レコード。
名前 |
型 |
説明 |
nsdname
|
string
|
この NS レコードのネーム サーバー名。
|
PtrRecord
PTR レコード。
名前 |
型 |
説明 |
ptrdname
|
string
|
この PTR レコードの PTR ターゲット ドメイン名。
|
RecordSet
DNS レコード セット (名前と種類が同じ DNS レコードのコレクション) について説明します。
名前 |
型 |
説明 |
etag
|
string
|
レコード セットの etag。
|
id
|
string
|
レコード セットの ID。
|
name
|
string
|
レコード セットの名前。
|
properties.AAAARecords
|
AaaaRecord[]
|
レコード セット内の AAAA レコードの一覧。
|
properties.ARecords
|
ARecord[]
|
レコード セット内の A レコードの一覧。
|
properties.CNAMERecord
|
CnameRecord
|
レコード セット内の CNAME レコード。
|
properties.MXRecords
|
MxRecord[]
|
レコード セット内の MX レコードの一覧。
|
properties.NSRecords
|
NsRecord[]
|
レコード セット内の NS レコードの一覧。
|
properties.PTRRecords
|
PtrRecord[]
|
レコード セット内の PTR レコードの一覧。
|
properties.SOARecord
|
SoaRecord
|
レコード セット内の SOA レコード。
|
properties.SRVRecords
|
SrvRecord[]
|
レコード セット内の SRV レコードの一覧。
|
properties.TTL
|
integer
|
レコード セット内のレコードの TTL (有効期間)。
|
properties.TXTRecords
|
TxtRecord[]
|
レコード セット内の TXT レコードの一覧。
|
properties.caaRecords
|
CaaRecord[]
|
レコード セット内の CAA レコードの一覧。
|
properties.fqdn
|
string
|
レコード セットの完全修飾ドメイン名。
|
properties.metadata
|
object
|
レコード セットにアタッチされたメタデータ。
|
properties.provisioningState
|
string
|
provisioning レコード セットの状態。
|
properties.targetResource
|
SubResource
|
dns リソース値の取得元の Azure リソースへの参照。
|
type
|
string
|
レコード セットの型。
|
RecordSetListResult
レコード セットのリスト操作に対する応答。
名前 |
型 |
説明 |
nextLink
|
string
|
結果の次のページの継続トークン。
|
value
|
RecordSet[]
|
応答のレコード セットに関する情報。
|
RecordType
列挙するレコード セットの種類。
名前 |
型 |
説明 |
A
|
string
|
|
AAAA
|
string
|
|
CAA
|
string
|
|
CNAME
|
string
|
|
MX
|
string
|
|
NS
|
string
|
|
PTR
|
string
|
|
SOA
|
string
|
|
SRV
|
string
|
|
TXT
|
string
|
|
SoaRecord
SOA レコード。
名前 |
型 |
説明 |
email
|
string
|
この SOA レコードの電子メール連絡先。
|
expireTime
|
integer
|
この SOA レコードの有効期限。
|
host
|
string
|
この SOA レコードの権限のあるネーム サーバーのドメイン名。
|
minimumTTL
|
integer
|
この SOA レコードの最小値。 慣例により、これは負のキャッシュ期間を決定するために使用されます。
|
refreshTime
|
integer
|
この SOA レコードの更新値。
|
retryTime
|
integer
|
この SOA レコードの再試行時間。
|
serialNumber
|
integer
|
この SOA レコードのシリアル番号。
|
SrvRecord
SRV レコード。
名前 |
型 |
説明 |
port
|
integer
|
この SRV レコードのポート値。
|
priority
|
integer
|
この SRV レコードの優先度の値。
|
target
|
string
|
この SRV レコードのターゲット ドメイン名。
|
weight
|
integer
|
この SRV レコードの重みの値。
|
SubResource
別のリソースへの参照
名前 |
型 |
説明 |
id
|
string
|
リソース ID。
|
TxtRecord
TXT レコード。
名前 |
型 |
説明 |
value
|
string[]
|
この TXT レコードのテキスト値。
|