Crée ou met à jour un jeu d’enregistrements dans une zone DNS.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}?api-version=2018-05-01
Paramètres URI
Nom |
Dans |
Obligatoire |
Type |
Description |
recordType
|
path |
True
|
RecordType
|
Type d’enregistrement DNS dans ce jeu d’enregistrements. Les jeux d’enregistrements de type SOA peuvent être mis à jour, mais pas créés (ils sont créés lors de la création de la zone DNS).
|
relativeRecordSetName
|
path |
True
|
string
|
Nom du jeu d’enregistrements, relatif au nom de la zone.
|
resourceGroupName
|
path |
True
|
string
|
Nom du groupe de ressources.
|
subscriptionId
|
path |
True
|
string
|
Spécifie l’ID d’abonnement Azure, qui identifie de manière unique l’abonnement Microsoft Azure.
|
zoneName
|
path |
True
|
string
|
Nom de la zone DNS (sans point de fin).
|
api-version
|
query |
True
|
string
|
Spécifie la version de l'API.
|
Nom |
Obligatoire |
Type |
Description |
If-Match
|
|
string
|
Etag du jeu d’enregistrements. Omettez cette valeur pour toujours remplacer le jeu d’enregistrements actif. Spécifiez la dernière valeur etag vue pour empêcher le remplacement accidentel de modifications simultanées.
|
If-None-Match
|
|
string
|
Définissez la valeur « * » pour permettre la création d’un jeu d’enregistrements, mais pour empêcher la mise à jour d’un jeu d’enregistrements existant. Les autres valeurs seront ignorées.
|
Corps de la demande
Nom |
Type |
Description |
etag
|
string
|
Etag du jeu d’enregistrements.
|
properties.AAAARecords
|
AaaaRecord[]
|
Liste des enregistrements AAAA dans le jeu d’enregistrements.
|
properties.ARecords
|
ARecord[]
|
Liste des enregistrements A dans le jeu d’enregistrements.
|
properties.CNAMERecord
|
CnameRecord
|
Enregistrement CNAME dans le jeu d’enregistrements.
|
properties.MXRecords
|
MxRecord[]
|
Liste des enregistrements MX dans le jeu d’enregistrements.
|
properties.NSRecords
|
NsRecord[]
|
Liste des enregistrements NS dans le jeu d’enregistrements.
|
properties.PTRRecords
|
PtrRecord[]
|
Liste des enregistrements PTR dans le jeu d’enregistrements.
|
properties.SOARecord
|
SoaRecord
|
Enregistrement SOA dans le jeu d’enregistrements.
|
properties.SRVRecords
|
SrvRecord[]
|
Liste des enregistrements SRV dans le jeu d’enregistrements.
|
properties.TTL
|
integer
|
Durée de vie (durée de vie) des enregistrements dans le jeu d’enregistrements.
|
properties.TXTRecords
|
TxtRecord[]
|
Liste des enregistrements TXT dans le jeu d’enregistrements.
|
properties.caaRecords
|
CaaRecord[]
|
Liste des enregistrements CAA dans le jeu d’enregistrements.
|
properties.metadata
|
object
|
Métadonnées attachées au jeu d’enregistrements.
|
properties.targetResource
|
SubResource
|
Référence à une ressource Azure à partir de laquelle la valeur de ressource dns est extraite.
|
Réponses
Nom |
Type |
Description |
200 OK
|
RecordSet
|
Le jeu d’enregistrements a été mis à jour.
|
201 Created
|
RecordSet
|
Le jeu d’enregistrements a été créé.
|
Other Status Codes
|
CloudError
|
Réponse par défaut. Il sera désérialisé conformément à la définition d’erreur.
|
Exemples
Create A recordset
Exemple de requête
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/A/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"ARecords": [
{
"ipv4Address": "127.0.0.1"
}
]
}
}
import com.azure.resourcemanager.dns.fluent.models.RecordSetInner;
import com.azure.resourcemanager.dns.models.ARecord;
import com.azure.resourcemanager.dns.models.RecordType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for RecordSets CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordset.json
*/
/**
* Sample code: Create A recordset.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createARecordset(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().createOrUpdateWithResponse("rg1", "zone1", "record1",
RecordType.A,
new RecordSetInner().withMetadata(mapOf("key1", "fakeTokenPlaceholder")).withTtl(3600L)
.withARecords(Arrays.asList(new ARecord().withIpv4Address("127.0.0.1"))),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
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 create_or_update_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.create_or_update(
resource_group_name="rg1",
zone_name="zone1",
relative_record_set_name="record1",
record_type="A",
parameters={
"properties": {"ARecords": [{"ipv4Address": "127.0.0.1"}], "TTL": 3600, "metadata": {"key1": "value1"}}
},
)
print(response)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordset.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/azcore/to"
"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/CreateOrUpdateARecordset.json
func ExampleRecordSetsClient_CreateOrUpdate_createARecordset() {
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)
}
res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "rg1", "zone1", "record1", armdns.RecordTypeA, armdns.RecordSet{
Properties: &armdns.RecordSetProperties{
ARecords: []*armdns.ARecord{
{
IPv4Address: to.Ptr("127.0.0.1"),
}},
TTL: to.Ptr[int64](3600),
Metadata: map[string]*string{
"key1": to.Ptr("value1"),
},
},
}, &armdns.RecordSetsClientCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.RecordSet = 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 Creates or updates a record set within a DNS zone.
*
* @summary Creates or updates a record set within a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordset.json
*/
async function createARecordset() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const relativeRecordSetName = "record1";
const recordType = "A";
const parameters = {
aRecords: [{ ipv4Address: "127.0.0.1" }],
ttl: 3600,
metadata: { key1: "value1" },
};
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const result = await client.recordSets.createOrUpdate(
resourceGroupName,
zoneName,
relativeRecordSetName,
recordType,
parameters
);
console.log(result);
}
createARecordset().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
Exemple de réponse
{
"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"
}
]
}
}
{
"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"
}
]
}
}
Create A recordset with alias target resource
Exemple de requête
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/A/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"targetResource": {
"id": "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"
}
}
}
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.dns.fluent.models.RecordSetInner;
import com.azure.resourcemanager.dns.models.RecordType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for RecordSets CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordsetAlias.
* json
*/
/**
* Sample code: Create A recordset with alias target resource.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createARecordsetWithAliasTargetResource(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().createOrUpdateWithResponse("rg1", "zone1", "record1",
RecordType.A,
new RecordSetInner().withMetadata(mapOf("key1", "fakeTokenPlaceholder")).withTtl(3600L)
.withTargetResource(new SubResource().withId(
"/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2")),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
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 create_or_update_arecordset_alias.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.create_or_update(
resource_group_name="rg1",
zone_name="zone1",
relative_record_set_name="record1",
record_type="A",
parameters={
"properties": {
"TTL": 3600,
"metadata": {"key1": "value1"},
"targetResource": {
"id": "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"
},
}
},
)
print(response)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordsetAlias.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/azcore/to"
"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/CreateOrUpdateARecordsetAlias.json
func ExampleRecordSetsClient_CreateOrUpdate_createARecordsetWithAliasTargetResource() {
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)
}
res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "rg1", "zone1", "record1", armdns.RecordTypeA, armdns.RecordSet{
Properties: &armdns.RecordSetProperties{
TTL: to.Ptr[int64](3600),
Metadata: map[string]*string{
"key1": to.Ptr("value1"),
},
TargetResource: &armdns.SubResource{
ID: to.Ptr("/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"),
},
},
}, &armdns.RecordSetsClientCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.RecordSet = 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{
// TTL: to.Ptr[int64](3600),
// Fqdn: to.Ptr("record1.zone1"),
// Metadata: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// ProvisioningState: to.Ptr("Succeeded"),
// TargetResource: &armdns.SubResource{
// ID: to.Ptr("/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"),
// },
// },
// }
}
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 Creates or updates a record set within a DNS zone.
*
* @summary Creates or updates a record set within a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordsetAlias.json
*/
async function createARecordsetWithAliasTargetResource() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const relativeRecordSetName = "record1";
const recordType = "A";
const parameters = {
ttl: 3600,
metadata: { key1: "value1" },
targetResource: {
id: "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2",
},
};
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const result = await client.recordSets.createOrUpdate(
resourceGroupName,
zoneName,
relativeRecordSetName,
recordType,
parameters
);
console.log(result);
}
createARecordsetWithAliasTargetResource().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
Exemple de réponse
{
"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",
"targetResource": {
"id": "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"
},
"provisioningState": "Succeeded"
}
}
{
"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",
"targetResource": {
"id": "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"
},
"provisioningState": "Succeeded"
}
}
Create AAAA recordset
Exemple de requête
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/AAAA/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"AAAARecords": [
{
"ipv6Address": "::1"
}
]
}
}
import com.azure.resourcemanager.dns.fluent.models.RecordSetInner;
import com.azure.resourcemanager.dns.models.AaaaRecord;
import com.azure.resourcemanager.dns.models.RecordType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for RecordSets CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateAAAARecordset.json
*/
/**
* Sample code: Create AAAA recordset.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createAAAARecordset(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().createOrUpdateWithResponse("rg1", "zone1", "record1",
RecordType.AAAA, new RecordSetInner().withMetadata(mapOf("key1", "fakeTokenPlaceholder")).withTtl(3600L)
.withAaaaRecords(Arrays.asList(new AaaaRecord().withIpv6Address("::1"))),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
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 create_or_update_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.create_or_update(
resource_group_name="rg1",
zone_name="zone1",
relative_record_set_name="record1",
record_type="AAAA",
parameters={
"properties": {"AAAARecords": [{"ipv6Address": "::1"}], "TTL": 3600, "metadata": {"key1": "value1"}}
},
)
print(response)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateAAAARecordset.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/azcore/to"
"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/CreateOrUpdateAAAARecordset.json
func ExampleRecordSetsClient_CreateOrUpdate_createAaaaRecordset() {
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)
}
res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "rg1", "zone1", "record1", armdns.RecordTypeAAAA, armdns.RecordSet{
Properties: &armdns.RecordSetProperties{
AaaaRecords: []*armdns.AaaaRecord{
{
IPv6Address: to.Ptr("::1"),
}},
TTL: to.Ptr[int64](3600),
Metadata: map[string]*string{
"key1": to.Ptr("value1"),
},
},
}, &armdns.RecordSetsClientCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.RecordSet = 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 Creates or updates a record set within a DNS zone.
*
* @summary Creates or updates a record set within a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateAAAARecordset.json
*/
async function createAaaaRecordset() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const relativeRecordSetName = "record1";
const recordType = "AAAA";
const parameters = {
aaaaRecords: [{ ipv6Address: "::1" }],
ttl: 3600,
metadata: { key1: "value1" },
};
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const result = await client.recordSets.createOrUpdate(
resourceGroupName,
zoneName,
relativeRecordSetName,
recordType,
parameters
);
console.log(result);
}
createAaaaRecordset().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
Exemple de réponse
{
"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"
}
]
}
}
{
"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"
}
]
}
}
Create CAA recordset
Exemple de requête
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CAA/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"caaRecords": [
{
"flags": 0,
"tag": "issue",
"value": "ca.contoso.com"
}
]
}
}
import com.azure.resourcemanager.dns.fluent.models.RecordSetInner;
import com.azure.resourcemanager.dns.models.CaaRecord;
import com.azure.resourcemanager.dns.models.RecordType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for RecordSets CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateCaaRecordset.json
*/
/**
* Sample code: Create CAA recordset.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createCAARecordset(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().createOrUpdateWithResponse("rg1", "zone1", "record1",
RecordType.CAA,
new RecordSetInner().withMetadata(mapOf("key1", "fakeTokenPlaceholder")).withTtl(3600L).withCaaRecords(
Arrays.asList(new CaaRecord().withFlags(0).withTag("issue").withValue("ca.contoso.com"))),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
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 create_or_update_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.create_or_update(
resource_group_name="rg1",
zone_name="zone1",
relative_record_set_name="record1",
record_type="CAA",
parameters={
"properties": {
"TTL": 3600,
"caaRecords": [{"flags": 0, "tag": "issue", "value": "ca.contoso.com"}],
"metadata": {"key1": "value1"},
}
},
)
print(response)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateCaaRecordset.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/azcore/to"
"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/CreateOrUpdateCaaRecordset.json
func ExampleRecordSetsClient_CreateOrUpdate_createCaaRecordset() {
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)
}
res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "rg1", "zone1", "record1", armdns.RecordTypeCAA, armdns.RecordSet{
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"),
}},
Metadata: map[string]*string{
"key1": to.Ptr("value1"),
},
},
}, &armdns.RecordSetsClientCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.RecordSet = 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 Creates or updates a record set within a DNS zone.
*
* @summary Creates or updates a record set within a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateCaaRecordset.json
*/
async function createCaaRecordset() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const relativeRecordSetName = "record1";
const recordType = "CAA";
const parameters = {
ttl: 3600,
caaRecords: [{ flags: 0, tag: "issue", value: "ca.contoso.com" }],
metadata: { key1: "value1" },
};
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const result = await client.recordSets.createOrUpdate(
resourceGroupName,
zoneName,
relativeRecordSetName,
recordType,
parameters
);
console.log(result);
}
createCaaRecordset().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
Exemple de réponse
{
"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"
}
]
}
}
{
"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"
}
]
}
}
Create CNAME recordset
Exemple de requête
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CNAME/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"CNAMERecord": {
"cname": "contoso.com"
}
}
}
import com.azure.resourcemanager.dns.fluent.models.RecordSetInner;
import com.azure.resourcemanager.dns.models.CnameRecord;
import com.azure.resourcemanager.dns.models.RecordType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for RecordSets CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateCNAMERecordset.json
*/
/**
* Sample code: Create CNAME recordset.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createCNAMERecordset(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().createOrUpdateWithResponse("rg1", "zone1", "record1",
RecordType.CNAME, new RecordSetInner().withMetadata(mapOf("key1", "fakeTokenPlaceholder")).withTtl(3600L)
.withCnameRecord(new CnameRecord().withCname("contoso.com")),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
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 create_or_update_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.create_or_update(
resource_group_name="rg1",
zone_name="zone1",
relative_record_set_name="record1",
record_type="CNAME",
parameters={
"properties": {"CNAMERecord": {"cname": "contoso.com"}, "TTL": 3600, "metadata": {"key1": "value1"}}
},
)
print(response)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateCNAMERecordset.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/azcore/to"
"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/CreateOrUpdateCNAMERecordset.json
func ExampleRecordSetsClient_CreateOrUpdate_createCnameRecordset() {
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)
}
res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "rg1", "zone1", "record1", armdns.RecordTypeCNAME, armdns.RecordSet{
Properties: &armdns.RecordSetProperties{
CnameRecord: &armdns.CnameRecord{
Cname: to.Ptr("contoso.com"),
},
TTL: to.Ptr[int64](3600),
Metadata: map[string]*string{
"key1": to.Ptr("value1"),
},
},
}, &armdns.RecordSetsClientCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.RecordSet = 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 Creates or updates a record set within a DNS zone.
*
* @summary Creates or updates a record set within a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateCNAMERecordset.json
*/
async function createCnameRecordset() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const relativeRecordSetName = "record1";
const recordType = "CNAME";
const parameters = {
cnameRecord: { cname: "contoso.com" },
ttl: 3600,
metadata: { key1: "value1" },
};
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const result = await client.recordSets.createOrUpdate(
resourceGroupName,
zoneName,
relativeRecordSetName,
recordType,
parameters
);
console.log(result);
}
createCnameRecordset().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
Exemple de réponse
{
"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"
}
}
}
{
"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"
}
}
}
Create MX recordset
Exemple de requête
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/MX/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"MXRecords": [
{
"preference": 0,
"exchange": "mail.contoso.com"
}
]
}
}
import com.azure.resourcemanager.dns.fluent.models.RecordSetInner;
import com.azure.resourcemanager.dns.models.MxRecord;
import com.azure.resourcemanager.dns.models.RecordType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for RecordSets CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateMXRecordset.json
*/
/**
* Sample code: Create MX recordset.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createMXRecordset(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().createOrUpdateWithResponse("rg1", "zone1", "record1",
RecordType.MX,
new RecordSetInner().withMetadata(mapOf("key1", "fakeTokenPlaceholder")).withTtl(3600L)
.withMxRecords(Arrays.asList(new MxRecord().withPreference(0).withExchange("mail.contoso.com"))),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
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 create_or_update_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.create_or_update(
resource_group_name="rg1",
zone_name="zone1",
relative_record_set_name="record1",
record_type="MX",
parameters={
"properties": {
"MXRecords": [{"exchange": "mail.contoso.com", "preference": 0}],
"TTL": 3600,
"metadata": {"key1": "value1"},
}
},
)
print(response)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateMXRecordset.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/azcore/to"
"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/CreateOrUpdateMXRecordset.json
func ExampleRecordSetsClient_CreateOrUpdate_createMxRecordset() {
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)
}
res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "rg1", "zone1", "record1", armdns.RecordTypeMX, armdns.RecordSet{
Properties: &armdns.RecordSetProperties{
MxRecords: []*armdns.MxRecord{
{
Exchange: to.Ptr("mail.contoso.com"),
Preference: to.Ptr[int32](0),
}},
TTL: to.Ptr[int64](3600),
Metadata: map[string]*string{
"key1": to.Ptr("value1"),
},
},
}, &armdns.RecordSetsClientCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.RecordSet = 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 Creates or updates a record set within a DNS zone.
*
* @summary Creates or updates a record set within a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateMXRecordset.json
*/
async function createMxRecordset() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const relativeRecordSetName = "record1";
const recordType = "MX";
const parameters = {
mxRecords: [{ exchange: "mail.contoso.com", preference: 0 }],
ttl: 3600,
metadata: { key1: "value1" },
};
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const result = await client.recordSets.createOrUpdate(
resourceGroupName,
zoneName,
relativeRecordSetName,
recordType,
parameters
);
console.log(result);
}
createMxRecordset().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
Exemple de réponse
{
"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"
}
]
}
}
{
"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"
}
]
}
}
Create NS recordset
Exemple de requête
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NS/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"NSRecords": [
{
"nsdname": "ns1.contoso.com"
}
]
}
}
import com.azure.resourcemanager.dns.fluent.models.RecordSetInner;
import com.azure.resourcemanager.dns.models.NsRecord;
import com.azure.resourcemanager.dns.models.RecordType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for RecordSets CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateNSRecordset.json
*/
/**
* Sample code: Create NS recordset.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createNSRecordset(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().createOrUpdateWithResponse("rg1", "zone1", "record1",
RecordType.NS,
new RecordSetInner().withMetadata(mapOf("key1", "fakeTokenPlaceholder")).withTtl(3600L)
.withNsRecords(Arrays.asList(new NsRecord().withNsdname("ns1.contoso.com"))),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
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 create_or_update_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.create_or_update(
resource_group_name="rg1",
zone_name="zone1",
relative_record_set_name="record1",
record_type="NS",
parameters={
"properties": {"NSRecords": [{"nsdname": "ns1.contoso.com"}], "TTL": 3600, "metadata": {"key1": "value1"}}
},
)
print(response)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateNSRecordset.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/azcore/to"
"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/CreateOrUpdateNSRecordset.json
func ExampleRecordSetsClient_CreateOrUpdate_createNsRecordset() {
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)
}
res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "rg1", "zone1", "record1", armdns.RecordTypeNS, armdns.RecordSet{
Properties: &armdns.RecordSetProperties{
NsRecords: []*armdns.NsRecord{
{
Nsdname: to.Ptr("ns1.contoso.com"),
}},
TTL: to.Ptr[int64](3600),
Metadata: map[string]*string{
"key1": to.Ptr("value1"),
},
},
}, &armdns.RecordSetsClientCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.RecordSet = 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 Creates or updates a record set within a DNS zone.
*
* @summary Creates or updates a record set within a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateNSRecordset.json
*/
async function createNsRecordset() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const relativeRecordSetName = "record1";
const recordType = "NS";
const parameters = {
nsRecords: [{ nsdname: "ns1.contoso.com" }],
ttl: 3600,
metadata: { key1: "value1" },
};
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const result = await client.recordSets.createOrUpdate(
resourceGroupName,
zoneName,
relativeRecordSetName,
recordType,
parameters
);
console.log(result);
}
createNsRecordset().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
Exemple de réponse
{
"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"
}
]
}
}
{
"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"
}
]
}
}
Create PTR recordset
Exemple de requête
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/0.0.127.in-addr.arpa/PTR/1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"PTRRecords": [
{
"ptrdname": "localhost"
}
]
}
}
import com.azure.resourcemanager.dns.fluent.models.RecordSetInner;
import com.azure.resourcemanager.dns.models.PtrRecord;
import com.azure.resourcemanager.dns.models.RecordType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for RecordSets CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdatePTRRecordset.json
*/
/**
* Sample code: Create PTR recordset.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createPTRRecordset(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().createOrUpdateWithResponse("rg1",
"0.0.127.in-addr.arpa", "1", RecordType.PTR,
new RecordSetInner().withMetadata(mapOf("key1", "fakeTokenPlaceholder")).withTtl(3600L)
.withPtrRecords(Arrays.asList(new PtrRecord().withPtrdname("localhost"))),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
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 create_or_update_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.create_or_update(
resource_group_name="rg1",
zone_name="0.0.127.in-addr.arpa",
relative_record_set_name="1",
record_type="PTR",
parameters={
"properties": {"PTRRecords": [{"ptrdname": "localhost"}], "TTL": 3600, "metadata": {"key1": "value1"}}
},
)
print(response)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdatePTRRecordset.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/azcore/to"
"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/CreateOrUpdatePTRRecordset.json
func ExampleRecordSetsClient_CreateOrUpdate_createPtrRecordset() {
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)
}
res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "rg1", "0.0.127.in-addr.arpa", "1", armdns.RecordTypePTR, armdns.RecordSet{
Properties: &armdns.RecordSetProperties{
PtrRecords: []*armdns.PtrRecord{
{
Ptrdname: to.Ptr("localhost"),
}},
TTL: to.Ptr[int64](3600),
Metadata: map[string]*string{
"key1": to.Ptr("value1"),
},
},
}, &armdns.RecordSetsClientCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.RecordSet = 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 Creates or updates a record set within a DNS zone.
*
* @summary Creates or updates a record set within a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdatePTRRecordset.json
*/
async function createPtrRecordset() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "0.0.127.in-addr.arpa";
const relativeRecordSetName = "1";
const recordType = "PTR";
const parameters = {
ptrRecords: [{ ptrdname: "localhost" }],
ttl: 3600,
metadata: { key1: "value1" },
};
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const result = await client.recordSets.createOrUpdate(
resourceGroupName,
zoneName,
relativeRecordSetName,
recordType,
parameters
);
console.log(result);
}
createPtrRecordset().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
Exemple de réponse
{
"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"
}
]
}
}
{
"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"
}
]
}
}
Create SOA recordset
Exemple de requête
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SOA/@?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"SOARecord": {
"host": "ns1.contoso.com",
"email": "hostmaster.contoso.com",
"serialNumber": 1,
"refreshTime": 3600,
"retryTime": 300,
"expireTime": 2419200,
"minimumTTL": 300
}
}
}
import com.azure.resourcemanager.dns.fluent.models.RecordSetInner;
import com.azure.resourcemanager.dns.models.RecordType;
import com.azure.resourcemanager.dns.models.SoaRecord;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for RecordSets CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateSOARecordset.json
*/
/**
* Sample code: Create SOA recordset.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createSOARecordset(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets()
.createOrUpdateWithResponse("rg1", "zone1", "@", RecordType.SOA,
new RecordSetInner().withMetadata(mapOf("key1", "fakeTokenPlaceholder")).withTtl(3600L)
.withSoaRecord(new SoaRecord().withHost("ns1.contoso.com").withEmail("hostmaster.contoso.com")
.withSerialNumber(1L).withRefreshTime(3600L).withRetryTime(300L).withExpireTime(2419200L)
.withMinimumTtl(300L)),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
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 create_or_update_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.create_or_update(
resource_group_name="rg1",
zone_name="zone1",
relative_record_set_name="@",
record_type="SOA",
parameters={
"properties": {
"SOARecord": {
"email": "hostmaster.contoso.com",
"expireTime": 2419200,
"host": "ns1.contoso.com",
"minimumTTL": 300,
"refreshTime": 3600,
"retryTime": 300,
"serialNumber": 1,
},
"TTL": 3600,
"metadata": {"key1": "value1"},
}
},
)
print(response)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateSOARecordset.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/azcore/to"
"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/CreateOrUpdateSOARecordset.json
func ExampleRecordSetsClient_CreateOrUpdate_createSoaRecordset() {
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)
}
res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "rg1", "zone1", "@", armdns.RecordTypeSOA, armdns.RecordSet{
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),
Metadata: map[string]*string{
"key1": to.Ptr("value1"),
},
},
}, &armdns.RecordSetsClientCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.RecordSet = 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 Creates or updates a record set within a DNS zone.
*
* @summary Creates or updates a record set within a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateSOARecordset.json
*/
async function createSoaRecordset() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const relativeRecordSetName = "@";
const recordType = "SOA";
const parameters = {
soaRecord: {
email: "hostmaster.contoso.com",
expireTime: 2419200,
host: "ns1.contoso.com",
minimumTtl: 300,
refreshTime: 3600,
retryTime: 300,
serialNumber: 1,
},
ttl: 3600,
metadata: { key1: "value1" },
};
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const result = await client.recordSets.createOrUpdate(
resourceGroupName,
zoneName,
relativeRecordSetName,
recordType,
parameters
);
console.log(result);
}
createSoaRecordset().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
Exemple de réponse
{
"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
}
}
}
{
"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
}
}
}
Create SRV recordset
Exemple de requête
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SRV/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"SRVRecords": [
{
"priority": 0,
"weight": 10,
"port": 80,
"target": "contoso.com"
}
]
}
}
import com.azure.resourcemanager.dns.fluent.models.RecordSetInner;
import com.azure.resourcemanager.dns.models.RecordType;
import com.azure.resourcemanager.dns.models.SrvRecord;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for RecordSets CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateSRVRecordset.json
*/
/**
* Sample code: Create SRV recordset.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createSRVRecordset(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().createOrUpdateWithResponse("rg1", "zone1", "record1",
RecordType.SRV,
new RecordSetInner().withMetadata(mapOf("key1", "fakeTokenPlaceholder")).withTtl(3600L).withSrvRecords(
Arrays.asList(new SrvRecord().withPriority(0).withWeight(10).withPort(80).withTarget("contoso.com"))),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
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 create_or_update_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.create_or_update(
resource_group_name="rg1",
zone_name="zone1",
relative_record_set_name="record1",
record_type="SRV",
parameters={
"properties": {
"SRVRecords": [{"port": 80, "priority": 0, "target": "contoso.com", "weight": 10}],
"TTL": 3600,
"metadata": {"key1": "value1"},
}
},
)
print(response)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateSRVRecordset.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/azcore/to"
"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/CreateOrUpdateSRVRecordset.json
func ExampleRecordSetsClient_CreateOrUpdate_createSrvRecordset() {
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)
}
res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "rg1", "zone1", "record1", armdns.RecordTypeSRV, armdns.RecordSet{
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),
Metadata: map[string]*string{
"key1": to.Ptr("value1"),
},
},
}, &armdns.RecordSetsClientCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.RecordSet = 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 Creates or updates a record set within a DNS zone.
*
* @summary Creates or updates a record set within a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateSRVRecordset.json
*/
async function createSrvRecordset() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const relativeRecordSetName = "record1";
const recordType = "SRV";
const parameters = {
srvRecords: [{ port: 80, priority: 0, target: "contoso.com", weight: 10 }],
ttl: 3600,
metadata: { key1: "value1" },
};
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const result = await client.recordSets.createOrUpdate(
resourceGroupName,
zoneName,
relativeRecordSetName,
recordType,
parameters
);
console.log(result);
}
createSrvRecordset().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
Exemple de réponse
{
"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"
}
]
}
}
{
"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"
}
]
}
}
Create TXT recordset
Exemple de requête
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TXT/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"TXTRecords": [
{
"value": [
"string1",
"string2"
]
}
]
}
}
import com.azure.resourcemanager.dns.fluent.models.RecordSetInner;
import com.azure.resourcemanager.dns.models.RecordType;
import com.azure.resourcemanager.dns.models.TxtRecord;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for RecordSets CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateTXTRecordset.json
*/
/**
* Sample code: Create TXT recordset.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createTXTRecordset(com.azure.resourcemanager.AzureResourceManager azure) {
azure.dnsZones().manager().serviceClient().getRecordSets().createOrUpdateWithResponse("rg1", "zone1", "record1",
RecordType.TXT,
new RecordSetInner().withMetadata(mapOf("key1", "fakeTokenPlaceholder")).withTtl(3600L)
.withTxtRecords(Arrays.asList(new TxtRecord().withValue(Arrays.asList("string1", "string2")))),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
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 create_or_update_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.create_or_update(
resource_group_name="rg1",
zone_name="zone1",
relative_record_set_name="record1",
record_type="TXT",
parameters={
"properties": {
"TTL": 3600,
"TXTRecords": [{"value": ["string1", "string2"]}],
"metadata": {"key1": "value1"},
}
},
)
print(response)
# x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateTXTRecordset.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/azcore/to"
"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/CreateOrUpdateTXTRecordset.json
func ExampleRecordSetsClient_CreateOrUpdate_createTxtRecordset() {
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)
}
res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "rg1", "zone1", "record1", armdns.RecordTypeTXT, armdns.RecordSet{
Properties: &armdns.RecordSetProperties{
TTL: to.Ptr[int64](3600),
TxtRecords: []*armdns.TxtRecord{
{
Value: []*string{
to.Ptr("string1"),
to.Ptr("string2")},
}},
Metadata: map[string]*string{
"key1": to.Ptr("value1"),
},
},
}, &armdns.RecordSetsClientCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.RecordSet = 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 Creates or updates a record set within a DNS zone.
*
* @summary Creates or updates a record set within a DNS zone.
* x-ms-original-file: specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateTXTRecordset.json
*/
async function createTxtRecordset() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const zoneName = "zone1";
const relativeRecordSetName = "record1";
const recordType = "TXT";
const parameters = {
ttl: 3600,
txtRecords: [{ value: ["string1", "string2"] }],
metadata: { key1: "value1" },
};
const credential = new DefaultAzureCredential();
const client = new DnsManagementClient(credential, subscriptionId);
const result = await client.recordSets.createOrUpdate(
resourceGroupName,
zoneName,
relativeRecordSetName,
recordType,
parameters
);
console.log(result);
}
createTxtRecordset().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
Exemple de réponse
{
"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"
]
}
]
}
}
{
"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"
]
}
]
}
}
Définitions
Nom |
Description |
AaaaRecord
|
Enregistrement AAAA.
|
ARecord
|
Enregistrement A.
|
CaaRecord
|
Enregistrement CAA.
|
CloudError
|
Réponse d’erreur du service.
|
CloudErrorBody
|
Réponse d’erreur du service.
|
CnameRecord
|
Enregistrement CNAME.
|
MxRecord
|
Enregistrement MX.
|
NsRecord
|
Enregistrement NS.
|
PtrRecord
|
Enregistrement PTR.
|
RecordSet
|
Décrit un jeu d’enregistrements DNS (collection d’enregistrements DNS portant le même nom et le même type).
|
RecordType
|
Type d’enregistrement DNS dans ce jeu d’enregistrements. Les jeux d’enregistrements de type SOA peuvent être mis à jour, mais pas créés (ils sont créés lors de la création de la zone DNS).
|
SoaRecord
|
Enregistrement SOA.
|
SrvRecord
|
Enregistrement SRV.
|
SubResource
|
Référence à une autre ressource
|
TxtRecord
|
Enregistrement TXT.
|
AaaaRecord
Enregistrement AAAA.
Nom |
Type |
Description |
ipv6Address
|
string
|
Adresse IPv6 de cet enregistrement AAAA.
|
ARecord
Enregistrement A.
Nom |
Type |
Description |
ipv4Address
|
string
|
Adresse IPv4 de cet enregistrement A.
|
CaaRecord
Enregistrement CAA.
Nom |
Type |
Description |
flags
|
integer
|
Indicateurs de cet enregistrement CAA sous la forme d’un entier compris entre 0 et 255.
|
tag
|
string
|
Balise de cet enregistrement CAA.
|
value
|
string
|
Valeur de cet enregistrement CAA.
|
CloudError
Réponse d’erreur du service.
CloudErrorBody
Réponse d’erreur du service.
Nom |
Type |
Description |
code
|
string
|
Identificateur de l'erreur. Les codes sont invariants et sont destinés à être consommés par programmation.
|
details
|
CloudErrorBody[]
|
Liste de détails supplémentaires sur l’erreur.
|
message
|
string
|
Message décrivant l’erreur, destiné à être adapté à l’affichage dans une interface utilisateur.
|
target
|
string
|
Cible de l’erreur particulière. Par exemple, le nom de la propriété en erreur.
|
CnameRecord
Enregistrement CNAME.
Nom |
Type |
Description |
cname
|
string
|
Nom canonique de cet enregistrement CNAME.
|
MxRecord
Enregistrement MX.
Nom |
Type |
Description |
exchange
|
string
|
Nom de domaine de l’hôte de messagerie pour cet enregistrement MX.
|
preference
|
integer
|
Valeur de préférence pour cet enregistrement MX.
|
NsRecord
Enregistrement NS.
Nom |
Type |
Description |
nsdname
|
string
|
Nom du serveur de noms pour cet enregistrement NS.
|
PtrRecord
Enregistrement PTR.
Nom |
Type |
Description |
ptrdname
|
string
|
Nom de domaine cible PTR pour cet enregistrement PTR.
|
RecordSet
Décrit un jeu d’enregistrements DNS (collection d’enregistrements DNS portant le même nom et le même type).
Nom |
Type |
Description |
etag
|
string
|
Etag du jeu d’enregistrements.
|
id
|
string
|
ID du jeu d’enregistrements.
|
name
|
string
|
Nom du jeu d’enregistrements.
|
properties.AAAARecords
|
AaaaRecord[]
|
Liste des enregistrements AAAA dans le jeu d’enregistrements.
|
properties.ARecords
|
ARecord[]
|
Liste des enregistrements A dans le jeu d’enregistrements.
|
properties.CNAMERecord
|
CnameRecord
|
Enregistrement CNAME dans le jeu d’enregistrements.
|
properties.MXRecords
|
MxRecord[]
|
Liste des enregistrements MX dans le jeu d’enregistrements.
|
properties.NSRecords
|
NsRecord[]
|
Liste des enregistrements NS dans le jeu d’enregistrements.
|
properties.PTRRecords
|
PtrRecord[]
|
Liste des enregistrements PTR dans le jeu d’enregistrements.
|
properties.SOARecord
|
SoaRecord
|
Enregistrement SOA dans le jeu d’enregistrements.
|
properties.SRVRecords
|
SrvRecord[]
|
Liste des enregistrements SRV dans le jeu d’enregistrements.
|
properties.TTL
|
integer
|
Durée de vie (durée de vie) des enregistrements dans le jeu d’enregistrements.
|
properties.TXTRecords
|
TxtRecord[]
|
Liste des enregistrements TXT dans le jeu d’enregistrements.
|
properties.caaRecords
|
CaaRecord[]
|
Liste des enregistrements CAA dans le jeu d’enregistrements.
|
properties.fqdn
|
string
|
Nom de domaine complet du jeu d’enregistrements.
|
properties.metadata
|
object
|
Métadonnées attachées au jeu d’enregistrements.
|
properties.provisioningState
|
string
|
État d’approvisionnement du jeu d’enregistrements.
|
properties.targetResource
|
SubResource
|
Référence à une ressource Azure à partir de laquelle la valeur de ressource dns est extraite.
|
type
|
string
|
Type du jeu d’enregistrements.
|
RecordType
Type d’enregistrement DNS dans ce jeu d’enregistrements. Les jeux d’enregistrements de type SOA peuvent être mis à jour, mais pas créés (ils sont créés lors de la création de la zone DNS).
Nom |
Type |
Description |
A
|
string
|
|
AAAA
|
string
|
|
CAA
|
string
|
|
CNAME
|
string
|
|
MX
|
string
|
|
NS
|
string
|
|
PTR
|
string
|
|
SOA
|
string
|
|
SRV
|
string
|
|
TXT
|
string
|
|
SoaRecord
Enregistrement SOA.
Nom |
Type |
Description |
email
|
string
|
Contact d’e-mail pour cet enregistrement SOA.
|
expireTime
|
integer
|
Heure d’expiration de cet enregistrement SOA.
|
host
|
string
|
Nom de domaine du serveur de noms faisant autorité pour cet enregistrement SOA.
|
minimumTTL
|
integer
|
Valeur minimale de cet enregistrement SOA. Par convention, cela est utilisé pour déterminer la durée de mise en cache négative.
|
refreshTime
|
integer
|
Valeur d’actualisation de cet enregistrement SOA.
|
retryTime
|
integer
|
Heure de nouvelle tentative de cet enregistrement SOA.
|
serialNumber
|
integer
|
Numéro de série de cet enregistrement SOA.
|
SrvRecord
Enregistrement SRV.
Nom |
Type |
Description |
port
|
integer
|
Valeur de port de cet enregistrement SRV.
|
priority
|
integer
|
Valeur de priorité de cet enregistrement SRV.
|
target
|
string
|
Nom de domaine cible de cet enregistrement SRV.
|
weight
|
integer
|
Valeur de pondération de cet enregistrement SRV.
|
SubResource
Référence à une autre ressource
Nom |
Type |
Description |
id
|
string
|
ID de ressource.
|
TxtRecord
Enregistrement TXT.
Nom |
Type |
Description |
value
|
string[]
|
Valeur de texte de cet enregistrement TXT.
|