Documentation ¶
Index ¶
- type ARecord
- type AaaaRecord
- type CaaRecord
- type ClientFactory
- type CnameRecord
- type CreatedByType
- type DelegationSignerInfo
- type Digest
- type DnssecConfig
- type DnssecConfigListResult
- type DnssecConfigsClient
- func (client *DnssecConfigsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, ...) (*runtime.Poller[DnssecConfigsClientCreateOrUpdateResponse], error)
- func (client *DnssecConfigsClient) BeginDelete(ctx context.Context, resourceGroupName string, zoneName string, ...) (*runtime.Poller[DnssecConfigsClientDeleteResponse], error)
- func (client *DnssecConfigsClient) Get(ctx context.Context, resourceGroupName string, zoneName string, ...) (DnssecConfigsClientGetResponse, error)
- func (client *DnssecConfigsClient) NewListByDNSZonePager(resourceGroupName string, zoneName string, ...) *runtime.Pager[DnssecConfigsClientListByDNSZoneResponse]
- type DnssecConfigsClientBeginCreateOrUpdateOptions
- type DnssecConfigsClientBeginDeleteOptions
- type DnssecConfigsClientCreateOrUpdateResponse
- type DnssecConfigsClientDeleteResponse
- type DnssecConfigsClientGetOptions
- type DnssecConfigsClientGetResponse
- type DnssecConfigsClientListByDNSZoneOptions
- type DnssecConfigsClientListByDNSZoneResponse
- type DnssecProperties
- type DsRecord
- type MxRecord
- type NaptrRecord
- type NsRecord
- type PtrRecord
- type RecordSet
- type RecordSetListResult
- type RecordSetProperties
- type RecordSetUpdateParameters
- type RecordSetsClient
- func (client *RecordSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, ...) (RecordSetsClientCreateOrUpdateResponse, error)
- func (client *RecordSetsClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, ...) (RecordSetsClientDeleteResponse, error)
- func (client *RecordSetsClient) Get(ctx context.Context, resourceGroupName string, zoneName string, ...) (RecordSetsClientGetResponse, error)
- func (client *RecordSetsClient) NewListAllByDNSZonePager(resourceGroupName string, zoneName string, ...) *runtime.Pager[RecordSetsClientListAllByDNSZoneResponse]
- func (client *RecordSetsClient) NewListByDNSZonePager(resourceGroupName string, zoneName string, ...) *runtime.Pager[RecordSetsClientListByDNSZoneResponse]
- func (client *RecordSetsClient) NewListByTypePager(resourceGroupName string, zoneName string, recordType RecordType, ...) *runtime.Pager[RecordSetsClientListByTypeResponse]
- func (client *RecordSetsClient) Update(ctx context.Context, resourceGroupName string, zoneName string, ...) (RecordSetsClientUpdateResponse, error)
- type RecordSetsClientCreateOrUpdateOptions
- type RecordSetsClientCreateOrUpdateResponse
- type RecordSetsClientDeleteOptions
- type RecordSetsClientDeleteResponse
- type RecordSetsClientGetOptions
- type RecordSetsClientGetResponse
- type RecordSetsClientListAllByDNSZoneOptions
- type RecordSetsClientListAllByDNSZoneResponse
- type RecordSetsClientListByDNSZoneOptions
- type RecordSetsClientListByDNSZoneResponse
- type RecordSetsClientListByTypeOptions
- type RecordSetsClientListByTypeResponse
- type RecordSetsClientUpdateOptions
- type RecordSetsClientUpdateResponse
- type RecordType
- type Resource
- type ResourceReference
- type ResourceReferenceClient
- type ResourceReferenceClientGetByTargetResourcesOptions
- type ResourceReferenceClientGetByTargetResourcesResponse
- type ResourceReferenceRequest
- type ResourceReferenceRequestProperties
- type ResourceReferenceResult
- type ResourceReferenceResultProperties
- type SigningKey
- type SoaRecord
- type SrvRecord
- type SubResource
- type SystemData
- type TlsaRecord
- type TxtRecord
- type Zone
- type ZoneListResult
- type ZoneProperties
- type ZoneType
- type ZoneUpdate
- type ZonesClient
- func (client *ZonesClient) BeginDelete(ctx context.Context, resourceGroupName string, zoneName string, ...) (*runtime.Poller[ZonesClientDeleteResponse], error)
- func (client *ZonesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, ...) (ZonesClientCreateOrUpdateResponse, error)
- func (client *ZonesClient) Get(ctx context.Context, resourceGroupName string, zoneName string, ...) (ZonesClientGetResponse, error)
- func (client *ZonesClient) NewListByResourceGroupPager(resourceGroupName string, options *ZonesClientListByResourceGroupOptions) *runtime.Pager[ZonesClientListByResourceGroupResponse]
- func (client *ZonesClient) NewListPager(options *ZonesClientListOptions) *runtime.Pager[ZonesClientListResponse]
- func (client *ZonesClient) Update(ctx context.Context, resourceGroupName string, zoneName string, ...) (ZonesClientUpdateResponse, error)
- type ZonesClientBeginDeleteOptions
- type ZonesClientCreateOrUpdateOptions
- type ZonesClientCreateOrUpdateResponse
- type ZonesClientDeleteResponse
- type ZonesClientGetOptions
- type ZonesClientGetResponse
- type ZonesClientListByResourceGroupOptions
- type ZonesClientListByResourceGroupResponse
- type ZonesClientListOptions
- type ZonesClientListResponse
- type ZonesClientUpdateOptions
- type ZonesClientUpdateResponse
Examples ¶
- DnssecConfigsClient.BeginCreateOrUpdate
- DnssecConfigsClient.BeginDelete
- DnssecConfigsClient.Get
- DnssecConfigsClient.NewListByDNSZonePager
- RecordSetsClient.CreateOrUpdate (CreateARecordset)
- RecordSetsClient.CreateOrUpdate (CreateARecordsetWithAliasTargetResource)
- RecordSetsClient.CreateOrUpdate (CreateARecordsetWithTrafficManagementProfile)
- RecordSetsClient.CreateOrUpdate (CreateAaaaRecordset)
- RecordSetsClient.CreateOrUpdate (CreateCaaRecordset)
- RecordSetsClient.CreateOrUpdate (CreateCnameRecordset)
- RecordSetsClient.CreateOrUpdate (CreateDsRecordset)
- RecordSetsClient.CreateOrUpdate (CreateMxRecordset)
- RecordSetsClient.CreateOrUpdate (CreateNaptrRecordset)
- RecordSetsClient.CreateOrUpdate (CreateNsRecordset)
- RecordSetsClient.CreateOrUpdate (CreatePtrRecordset)
- RecordSetsClient.CreateOrUpdate (CreateSoaRecordset)
- RecordSetsClient.CreateOrUpdate (CreateSrvRecordset)
- RecordSetsClient.CreateOrUpdate (CreateTlsaRecordset)
- RecordSetsClient.CreateOrUpdate (CreateTxtRecordset)
- RecordSetsClient.Delete (DeleteARecordset)
- RecordSetsClient.Delete (DeleteAaaaRecordset)
- RecordSetsClient.Delete (DeleteCaaRecordset)
- RecordSetsClient.Delete (DeleteCnameRecordset)
- RecordSetsClient.Delete (DeleteDsRecordset)
- RecordSetsClient.Delete (DeleteMxRecordset)
- RecordSetsClient.Delete (DeleteNaptrRecordset)
- RecordSetsClient.Delete (DeleteNsRecordset)
- RecordSetsClient.Delete (DeletePtrRecordset)
- RecordSetsClient.Delete (DeleteSrvRecordset)
- RecordSetsClient.Delete (DeleteTlsaRecordset)
- RecordSetsClient.Delete (DeleteTxtRecordset)
- RecordSetsClient.Get (GetARecordset)
- RecordSetsClient.Get (GetAaaaRecordset)
- RecordSetsClient.Get (GetCaaRecordset)
- RecordSetsClient.Get (GetCnameRecordset)
- RecordSetsClient.Get (GetDsRecordset)
- RecordSetsClient.Get (GetMxRecordset)
- RecordSetsClient.Get (GetNaptrRecordset)
- RecordSetsClient.Get (GetNsRecordset)
- RecordSetsClient.Get (GetPtrRecordset)
- RecordSetsClient.Get (GetSoaRecordset)
- RecordSetsClient.Get (GetSrvRecordset)
- RecordSetsClient.Get (GetTlsaRecordset)
- RecordSetsClient.Get (GetTxtRecordset)
- RecordSetsClient.NewListByDNSZonePager
- RecordSetsClient.NewListByTypePager (ListARecordsets)
- RecordSetsClient.NewListByTypePager (ListAaaaRecordsets)
- RecordSetsClient.NewListByTypePager (ListCaaRecordsets)
- RecordSetsClient.NewListByTypePager (ListCnameRecordsets)
- RecordSetsClient.NewListByTypePager (ListDsRecordsets)
- RecordSetsClient.NewListByTypePager (ListMxRecordsets)
- RecordSetsClient.NewListByTypePager (ListNaptrRecordsets)
- RecordSetsClient.NewListByTypePager (ListNsRecordsets)
- RecordSetsClient.NewListByTypePager (ListPtrRecordsets)
- RecordSetsClient.NewListByTypePager (ListSoaRecordsets)
- RecordSetsClient.NewListByTypePager (ListSrvRecordsets)
- RecordSetsClient.NewListByTypePager (ListTlsaRecordsets)
- RecordSetsClient.NewListByTypePager (ListTxtRecordsets)
- RecordSetsClient.Update (PatchARecordset)
- RecordSetsClient.Update (PatchAaaaRecordset)
- RecordSetsClient.Update (PatchCaaRecordset)
- RecordSetsClient.Update (PatchCnameRecordset)
- RecordSetsClient.Update (PatchDsRecordset)
- RecordSetsClient.Update (PatchMxRecordset)
- RecordSetsClient.Update (PatchNaptrRecordset)
- RecordSetsClient.Update (PatchNsRecordset)
- RecordSetsClient.Update (PatchPtrRecordset)
- RecordSetsClient.Update (PatchSoaRecordset)
- RecordSetsClient.Update (PatchSrvRecordset)
- RecordSetsClient.Update (PatchTlsaRecordset)
- RecordSetsClient.Update (PatchTxtRecordset)
- ResourceReferenceClient.GetByTargetResources
- ZonesClient.BeginDelete
- ZonesClient.CreateOrUpdate
- ZonesClient.Get
- ZonesClient.NewListByResourceGroupPager
- ZonesClient.NewListPager
- ZonesClient.Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ARecord ¶
type ARecord struct { // The IPv4 address of this A record. IPv4Address *string }
ARecord - An A record.
func (ARecord) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type ARecord.
func (*ARecord) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type ARecord.
type AaaaRecord ¶
type AaaaRecord struct { // The IPv6 address of this AAAA record. IPv6Address *string }
AaaaRecord - An AAAA record.
func (AaaaRecord) MarshalJSON ¶
func (a AaaaRecord) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AaaaRecord.
func (*AaaaRecord) UnmarshalJSON ¶
func (a *AaaaRecord) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AaaaRecord.
type CaaRecord ¶
type CaaRecord struct { // The flags for this CAA record as an integer between 0 and 255. Flags *int32 // The tag for this CAA record. Tag *string // The value for this CAA record. Value *string }
CaaRecord - A CAA record.
func (CaaRecord) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type CaaRecord.
func (*CaaRecord) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type CaaRecord.
type ClientFactory ¶
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.
func NewClientFactory ¶
func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)
NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewDnssecConfigsClient ¶
func (c *ClientFactory) NewDnssecConfigsClient() *DnssecConfigsClient
NewDnssecConfigsClient creates a new instance of DnssecConfigsClient.
func (*ClientFactory) NewRecordSetsClient ¶
func (c *ClientFactory) NewRecordSetsClient() *RecordSetsClient
NewRecordSetsClient creates a new instance of RecordSetsClient.
func (*ClientFactory) NewResourceReferenceClient ¶
func (c *ClientFactory) NewResourceReferenceClient() *ResourceReferenceClient
NewResourceReferenceClient creates a new instance of ResourceReferenceClient.
func (*ClientFactory) NewZonesClient ¶
func (c *ClientFactory) NewZonesClient() *ZonesClient
NewZonesClient creates a new instance of ZonesClient.
type CnameRecord ¶
type CnameRecord struct { // The canonical name for this CNAME record. Cname *string }
CnameRecord - A CNAME record.
func (CnameRecord) MarshalJSON ¶
func (c CnameRecord) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CnameRecord.
func (*CnameRecord) UnmarshalJSON ¶
func (c *CnameRecord) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CnameRecord.
type CreatedByType ¶
type CreatedByType string
CreatedByType - The type of identity that created the resource.
const ( CreatedByTypeApplication CreatedByType = "Application" CreatedByTypeKey CreatedByType = "Key" CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" CreatedByTypeUser CreatedByType = "User" )
func PossibleCreatedByTypeValues ¶
func PossibleCreatedByTypeValues() []CreatedByType
PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.
type DelegationSignerInfo ¶
type DelegationSignerInfo struct { // READ-ONLY; The digest algorithm type represents the standard digest algorithm number used to construct the digest. See: // https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml DigestAlgorithmType *int32 // READ-ONLY; The digest value is a cryptographic hash value of the referenced DNSKEY Resource Record. DigestValue *string // READ-ONLY; The record represents a delegation signer (DS) record. Record *string }
DelegationSignerInfo - The delegation signer information.
func (DelegationSignerInfo) MarshalJSON ¶
func (d DelegationSignerInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DelegationSignerInfo.
func (*DelegationSignerInfo) UnmarshalJSON ¶
func (d *DelegationSignerInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DelegationSignerInfo.
type Digest ¶
type Digest struct { // The digest algorithm type represents the standard digest algorithm number used to construct the digest. See: https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml AlgorithmType *int32 // The digest value is a cryptographic hash value of the referenced DNSKEY Resource Record. Value *string }
Digest - A digest.
func (Digest) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Digest.
func (*Digest) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Digest.
type DnssecConfig ¶
type DnssecConfig struct { // The etag of the DNSSEC configuration. Etag *string // READ-ONLY; The ID of the DNSSEC configuration. ID *string // READ-ONLY; The name of the DNSSEC configuration. Name *string // READ-ONLY; The DNSSEC properties. Properties *DnssecProperties // READ-ONLY; Metadata pertaining to creation and last modification of the resource. SystemData *SystemData // READ-ONLY; The type of the DNSSEC configuration. Type *string }
DnssecConfig - Represents the DNSSEC configuration.
func (DnssecConfig) MarshalJSON ¶
func (d DnssecConfig) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DnssecConfig.
func (*DnssecConfig) UnmarshalJSON ¶
func (d *DnssecConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DnssecConfig.
type DnssecConfigListResult ¶
type DnssecConfigListResult struct { // Information about the DNSSEC configurations in the response. Value []*DnssecConfig // READ-ONLY; The continuation token for the next page of results. NextLink *string }
DnssecConfigListResult - The response to a List DNSSEC configurations operation.
func (DnssecConfigListResult) MarshalJSON ¶
func (d DnssecConfigListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DnssecConfigListResult.
func (*DnssecConfigListResult) UnmarshalJSON ¶
func (d *DnssecConfigListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DnssecConfigListResult.
type DnssecConfigsClient ¶
type DnssecConfigsClient struct {
// contains filtered or unexported fields
}
DnssecConfigsClient contains the methods for the DnssecConfigs group. Don't use this type directly, use NewDnssecConfigsClient() instead.
func NewDnssecConfigsClient ¶
func NewDnssecConfigsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DnssecConfigsClient, error)
NewDnssecConfigsClient creates a new instance of DnssecConfigsClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*DnssecConfigsClient) BeginCreateOrUpdate ¶
func (client *DnssecConfigsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, options *DnssecConfigsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DnssecConfigsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Creates or updates the DNSSEC configuration on a DNS zone. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- zoneName - The name of the DNS zone (without a terminating dot).
- options - DnssecConfigsClientBeginCreateOrUpdateOptions contains the optional parameters for the DnssecConfigsClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDnssecConfig.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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) } poller, err := clientFactory.NewDnssecConfigsClient().BeginCreateOrUpdate(ctx, "rg1", "zone1", &armdns.DnssecConfigsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %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.DnssecConfig = armdns.DnssecConfig{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Network/dnszones/dnssecConfigs"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnszones/zone1/dnssecConfigs/default"), // Properties: &armdns.DnssecProperties{ // ProvisioningState: to.Ptr("Succeeded"), // SigningKeys: []*armdns.SigningKey{ // }, // }, // } }
Output:
func (*DnssecConfigsClient) BeginDelete ¶
func (client *DnssecConfigsClient) BeginDelete(ctx context.Context, resourceGroupName string, zoneName string, options *DnssecConfigsClientBeginDeleteOptions) (*runtime.Poller[DnssecConfigsClientDeleteResponse], error)
BeginDelete - Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- zoneName - The name of the DNS zone (without a terminating dot).
- options - DnssecConfigsClientBeginDeleteOptions contains the optional parameters for the DnssecConfigsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDnssecConfig.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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) } poller, err := clientFactory.NewDnssecConfigsClient().BeginDelete(ctx, "rg1", "zone1", &armdns.DnssecConfigsClientBeginDeleteOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } }
Output:
func (*DnssecConfigsClient) Get ¶
func (client *DnssecConfigsClient) Get(ctx context.Context, resourceGroupName string, zoneName string, options *DnssecConfigsClientGetOptions) (DnssecConfigsClientGetResponse, error)
Get - Gets the DNSSEC configuration. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- zoneName - The name of the DNS zone (without a terminating dot).
- options - DnssecConfigsClientGetOptions contains the optional parameters for the DnssecConfigsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnssecConfig.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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.NewDnssecConfigsClient().Get(ctx, "rg1", "zone1", 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.DnssecConfig = armdns.DnssecConfig{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Network/dnszones/dnssecConfigs"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnszones/zone1/dnssecConfigs/default"), // Properties: &armdns.DnssecProperties{ // ProvisioningState: to.Ptr("Succeeded"), // SigningKeys: []*armdns.SigningKey{ // { // DelegationSignerInfo: []*armdns.DelegationSignerInfo{ // }, // Flags: to.Ptr[int32](256), // KeyTag: to.Ptr[int32](37721), // PublicKey: to.Ptr("publicKey1"), // SecurityAlgorithmType: to.Ptr[int32](13), // Protocol: to.Ptr[int32](3), // }, // { // DelegationSignerInfo: []*armdns.DelegationSignerInfo{ // { // DigestAlgorithmType: to.Ptr[int32](2), // DigestValue: to.Ptr("digestValue1"), // Record: to.Ptr("11920 13 2 digestValue1"), // }}, // Flags: to.Ptr[int32](257), // KeyTag: to.Ptr[int32](11920), // PublicKey: to.Ptr("publicKey2"), // SecurityAlgorithmType: to.Ptr[int32](13), // Protocol: to.Ptr[int32](3), // }}, // }, // } }
Output:
func (*DnssecConfigsClient) NewListByDNSZonePager ¶
func (client *DnssecConfigsClient) NewListByDNSZonePager(resourceGroupName string, zoneName string, options *DnssecConfigsClientListByDNSZoneOptions) *runtime.Pager[DnssecConfigsClientListByDNSZoneResponse]
NewListByDNSZonePager - Lists the DNSSEC configurations in a DNS zone.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- zoneName - The name of the DNS zone (without a terminating dot).
- options - DnssecConfigsClientListByDNSZoneOptions contains the optional parameters for the DnssecConfigsClient.NewListByDNSZonePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDnssecConfigsByZone.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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.NewDnssecConfigsClient().NewListByDNSZonePager("rg1", "zone1", 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.DnssecConfigListResult = armdns.DnssecConfigListResult{ // Value: []*armdns.DnssecConfig{ // { // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Network/dnszones/dnssecConfigs"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnszones/zone1/dnssecConfigs/default"), // Properties: &armdns.DnssecProperties{ // ProvisioningState: to.Ptr("Succeeded"), // SigningKeys: []*armdns.SigningKey{ // { // DelegationSignerInfo: []*armdns.DelegationSignerInfo{ // }, // Flags: to.Ptr[int32](256), // KeyTag: to.Ptr[int32](37721), // PublicKey: to.Ptr("publicKey1"), // SecurityAlgorithmType: to.Ptr[int32](13), // Protocol: to.Ptr[int32](3), // }, // { // DelegationSignerInfo: []*armdns.DelegationSignerInfo{ // { // DigestAlgorithmType: to.Ptr[int32](2), // DigestValue: to.Ptr("digestValue1"), // Record: to.Ptr("11920 13 2 digestValue1"), // }}, // Flags: to.Ptr[int32](257), // KeyTag: to.Ptr[int32](11920), // PublicKey: to.Ptr("publicKey2"), // SecurityAlgorithmType: to.Ptr[int32](13), // Protocol: to.Ptr[int32](3), // }}, // }, // }}, // } } }
Output:
type DnssecConfigsClientBeginCreateOrUpdateOptions ¶
type DnssecConfigsClientBeginCreateOrUpdateOptions struct { // The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC configuration. Specify the last-seen // etag value to prevent accidentally overwriting any concurrent changes. IfMatch *string // Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing DNSSEC configuration. Other // values will be ignored. IfNoneMatch *string // Resumes the LRO from the provided token. ResumeToken string }
DnssecConfigsClientBeginCreateOrUpdateOptions contains the optional parameters for the DnssecConfigsClient.BeginCreateOrUpdate method.
type DnssecConfigsClientBeginDeleteOptions ¶
type DnssecConfigsClientBeginDeleteOptions struct { // The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. Specify the last-seen // etag value to prevent accidentally deleting any concurrent changes. IfMatch *string // Resumes the LRO from the provided token. ResumeToken string }
DnssecConfigsClientBeginDeleteOptions contains the optional parameters for the DnssecConfigsClient.BeginDelete method.
type DnssecConfigsClientCreateOrUpdateResponse ¶
type DnssecConfigsClientCreateOrUpdateResponse struct { // Represents the DNSSEC configuration. DnssecConfig }
DnssecConfigsClientCreateOrUpdateResponse contains the response from method DnssecConfigsClient.BeginCreateOrUpdate.
type DnssecConfigsClientDeleteResponse ¶
type DnssecConfigsClientDeleteResponse struct { }
DnssecConfigsClientDeleteResponse contains the response from method DnssecConfigsClient.BeginDelete.
type DnssecConfigsClientGetOptions ¶
type DnssecConfigsClientGetOptions struct { }
DnssecConfigsClientGetOptions contains the optional parameters for the DnssecConfigsClient.Get method.
type DnssecConfigsClientGetResponse ¶
type DnssecConfigsClientGetResponse struct { // Represents the DNSSEC configuration. DnssecConfig }
DnssecConfigsClientGetResponse contains the response from method DnssecConfigsClient.Get.
type DnssecConfigsClientListByDNSZoneOptions ¶
type DnssecConfigsClientListByDNSZoneOptions struct { }
DnssecConfigsClientListByDNSZoneOptions contains the optional parameters for the DnssecConfigsClient.NewListByDNSZonePager method.
type DnssecConfigsClientListByDNSZoneResponse ¶
type DnssecConfigsClientListByDNSZoneResponse struct { // The response to a List DNSSEC configurations operation. DnssecConfigListResult }
DnssecConfigsClientListByDNSZoneResponse contains the response from method DnssecConfigsClient.NewListByDNSZonePager.
type DnssecProperties ¶
type DnssecProperties struct { // READ-ONLY; Provisioning State of the DNSSEC configuration. ProvisioningState *string // READ-ONLY; The list of signing keys. SigningKeys []*SigningKey }
DnssecProperties - Represents the DNSSEC properties.
func (DnssecProperties) MarshalJSON ¶
func (d DnssecProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DnssecProperties.
func (*DnssecProperties) UnmarshalJSON ¶
func (d *DnssecProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DnssecProperties.
type DsRecord ¶
type DsRecord struct { // The security algorithm type represents the standard security algorithm number of the DNSKEY Resource Record. See: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml Algorithm *int32 // The digest entity. Digest *Digest // The key tag value is used to determine which DNSKEY Resource Record is used for signature verification. KeyTag *int32 }
DsRecord - A DS record. For more information about the DS record format, see RFC 4034: https://www.rfc-editor.org/rfc/rfc4034
func (DsRecord) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type DsRecord.
func (*DsRecord) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type DsRecord.
type MxRecord ¶
type MxRecord struct { // The domain name of the mail host for this MX record. Exchange *string // The preference value for this MX record. Preference *int32 }
MxRecord - An MX record.
func (MxRecord) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type MxRecord.
func (*MxRecord) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type MxRecord.
type NaptrRecord ¶
type NaptrRecord struct { // The flags specific to DDDS applications. Values currently defined in RFC 3404 are uppercase and lowercase letters "A", // "P", "S", and "U", and the empty string, "". Enclose Flags in quotation marks. Flags *string // The order in which the NAPTR records MUST be processed in order to accurately represent the ordered list of rules. The // ordering is from lowest to highest. Valid values: 0-65535. Order *int32 // The preference specifies the order in which NAPTR records with equal 'order' values should be processed, low numbers being // processed before high numbers. Valid values: 0-65535. Preference *int32 // The regular expression that the DDDS application uses to convert an input value into an output value. For example: an IP // phone system might use a regular expression to convert a phone number that is // entered by a user into a SIP URI. Enclose the regular expression in quotation marks. Specify either a value for 'regexp' // or a value for 'replacement'. Regexp *string // The replacement is a fully qualified domain name (FQDN) of the next domain name that you want the DDDS application to submit // a DNS query for. The DDDS application replaces the input value with the // value specified for replacement. Specify either a value for 'regexp' or a value for 'replacement'. If you specify a value // for 'regexp', specify a dot (.) for 'replacement'. Replacement *string // The services specific to DDDS applications. Enclose Services in quotation marks. Services *string }
NaptrRecord - A NAPTR record. For more information about the NAPTR record format, see RFC 3403: https://www.rfc-editor.org/rfc/rfc3403
func (NaptrRecord) MarshalJSON ¶
func (n NaptrRecord) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NaptrRecord.
func (*NaptrRecord) UnmarshalJSON ¶
func (n *NaptrRecord) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NaptrRecord.
type NsRecord ¶
type NsRecord struct { // The name server name for this NS record. Nsdname *string }
NsRecord - An NS record.
func (NsRecord) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type NsRecord.
func (*NsRecord) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type NsRecord.
type PtrRecord ¶
type PtrRecord struct { // The PTR target domain name for this PTR record. Ptrdname *string }
PtrRecord - A PTR record.
func (PtrRecord) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type PtrRecord.
func (*PtrRecord) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type PtrRecord.
type RecordSet ¶
type RecordSet struct { // The etag of the record set. Etag *string // The properties of the record set. Properties *RecordSetProperties // READ-ONLY; The ID of the record set. ID *string // READ-ONLY; The name of the record set. Name *string // READ-ONLY; The type of the record set. Type *string }
RecordSet - Describes a DNS record set (a collection of DNS records with the same name and type).
func (RecordSet) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type RecordSet.
func (*RecordSet) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type RecordSet.
type RecordSetListResult ¶
type RecordSetListResult struct { // Information about the record sets in the response. Value []*RecordSet // READ-ONLY; The continuation token for the next page of results. NextLink *string }
RecordSetListResult - The response to a record set List operation.
func (RecordSetListResult) MarshalJSON ¶
func (r RecordSetListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RecordSetListResult.
func (*RecordSetListResult) UnmarshalJSON ¶
func (r *RecordSetListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RecordSetListResult.
type RecordSetProperties ¶
type RecordSetProperties struct { // The list of A records in the record set. ARecords []*ARecord // The list of AAAA records in the record set. AaaaRecords []*AaaaRecord // The list of CAA records in the record set. CaaRecords []*CaaRecord // The CNAME record in the record set. CnameRecord *CnameRecord // The list of DS records in the record set. DsRecords []*DsRecord // The metadata attached to the record set. Metadata map[string]*string // The list of MX records in the record set. MxRecords []*MxRecord // The list of NAPTR records in the record set. NaptrRecords []*NaptrRecord // The list of NS records in the record set. NsRecords []*NsRecord // The list of PTR records in the record set. PtrRecords []*PtrRecord // The SOA record in the record set. SoaRecord *SoaRecord // The list of SRV records in the record set. SrvRecords []*SrvRecord // The TTL (time-to-live) of the records in the record set. TTL *int64 // A reference to an azure resource from where the dns resource value is taken. TargetResource *SubResource // The list of TLSA records in the record set. TlsaRecords []*TlsaRecord // A reference to an azure traffic manager profile resource from where the dns resource value is taken. TrafficManagementProfile *SubResource // The list of TXT records in the record set. TxtRecords []*TxtRecord // READ-ONLY; Fully qualified domain name of the record set. Fqdn *string // READ-ONLY; provisioning State of the record set. ProvisioningState *string }
RecordSetProperties - Represents the properties of the records in the record set.
func (RecordSetProperties) MarshalJSON ¶
func (r RecordSetProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RecordSetProperties.
func (*RecordSetProperties) UnmarshalJSON ¶
func (r *RecordSetProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RecordSetProperties.
type RecordSetUpdateParameters ¶
type RecordSetUpdateParameters struct { // Specifies information about the record set being updated. RecordSet *RecordSet }
RecordSetUpdateParameters - Parameters supplied to update a record set.
func (RecordSetUpdateParameters) MarshalJSON ¶
func (r RecordSetUpdateParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RecordSetUpdateParameters.
func (*RecordSetUpdateParameters) UnmarshalJSON ¶
func (r *RecordSetUpdateParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RecordSetUpdateParameters.
type RecordSetsClient ¶
type RecordSetsClient struct {
// contains filtered or unexported fields
}
RecordSetsClient contains the methods for the RecordSets group. Don't use this type directly, use NewRecordSetsClient() instead.
func NewRecordSetsClient ¶
func NewRecordSetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RecordSetsClient, error)
NewRecordSetsClient creates a new instance of RecordSetsClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*RecordSetsClient) CreateOrUpdate ¶
func (client *RecordSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, options *RecordSetsClientCreateOrUpdateOptions) (RecordSetsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created). If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- zoneName - The name of the DNS zone (without a terminating dot).
- relativeRecordSetName - The name of the record set, relative to the name of the zone.
- recordType - The type of DNS record in this record set.
- parameters - Parameters supplied to the CreateOrUpdate operation.
- options - RecordSetsClientCreateOrUpdateOptions contains the optional parameters for the RecordSetsClient.CreateOrUpdate method.
Example (CreateARecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordset.json
package main 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" ) func main() { 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"), // }, // }, // } }
Output:
Example (CreateARecordsetWithAliasTargetResource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordsetAlias.json
package main 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" ) func main() { 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"), // }, // }, // } }
Output:
Example (CreateARecordsetWithTrafficManagementProfile) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordSetTrafficManagementProfile.json
package main 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" ) func main() { 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"), }, TrafficManagementProfile: &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"), // TrafficManagementProfile: &armdns.SubResource{ // ID: to.Ptr("/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"), // }, // }, // } }
Output:
Example (CreateAaaaRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateAAAARecordset.json
package main 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" ) func main() { 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"), // }, // }, // } }
Output:
Example (CreateCaaRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateCaaRecordset.json
package main 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" ) func main() { 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"), // }, // }, // } }
Output:
Example (CreateCnameRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateCNAMERecordset.json
package main 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" ) func main() { 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"), // }, // }, // } }
Output:
Example (CreateDsRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDSRecordset.json
package main 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" ) func main() { 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.RecordTypeDS, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ DsRecords: []*armdns.DsRecord{ { Algorithm: to.Ptr[int32](5), Digest: &armdns.Digest{ AlgorithmType: to.Ptr[int32](1), Value: to.Ptr("2BB183AF5F22588179A53B0A98631FAD1A292118"), }, KeyTag: to.Ptr[int32](60485), }}, 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/DS"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/DS/record1"), // Properties: &armdns.RecordSetProperties{ // DsRecords: []*armdns.DsRecord{ // { // Algorithm: to.Ptr[int32](5), // Digest: &armdns.Digest{ // AlgorithmType: to.Ptr[int32](1), // Value: to.Ptr("2BB183AF5F22588179A53B0A98631FAD1A292118"), // }, // KeyTag: to.Ptr[int32](60485), // }}, // TTL: to.Ptr[int64](3600), // Fqdn: to.Ptr("record1.zone1"), // Metadata: map[string]*string{ // "key1": to.Ptr("value1"), // }, // }, // } }
Output:
Example (CreateMxRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateMXRecordset.json
package main 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" ) func main() { 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"), // }, // }, // } }
Output:
Example (CreateNaptrRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateNAPTRRecordset.json
package main 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" ) func main() { 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.RecordTypeNAPTR, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ NaptrRecords: []*armdns.NaptrRecord{ { Flags: to.Ptr("U"), Order: to.Ptr[int32](100), Preference: to.Ptr[int32](10), Regexp: to.Ptr("!^.*$!sip:user@example.com!"), Replacement: to.Ptr(""), Services: to.Ptr("E2U+sip"), }}, 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/NAPTR"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NAPTR/record1"), // Properties: &armdns.RecordSetProperties{ // NaptrRecords: []*armdns.NaptrRecord{ // { // Flags: to.Ptr("U"), // Order: to.Ptr[int32](100), // Preference: to.Ptr[int32](10), // Regexp: to.Ptr("!^.*$!sip:user@example.com!"), // Replacement: to.Ptr(""), // Services: to.Ptr("E2U+sip"), // }}, // TTL: to.Ptr[int64](3600), // Fqdn: to.Ptr("record1.zone1"), // Metadata: map[string]*string{ // "key1": to.Ptr("value1"), // }, // }, // } }
Output:
Example (CreateNsRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateNSRecordset.json
package main 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" ) func main() { 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"), // }, // }, // } }
Output:
Example (CreatePtrRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdatePTRRecordset.json
package main 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" ) func main() { 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"), // }, // }, // } }
Output:
Example (CreateSoaRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateSOARecordset.json
package main 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" ) func main() { 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"), // }, // }, // } }
Output:
Example (CreateSrvRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateSRVRecordset.json
package main 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" ) func main() { 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"), // }, // }, // } }
Output:
Example (CreateTlsaRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateTLSARecordset.json
package main 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" ) func main() { 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.RecordTypeTLSA, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ TlsaRecords: []*armdns.TlsaRecord{ { CertAssociationData: to.Ptr("6EC8A4B7F511454D84DCC055213B8D195E8ADA751FE14300AFE32D54B162438B"), MatchingType: to.Ptr[int32](1), Selector: to.Ptr[int32](1), Usage: to.Ptr[int32](3), }}, 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/TLSA"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TLSA/record1"), // Properties: &armdns.RecordSetProperties{ // TlsaRecords: []*armdns.TlsaRecord{ // { // CertAssociationData: to.Ptr("6EC8A4B7F511454D84DCC055213B8D195E8ADA751FE14300AFE32D54B162438B"), // MatchingType: to.Ptr[int32](1), // Selector: to.Ptr[int32](1), // Usage: to.Ptr[int32](3), // }}, // TTL: to.Ptr[int64](3600), // Fqdn: to.Ptr("record1.zone1"), // Metadata: map[string]*string{ // "key1": to.Ptr("value1"), // }, // }, // } }
Output:
Example (CreateTxtRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateTXTRecordset.json
package main 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" ) func main() { 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"), // }, // }, // } }
Output:
func (*RecordSetsClient) Delete ¶
func (client *RecordSetsClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, options *RecordSetsClientDeleteOptions) (RecordSetsClientDeleteResponse, error)
Delete - Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- zoneName - The name of the DNS zone (without a terminating dot).
- relativeRecordSetName - The name of the record set, relative to the name of the zone.
- recordType - The type of DNS record in this record set.
- options - RecordSetsClientDeleteOptions contains the optional parameters for the RecordSetsClient.Delete method.
Example (DeleteARecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteARecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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) } _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeA, &armdns.RecordSetsClientDeleteOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
Example (DeleteAaaaRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteAAAARecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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) } _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeAAAA, &armdns.RecordSetsClientDeleteOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
Example (DeleteCaaRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteCaaRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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) } _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeCAA, &armdns.RecordSetsClientDeleteOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
Example (DeleteCnameRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteCNAMERecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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) } _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeCNAME, &armdns.RecordSetsClientDeleteOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
Example (DeleteDsRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDSRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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) } _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeDS, &armdns.RecordSetsClientDeleteOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
Example (DeleteMxRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteMXRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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) } _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeMX, &armdns.RecordSetsClientDeleteOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
Example (DeleteNaptrRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteNAPTRRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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) } _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeNAPTR, &armdns.RecordSetsClientDeleteOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
Example (DeleteNsRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteNSRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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) } _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeNS, &armdns.RecordSetsClientDeleteOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
Example (DeletePtrRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeletePTRRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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) } _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "0.0.127.in-addr.arpa", "1", armdns.RecordTypePTR, &armdns.RecordSetsClientDeleteOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
Example (DeleteSrvRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteSRVRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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) } _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeSRV, &armdns.RecordSetsClientDeleteOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
Example (DeleteTlsaRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteTLSARecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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) } _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeTLSA, &armdns.RecordSetsClientDeleteOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
Example (DeleteTxtRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteTXTRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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) } _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeTXT, &armdns.RecordSetsClientDeleteOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*RecordSetsClient) Get ¶
func (client *RecordSetsClient) Get(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, options *RecordSetsClientGetOptions) (RecordSetsClientGetResponse, error)
Get - Gets a record set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- zoneName - The name of the DNS zone (without a terminating dot).
- relativeRecordSetName - The name of the record set, relative to the name of the zone.
- recordType - The type of DNS record in this record set.
- options - RecordSetsClientGetOptions contains the optional parameters for the RecordSetsClient.Get method.
Example (GetARecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetARecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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().Get(ctx, "rg1", "zone1", "record1", armdns.RecordTypeA, 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"), // }, // }, // } }
Output:
Example (GetAaaaRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetAAAARecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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().Get(ctx, "rg1", "zone1", "record1", armdns.RecordTypeAAAA, 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"), // }, // }, // } }
Output:
Example (GetCaaRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetCaaRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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().Get(ctx, "rg1", "zone1", "record1", armdns.RecordTypeCAA, 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"), // }, // }, // } }
Output:
Example (GetCnameRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetCNAMERecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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().Get(ctx, "rg1", "zone1", "record1", armdns.RecordTypeCNAME, 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"), // }, // }, // } }
Output:
Example (GetDsRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDSRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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().Get(ctx, "rg1", "zone1", "record1", armdns.RecordTypeDS, 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/DS"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/DS/record1"), // Properties: &armdns.RecordSetProperties{ // DsRecords: []*armdns.DsRecord{ // { // Algorithm: to.Ptr[int32](5), // Digest: &armdns.Digest{ // AlgorithmType: to.Ptr[int32](1), // Value: to.Ptr("2BB183AF5F22588179A53B0A98631FAD1A292118"), // }, // KeyTag: to.Ptr[int32](60485), // }}, // TTL: to.Ptr[int64](3600), // Fqdn: to.Ptr("record1.zone1"), // Metadata: map[string]*string{ // "key1": to.Ptr("value1"), // }, // }, // } }
Output:
Example (GetMxRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetMXRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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().Get(ctx, "rg1", "zone1", "record1", armdns.RecordTypeMX, 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"), // }, // }, // } }
Output:
Example (GetNaptrRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetNAPTRRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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().Get(ctx, "rg1", "zone1", "record1", armdns.RecordTypeNAPTR, 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/NAPTR"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NAPTR/record1"), // Properties: &armdns.RecordSetProperties{ // NaptrRecords: []*armdns.NaptrRecord{ // { // Flags: to.Ptr("U"), // Order: to.Ptr[int32](100), // Preference: to.Ptr[int32](10), // Regexp: to.Ptr("!^.*$!sip:user@example.com!"), // Replacement: to.Ptr(""), // Services: to.Ptr("E2U+sip"), // }}, // TTL: to.Ptr[int64](3600), // Fqdn: to.Ptr("record1.zone1"), // Metadata: map[string]*string{ // "key1": to.Ptr("value1"), // }, // }, // } }
Output:
Example (GetNsRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetNSRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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().Get(ctx, "rg1", "zone1", "record1", armdns.RecordTypeNS, 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"), // }, // }, // } }
Output:
Example (GetPtrRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetPTRRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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().Get(ctx, "rg1", "0.0.127.in-addr.arpa", "1", armdns.RecordTypePTR, 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"), // }, // }, // } }
Output:
Example (GetSoaRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetSOARecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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().Get(ctx, "rg1", "zone1", "@", armdns.RecordTypeSOA, 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"), // }, // }, // } }
Output:
Example (GetSrvRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetSRVRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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().Get(ctx, "rg1", "zone1", "record1", armdns.RecordTypeSRV, 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"), // }, // }, // } }
Output:
Example (GetTlsaRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetTLSARecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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().Get(ctx, "rg1", "zone1", "record1", armdns.RecordTypeTLSA, 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/TLSA"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TLSA/record1"), // Properties: &armdns.RecordSetProperties{ // TlsaRecords: []*armdns.TlsaRecord{ // { // CertAssociationData: to.Ptr("6EC8A4B7F511454D84DCC055213B8D195E8ADA751FE14300AFE32D54B162438B"), // MatchingType: to.Ptr[int32](1), // Selector: to.Ptr[int32](1), // Usage: to.Ptr[int32](3), // }}, // TTL: to.Ptr[int64](3600), // Fqdn: to.Ptr("record1.zone1"), // Metadata: map[string]*string{ // "key1": to.Ptr("value1"), // }, // }, // } }
Output:
Example (GetTxtRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetTXTRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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().Get(ctx, "rg1", "zone1", "record1", armdns.RecordTypeTXT, 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"), // }, // }, // } }
Output:
func (*RecordSetsClient) NewListAllByDNSZonePager ¶
func (client *RecordSetsClient) NewListAllByDNSZonePager(resourceGroupName string, zoneName string, options *RecordSetsClientListAllByDNSZoneOptions) *runtime.Pager[RecordSetsClientListAllByDNSZoneResponse]
NewListAllByDNSZonePager - Lists all record sets in a DNS zone.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- zoneName - The name of the DNS zone (without a terminating dot).
- options - RecordSetsClientListAllByDNSZoneOptions contains the optional parameters for the RecordSetsClient.NewListAllByDNSZonePager method.
func (*RecordSetsClient) NewListByDNSZonePager ¶
func (client *RecordSetsClient) NewListByDNSZonePager(resourceGroupName string, zoneName string, options *RecordSetsClientListByDNSZoneOptions) *runtime.Pager[RecordSetsClientListByDNSZoneResponse]
NewListByDNSZonePager - Lists all record sets in a DNS zone.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- zoneName - The name of the DNS zone (without a terminating dot).
- options - RecordSetsClientListByDNSZoneOptions contains the optional parameters for the RecordSetsClient.NewListByDNSZonePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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().NewListByDNSZonePager("rg1", "zone1", &armdns.RecordSetsClientListByDNSZoneOptions{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"), // }, // }, // }, // { // 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"), // }, // }, // }, // { // Name: to.Ptr("record2"), // 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/record2"), // Properties: &armdns.RecordSetProperties{ // CnameRecord: &armdns.CnameRecord{ // Cname: to.Ptr("contoso.com"), // }, // TTL: to.Ptr[int64](3600), // Fqdn: to.Ptr("record2.zone1"), // Metadata: map[string]*string{ // "key1": to.Ptr("value1"), // }, // }, // }}, // } } }
Output:
func (*RecordSetsClient) NewListByTypePager ¶
func (client *RecordSetsClient) NewListByTypePager(resourceGroupName string, zoneName string, recordType RecordType, options *RecordSetsClientListByTypeOptions) *runtime.Pager[RecordSetsClientListByTypeResponse]
NewListByTypePager - Lists the record sets of a specified type in a DNS zone.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- zoneName - The name of the DNS zone (without a terminating dot).
- recordType - The type of DNS record in this record set.
- options - RecordSetsClientListByTypeOptions contains the optional parameters for the RecordSetsClient.NewListByTypePager method.
Example (ListARecordsets) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListARecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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"), // }, // }, // }}, // } } }
Output:
Example (ListAaaaRecordsets) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListAAAARecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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"), // }, // }, // }}, // } } }
Output:
Example (ListCaaRecordsets) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListCaaRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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"), // }, // }, // }}, // } } }
Output:
Example (ListCnameRecordsets) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListCNAMERecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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"), // }, // }, // }}, // } } }
Output:
Example (ListDsRecordsets) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDSRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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.RecordTypeDS, &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/DS"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/DS/record1"), // Properties: &armdns.RecordSetProperties{ // DsRecords: []*armdns.DsRecord{ // { // Algorithm: to.Ptr[int32](5), // Digest: &armdns.Digest{ // AlgorithmType: to.Ptr[int32](1), // Value: to.Ptr("2BB183AF5F22588179A53B0A98631FAD1A292118"), // }, // KeyTag: to.Ptr[int32](60485), // }}, // TTL: to.Ptr[int64](3600), // Fqdn: to.Ptr("record1.zone1"), // Metadata: map[string]*string{ // "key1": to.Ptr("value1"), // }, // }, // }}, // } } }
Output:
Example (ListMxRecordsets) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListMXRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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"), // }, // }, // }}, // } } }
Output:
Example (ListNaptrRecordsets) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListNAPTRRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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.RecordTypeNAPTR, &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/NAPTR"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NAPTR/record1"), // Properties: &armdns.RecordSetProperties{ // NaptrRecords: []*armdns.NaptrRecord{ // { // Flags: to.Ptr("u"), // Order: to.Ptr[int32](100), // Preference: to.Ptr[int32](10), // Regexp: to.Ptr("!^.*$!sip:user@example.com!"), // Replacement: to.Ptr(""), // Services: to.Ptr("E2U+sip"), // }}, // TTL: to.Ptr[int64](3600), // Fqdn: to.Ptr("record1.zone1"), // Metadata: map[string]*string{ // "key1": to.Ptr("value1"), // }, // }, // }}, // } } }
Output:
Example (ListNsRecordsets) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListNSRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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"), // }, // }, // }}, // } } }
Output:
Example (ListPtrRecordsets) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListPTRRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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"), // }, // }, // }}, // } } }
Output:
Example (ListSoaRecordsets) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListSOARecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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"), // }, // }, // }}, // } } }
Output:
Example (ListSrvRecordsets) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListSRVRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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"), // }, // }, // }}, // } } }
Output:
Example (ListTlsaRecordsets) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListTLSARecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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.RecordTypeTLSA, &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/TLSA"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TLSA/record1"), // Properties: &armdns.RecordSetProperties{ // TlsaRecords: []*armdns.TlsaRecord{ // { // CertAssociationData: to.Ptr("6EC8A4B7F511454D84DCC055213B8D195E8ADA751FE14300AFE32D54B162438B"), // MatchingType: to.Ptr[int32](1), // Selector: to.Ptr[int32](1), // Usage: to.Ptr[int32](3), // }}, // TTL: to.Ptr[int64](3600), // Fqdn: to.Ptr("record1.zone1"), // Metadata: map[string]*string{ // "key1": to.Ptr("value1"), // }, // }, // }}, // } } }
Output:
Example (ListTxtRecordsets) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListTXTRecordset.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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"), // }, // }, // }}, // } } }
Output:
func (*RecordSetsClient) Update ¶
func (client *RecordSetsClient) Update(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, options *RecordSetsClientUpdateOptions) (RecordSetsClientUpdateResponse, error)
Update - Updates a record set within a DNS zone. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- zoneName - The name of the DNS zone (without a terminating dot).
- relativeRecordSetName - The name of the record set, relative to the name of the zone.
- recordType - The type of DNS record in this record set.
- parameters - Parameters supplied to the Update operation.
- options - RecordSetsClientUpdateOptions contains the optional parameters for the RecordSetsClient.Update method.
Example (PatchARecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchARecordset.json
package main 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" ) func main() { 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().Update(ctx, "rg1", "zone1", "record1", armdns.RecordTypeA, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ Metadata: map[string]*string{ "key2": to.Ptr("value2"), }, }, }, &armdns.RecordSetsClientUpdateOptions{IfMatch: 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{ // "key2": to.Ptr("value2"), // }, // }, // } }
Output:
Example (PatchAaaaRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchAAAARecordset.json
package main 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" ) func main() { 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().Update(ctx, "rg1", "zone1", "record1", armdns.RecordTypeAAAA, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ Metadata: map[string]*string{ "key2": to.Ptr("value2"), }, }, }, &armdns.RecordSetsClientUpdateOptions{IfMatch: 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{ // "key2": to.Ptr("value2"), // }, // }, // } }
Output:
Example (PatchCaaRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchCaaRecordset.json
package main 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" ) func main() { 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().Update(ctx, "rg1", "zone1", "record1", armdns.RecordTypeCAA, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ Metadata: map[string]*string{ "key2": to.Ptr("value2"), }, }, }, &armdns.RecordSetsClientUpdateOptions{IfMatch: 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{ // "key2": to.Ptr("value2"), // }, // }, // } }
Output:
Example (PatchCnameRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchCNAMERecordset.json
package main 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" ) func main() { 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().Update(ctx, "rg1", "zone1", "record1", armdns.RecordTypeCNAME, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ Metadata: map[string]*string{ "key2": to.Ptr("value2"), }, }, }, &armdns.RecordSetsClientUpdateOptions{IfMatch: 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{ // "key2": to.Ptr("value2"), // }, // }, // } }
Output:
Example (PatchDsRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchDSRecordset.json
package main 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" ) func main() { 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().Update(ctx, "rg1", "zone1", "record1", armdns.RecordTypeDS, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ Metadata: map[string]*string{ "key2": to.Ptr("value2"), }, }, }, &armdns.RecordSetsClientUpdateOptions{IfMatch: 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/DS"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/DS/record1"), // Properties: &armdns.RecordSetProperties{ // DsRecords: []*armdns.DsRecord{ // { // Algorithm: to.Ptr[int32](5), // Digest: &armdns.Digest{ // AlgorithmType: to.Ptr[int32](1), // Value: to.Ptr("2BB183AF5F22588179A53B0A98631FAD1A292118"), // }, // KeyTag: to.Ptr[int32](60485), // }}, // TTL: to.Ptr[int64](3600), // Fqdn: to.Ptr("record1.zone1"), // Metadata: map[string]*string{ // "key2": to.Ptr("value2"), // }, // }, // } }
Output:
Example (PatchMxRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchMXRecordset.json
package main 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" ) func main() { 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().Update(ctx, "rg1", "zone1", "record1", armdns.RecordTypeMX, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ Metadata: map[string]*string{ "key2": to.Ptr("value2"), }, }, }, &armdns.RecordSetsClientUpdateOptions{IfMatch: 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{ // "key2": to.Ptr("value2"), // }, // }, // } }
Output:
Example (PatchNaptrRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchNAPTRRecordset.json
package main 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" ) func main() { 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().Update(ctx, "rg1", "zone1", "record1", armdns.RecordTypeNAPTR, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ Metadata: map[string]*string{ "key2": to.Ptr("value2"), }, }, }, &armdns.RecordSetsClientUpdateOptions{IfMatch: 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/NAPTR"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NAPTR/record1"), // Properties: &armdns.RecordSetProperties{ // NaptrRecords: []*armdns.NaptrRecord{ // { // Flags: to.Ptr("U"), // Order: to.Ptr[int32](100), // Preference: to.Ptr[int32](10), // Regexp: to.Ptr("!^.*$!sip:user@example.com!"), // Replacement: to.Ptr(""), // Services: to.Ptr("E2U+sip"), // }}, // TTL: to.Ptr[int64](3600), // Fqdn: to.Ptr("record1.zone1"), // Metadata: map[string]*string{ // "key2": to.Ptr("value2"), // }, // }, // } }
Output:
Example (PatchNsRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchNSRecordset.json
package main 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" ) func main() { 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().Update(ctx, "rg1", "zone1", "record1", armdns.RecordTypeNS, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ Metadata: map[string]*string{ "key2": to.Ptr("value2"), }, }, }, &armdns.RecordSetsClientUpdateOptions{IfMatch: 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{ // "key2": to.Ptr("value2"), // }, // }, // } }
Output:
Example (PatchPtrRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchPTRRecordset.json
package main 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" ) func main() { 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().Update(ctx, "rg1", "0.0.127.in-addr.arpa", "1", armdns.RecordTypePTR, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ Metadata: map[string]*string{ "key2": to.Ptr("value2"), }, }, }, &armdns.RecordSetsClientUpdateOptions{IfMatch: 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{ // "key2": to.Ptr("value2"), // }, // }, // } }
Output:
Example (PatchSoaRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchSOARecordset.json
package main 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" ) func main() { 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().Update(ctx, "rg1", "zone1", "@", armdns.RecordTypeSOA, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ Metadata: map[string]*string{ "key2": to.Ptr("value2"), }, }, }, &armdns.RecordSetsClientUpdateOptions{IfMatch: 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{ // "key2": to.Ptr("value2"), // }, // }, // } }
Output:
Example (PatchSrvRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchSRVRecordset.json
package main 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" ) func main() { 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().Update(ctx, "rg1", "zone1", "record1", armdns.RecordTypeSRV, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ Metadata: map[string]*string{ "key2": to.Ptr("value2"), }, }, }, &armdns.RecordSetsClientUpdateOptions{IfMatch: 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{ // "key2": to.Ptr("value2"), // }, // }, // } }
Output:
Example (PatchTlsaRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchTLSARecordset.json
package main 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" ) func main() { 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().Update(ctx, "rg1", "zone1", "record1", armdns.RecordTypeTLSA, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ Metadata: map[string]*string{ "key2": to.Ptr("value2"), }, }, }, &armdns.RecordSetsClientUpdateOptions{IfMatch: 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/TLSA"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TLSA/record1"), // Properties: &armdns.RecordSetProperties{ // TlsaRecords: []*armdns.TlsaRecord{ // { // CertAssociationData: to.Ptr("6EC8A4B7F511454D84DCC055213B8D195E8ADA751FE14300AFE32D54B162438B"), // MatchingType: to.Ptr[int32](1), // Selector: to.Ptr[int32](1), // Usage: to.Ptr[int32](3), // }}, // TTL: to.Ptr[int64](3600), // Fqdn: to.Ptr("record1.zone1"), // Metadata: map[string]*string{ // "key2": to.Ptr("value2"), // }, // }, // } }
Output:
Example (PatchTxtRecordset) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchTXTRecordset.json
package main 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" ) func main() { 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().Update(ctx, "rg1", "zone1", "record1", armdns.RecordTypeTXT, armdns.RecordSet{ Properties: &armdns.RecordSetProperties{ Metadata: map[string]*string{ "key2": to.Ptr("value2"), }, }, }, &armdns.RecordSetsClientUpdateOptions{IfMatch: 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{ // "key2": to.Ptr("value2"), // }, // }, // } }
Output:
type RecordSetsClientCreateOrUpdateOptions ¶
type RecordSetsClientCreateOrUpdateOptions struct { // The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value // to prevent accidentally overwriting any concurrent changes. IfMatch *string // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will be // ignored. IfNoneMatch *string }
RecordSetsClientCreateOrUpdateOptions contains the optional parameters for the RecordSetsClient.CreateOrUpdate method.
type RecordSetsClientCreateOrUpdateResponse ¶
type RecordSetsClientCreateOrUpdateResponse struct { // Describes a DNS record set (a collection of DNS records with the same name and type). RecordSet }
RecordSetsClientCreateOrUpdateResponse contains the response from method RecordSetsClient.CreateOrUpdate.
type RecordSetsClientDeleteOptions ¶
type RecordSetsClientDeleteOptions struct { // The etag of the record set. Omit this value to always delete the current record set. Specify the last-seen etag value to // prevent accidentally deleting any concurrent changes. IfMatch *string }
RecordSetsClientDeleteOptions contains the optional parameters for the RecordSetsClient.Delete method.
type RecordSetsClientDeleteResponse ¶
type RecordSetsClientDeleteResponse struct { }
RecordSetsClientDeleteResponse contains the response from method RecordSetsClient.Delete.
type RecordSetsClientGetOptions ¶
type RecordSetsClientGetOptions struct { }
RecordSetsClientGetOptions contains the optional parameters for the RecordSetsClient.Get method.
type RecordSetsClientGetResponse ¶
type RecordSetsClientGetResponse struct { // Describes a DNS record set (a collection of DNS records with the same name and type). RecordSet }
RecordSetsClientGetResponse contains the response from method RecordSetsClient.Get.
type RecordSetsClientListAllByDNSZoneOptions ¶
type RecordSetsClientListAllByDNSZoneOptions struct { // The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is // specified, Enumeration will return only records that end with . RecordSetNameSuffix *string // The maximum number of record sets to return. If not specified, returns up to 100 record sets. Top *int32 }
RecordSetsClientListAllByDNSZoneOptions contains the optional parameters for the RecordSetsClient.NewListAllByDNSZonePager method.
type RecordSetsClientListAllByDNSZoneResponse ¶
type RecordSetsClientListAllByDNSZoneResponse struct { // The response to a record set List operation. RecordSetListResult }
RecordSetsClientListAllByDNSZoneResponse contains the response from method RecordSetsClient.NewListAllByDNSZonePager.
type RecordSetsClientListByDNSZoneOptions ¶
type RecordSetsClientListByDNSZoneOptions struct { // The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is // specified, Enumeration will return only records that end with . Recordsetnamesuffix *string // The maximum number of record sets to return. If not specified, returns up to 100 record sets. Top *int32 }
RecordSetsClientListByDNSZoneOptions contains the optional parameters for the RecordSetsClient.NewListByDNSZonePager method.
type RecordSetsClientListByDNSZoneResponse ¶
type RecordSetsClientListByDNSZoneResponse struct { // The response to a record set List operation. RecordSetListResult }
RecordSetsClientListByDNSZoneResponse contains the response from method RecordSetsClient.NewListByDNSZonePager.
type RecordSetsClientListByTypeOptions ¶
type RecordSetsClientListByTypeOptions struct { // The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is // specified, Enumeration will return only records that end with . Recordsetnamesuffix *string // The maximum number of record sets to return. If not specified, returns up to 100 record sets. Top *int32 }
RecordSetsClientListByTypeOptions contains the optional parameters for the RecordSetsClient.NewListByTypePager method.
type RecordSetsClientListByTypeResponse ¶
type RecordSetsClientListByTypeResponse struct { // The response to a record set List operation. RecordSetListResult }
RecordSetsClientListByTypeResponse contains the response from method RecordSetsClient.NewListByTypePager.
type RecordSetsClientUpdateOptions ¶
type RecordSetsClientUpdateOptions struct { // The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value // to prevent accidentally overwriting concurrent changes. IfMatch *string }
RecordSetsClientUpdateOptions contains the optional parameters for the RecordSetsClient.Update method.
type RecordSetsClientUpdateResponse ¶
type RecordSetsClientUpdateResponse struct { // Describes a DNS record set (a collection of DNS records with the same name and type). RecordSet }
RecordSetsClientUpdateResponse contains the response from method RecordSetsClient.Update.
type RecordType ¶
type RecordType string
const ( RecordTypeA RecordType = "A" RecordTypeAAAA RecordType = "AAAA" RecordTypeCAA RecordType = "CAA" RecordTypeCNAME RecordType = "CNAME" RecordTypeDS RecordType = "DS" RecordTypeMX RecordType = "MX" RecordTypeNAPTR RecordType = "NAPTR" RecordTypeNS RecordType = "NS" RecordTypePTR RecordType = "PTR" RecordTypeSOA RecordType = "SOA" RecordTypeSRV RecordType = "SRV" RecordTypeTLSA RecordType = "TLSA" RecordTypeTXT RecordType = "TXT" )
func PossibleRecordTypeValues ¶
func PossibleRecordTypeValues() []RecordType
PossibleRecordTypeValues returns the possible values for the RecordType const type.
type Resource ¶
type Resource struct { // REQUIRED; Resource location. Location *string // Resource tags. Tags map[string]*string // READ-ONLY; Resource ID. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
Resource - Common properties of an Azure Resource Manager resource
func (Resource) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Resource.
func (*Resource) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
type ResourceReference ¶
type ResourceReference struct { // A list of dns Records DNSResources []*SubResource // A reference to an azure resource from where the dns resource value is taken. TargetResource *SubResource }
ResourceReference - Represents a single Azure resource and its referencing DNS records.
func (ResourceReference) MarshalJSON ¶
func (r ResourceReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceReference.
func (*ResourceReference) UnmarshalJSON ¶
func (r *ResourceReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceReference.
type ResourceReferenceClient ¶
type ResourceReferenceClient struct {
// contains filtered or unexported fields
}
ResourceReferenceClient contains the methods for the DNSResourceReference group. Don't use this type directly, use NewResourceReferenceClient() instead.
func NewResourceReferenceClient ¶
func NewResourceReferenceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceReferenceClient, error)
NewResourceReferenceClient creates a new instance of ResourceReferenceClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ResourceReferenceClient) GetByTargetResources ¶
func (client *ResourceReferenceClient) GetByTargetResources(ctx context.Context, parameters ResourceReferenceRequest, options *ResourceReferenceClientGetByTargetResourcesOptions) (ResourceReferenceClientGetByTargetResourcesResponse, error)
GetByTargetResources - Returns the DNS records specified by the referencing targetResourceIds. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-01-preview
- parameters - Properties for dns resource reference request.
- options - ResourceReferenceClientGetByTargetResourcesOptions contains the optional parameters for the ResourceReferenceClient.GetByTargetResources method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnsResourceReference.json
package main 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" ) func main() { 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.NewResourceReferenceClient().GetByTargetResources(ctx, armdns.ResourceReferenceRequest{ Properties: &armdns.ResourceReferenceRequestProperties{ TargetResources: []*armdns.SubResource{ { ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/trafficManagerProfiles/testpp2"), }}, }, }, 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.ResourceReferenceResult = armdns.ResourceReferenceResult{ // Properties: &armdns.ResourceReferenceResultProperties{ // DNSResourceReferences: []*armdns.ResourceReference{ // { // DNSResources: []*armdns.SubResource{ // { // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.network/dnszones/hydratest.dnszone.com5989/a/hydratestdnsrec9310"), // }}, // TargetResource: &armdns.SubResource{ // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/trafficManagerProfiles/testpp2"), // }, // }}, // }, // } }
Output:
type ResourceReferenceClientGetByTargetResourcesOptions ¶
type ResourceReferenceClientGetByTargetResourcesOptions struct { }
ResourceReferenceClientGetByTargetResourcesOptions contains the optional parameters for the ResourceReferenceClient.GetByTargetResources method.
type ResourceReferenceClientGetByTargetResourcesResponse ¶
type ResourceReferenceClientGetByTargetResourcesResponse struct { // Represents the properties of the Dns Resource Reference Result. ResourceReferenceResult }
ResourceReferenceClientGetByTargetResourcesResponse contains the response from method ResourceReferenceClient.GetByTargetResources.
type ResourceReferenceRequest ¶
type ResourceReferenceRequest struct { // The properties of the Resource Reference Request. Properties *ResourceReferenceRequestProperties }
ResourceReferenceRequest - Represents the properties of the Dns Resource Reference Request.
func (ResourceReferenceRequest) MarshalJSON ¶
func (r ResourceReferenceRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceReferenceRequest.
func (*ResourceReferenceRequest) UnmarshalJSON ¶
func (r *ResourceReferenceRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceReferenceRequest.
type ResourceReferenceRequestProperties ¶
type ResourceReferenceRequestProperties struct { // A list of references to azure resources for which referencing dns records need to be queried. TargetResources []*SubResource }
ResourceReferenceRequestProperties - Represents the properties of the Dns Resource Reference Request.
func (ResourceReferenceRequestProperties) MarshalJSON ¶
func (r ResourceReferenceRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceReferenceRequestProperties.
func (*ResourceReferenceRequestProperties) UnmarshalJSON ¶
func (r *ResourceReferenceRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceReferenceRequestProperties.
type ResourceReferenceResult ¶
type ResourceReferenceResult struct { // The result of dns resource reference request. Returns a list of dns resource references for each of the azure resource // in the request. Properties *ResourceReferenceResultProperties }
ResourceReferenceResult - Represents the properties of the Dns Resource Reference Result.
func (ResourceReferenceResult) MarshalJSON ¶
func (r ResourceReferenceResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceReferenceResult.
func (*ResourceReferenceResult) UnmarshalJSON ¶
func (r *ResourceReferenceResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceReferenceResult.
type ResourceReferenceResultProperties ¶
type ResourceReferenceResultProperties struct { // The result of dns resource reference request. A list of dns resource references for each of the azure resource in the request DNSResourceReferences []*ResourceReference }
ResourceReferenceResultProperties - The result of dns resource reference request. Returns a list of dns resource references for each of the azure resource in the request.
func (ResourceReferenceResultProperties) MarshalJSON ¶
func (r ResourceReferenceResultProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceReferenceResultProperties.
func (*ResourceReferenceResultProperties) UnmarshalJSON ¶
func (r *ResourceReferenceResultProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceReferenceResultProperties.
type SigningKey ¶
type SigningKey struct { // READ-ONLY; The delegation signer information. DelegationSignerInfo []*DelegationSignerInfo // READ-ONLY; The flags specifies how the key is used. Flags *int32 // READ-ONLY; The key tag value of the DNSKEY Resource Record. KeyTag *int32 // READ-ONLY; The protocol value. The value is always 3. Protocol *int32 // READ-ONLY; The public key, represented as a Base64 encoding. PublicKey *string // READ-ONLY; The security algorithm type represents the standard security algorithm number of the DNSKEY Resource Record. // See: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml SecurityAlgorithmType *int32 }
SigningKey - Represents the signing key.
func (SigningKey) MarshalJSON ¶
func (s SigningKey) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SigningKey.
func (*SigningKey) UnmarshalJSON ¶
func (s *SigningKey) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SigningKey.
type SoaRecord ¶
type SoaRecord struct { // The email contact for this SOA record. Email *string // The expire time for this SOA record. ExpireTime *int64 // The domain name of the authoritative name server for this SOA record. Host *string // The minimum value for this SOA record. By convention this is used to determine the negative caching duration. MinimumTTL *int64 // The refresh value for this SOA record. RefreshTime *int64 // The retry time for this SOA record. RetryTime *int64 // The serial number for this SOA record. SerialNumber *int64 }
SoaRecord - An SOA record.
func (SoaRecord) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type SoaRecord.
func (*SoaRecord) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type SoaRecord.
type SrvRecord ¶
type SrvRecord struct { // The port value for this SRV record. Port *int32 // The priority value for this SRV record. Priority *int32 // The target domain name for this SRV record. Target *string // The weight value for this SRV record. Weight *int32 }
SrvRecord - An SRV record.
func (SrvRecord) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type SrvRecord.
func (*SrvRecord) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type SrvRecord.
type SubResource ¶
type SubResource struct { // Resource Id. ID *string }
SubResource - A reference to a another resource
func (SubResource) MarshalJSON ¶
func (s SubResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubResource.
func (*SubResource) UnmarshalJSON ¶
func (s *SubResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubResource.
type SystemData ¶
type SystemData struct { // The timestamp of resource creation (UTC). CreatedAt *time.Time // The identity that created the resource. CreatedBy *string // The type of identity that created the resource. CreatedByType *CreatedByType // The timestamp of resource last modification (UTC) LastModifiedAt *time.Time // The identity that last modified the resource. LastModifiedBy *string // The type of identity that last modified the resource. LastModifiedByType *CreatedByType }
SystemData - Metadata pertaining to creation and last modification of the resource.
func (SystemData) MarshalJSON ¶
func (s SystemData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SystemData.
func (*SystemData) UnmarshalJSON ¶
func (s *SystemData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.
type TlsaRecord ¶
type TlsaRecord struct { // This specifies the certificate association data to be matched. CertAssociationData *string // The matching type specifies how the certificate association is presented. MatchingType *int32 // The selector specifies which part of the TLS certificate presented by the server will be matched against the association // data. Selector *int32 // The usage specifies the provided association that will be used to match the certificate presented in the TLS handshake. Usage *int32 }
TlsaRecord - A TLSA record. For more information about the TLSA record format, see RFC 6698: https://www.rfc-editor.org/rfc/rfc6698
func (TlsaRecord) MarshalJSON ¶
func (t TlsaRecord) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TlsaRecord.
func (*TlsaRecord) UnmarshalJSON ¶
func (t *TlsaRecord) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TlsaRecord.
type TxtRecord ¶
type TxtRecord struct { // The text value of this TXT record. Value []*string }
TxtRecord - A TXT record.
func (TxtRecord) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type TxtRecord.
func (*TxtRecord) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type TxtRecord.
type Zone ¶
type Zone struct { // REQUIRED; Resource location. Location *string // The etag of the zone. Etag *string // The properties of the zone. Properties *ZoneProperties // Resource tags. Tags map[string]*string // READ-ONLY; Resource ID. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. SystemData *SystemData // READ-ONLY; Resource type. Type *string }
Zone - Describes a DNS zone.
func (Zone) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Zone.
func (*Zone) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Zone.
type ZoneListResult ¶
type ZoneListResult struct { // Information about the DNS zones. Value []*Zone // READ-ONLY; The continuation token for the next page of results. NextLink *string }
ZoneListResult - The response to a Zone List or ListAll operation.
func (ZoneListResult) MarshalJSON ¶
func (z ZoneListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ZoneListResult.
func (*ZoneListResult) UnmarshalJSON ¶
func (z *ZoneListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ZoneListResult.
type ZoneProperties ¶
type ZoneProperties struct { // A list of references to virtual networks that register hostnames in this DNS zone. This is a only when ZoneType is Private. RegistrationVirtualNetworks []*SubResource // A list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is Private. ResolutionVirtualNetworks []*SubResource // The type of this DNS zone (Public or Private). ZoneType *ZoneType // READ-ONLY; The maximum number of record sets that can be created in this DNS zone. This is a read-only property and any // attempt to set this value will be ignored. MaxNumberOfRecordSets *int64 // READ-ONLY; The maximum number of records per record set that can be created in this DNS zone. This is a read-only property // and any attempt to set this value will be ignored. MaxNumberOfRecordsPerRecordSet *int64 // READ-ONLY; The name servers for this DNS zone. This is a read-only property and any attempt to set this value will be ignored. NameServers []*string // READ-ONLY; The current number of record sets in this DNS zone. This is a read-only property and any attempt to set this // value will be ignored. NumberOfRecordSets *int64 // READ-ONLY; The list of signing keys. SigningKeys []*SigningKey }
ZoneProperties - Represents the properties of the zone.
func (ZoneProperties) MarshalJSON ¶
func (z ZoneProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ZoneProperties.
func (*ZoneProperties) UnmarshalJSON ¶
func (z *ZoneProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ZoneProperties.
type ZoneType ¶
type ZoneType string
ZoneType - The type of this DNS zone (Public or Private).
func PossibleZoneTypeValues ¶
func PossibleZoneTypeValues() []ZoneType
PossibleZoneTypeValues returns the possible values for the ZoneType const type.
type ZoneUpdate ¶
ZoneUpdate - Describes a request to update a DNS zone.
func (ZoneUpdate) MarshalJSON ¶
func (z ZoneUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ZoneUpdate.
func (*ZoneUpdate) UnmarshalJSON ¶
func (z *ZoneUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ZoneUpdate.
type ZonesClient ¶
type ZonesClient struct {
// contains filtered or unexported fields
}
ZonesClient contains the methods for the Zones group. Don't use this type directly, use NewZonesClient() instead.
func NewZonesClient ¶
func NewZonesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ZonesClient, error)
NewZonesClient creates a new instance of ZonesClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ZonesClient) BeginDelete ¶
func (client *ZonesClient) BeginDelete(ctx context.Context, resourceGroupName string, zoneName string, options *ZonesClientBeginDeleteOptions) (*runtime.Poller[ZonesClientDeleteResponse], error)
BeginDelete - Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- zoneName - The name of the DNS zone (without a terminating dot).
- options - ZonesClientBeginDeleteOptions contains the optional parameters for the ZonesClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteZone.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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) } poller, err := clientFactory.NewZonesClient().BeginDelete(ctx, "rg1", "zone1", &armdns.ZonesClientBeginDeleteOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } }
Output:
func (*ZonesClient) CreateOrUpdate ¶
func (client *ZonesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, parameters Zone, options *ZonesClientCreateOrUpdateOptions) (ZonesClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates or updates a DNS zone. Does not modify DNS records within the zone. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- zoneName - The name of the DNS zone (without a terminating dot).
- parameters - Parameters supplied to the CreateOrUpdate operation.
- options - ZonesClientCreateOrUpdateOptions contains the optional parameters for the ZonesClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateZone.json
package main 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" ) func main() { 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.NewZonesClient().CreateOrUpdate(ctx, "rg1", "zone1", armdns.Zone{ Location: to.Ptr("Global"), Tags: map[string]*string{ "key1": to.Ptr("value1"), }, }, &armdns.ZonesClientCreateOrUpdateOptions{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.Zone = armdns.Zone{ // Name: to.Ptr("zone1"), // Type: to.Ptr("Microsoft.Network/dnsZones"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // }, // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // Properties: &armdns.ZoneProperties{ // MaxNumberOfRecordSets: to.Ptr[int64](5000), // NameServers: []*string{ // to.Ptr("ns1-01.azure-dns.com"), // to.Ptr("ns2-01.azure-dns.net"), // to.Ptr("ns3-01.azure-dns.org"), // to.Ptr("ns4-01.azure-dns.info")}, // NumberOfRecordSets: to.Ptr[int64](2), // ZoneType: to.Ptr(armdns.ZoneTypePublic), // }, // } }
Output:
func (*ZonesClient) Get ¶
func (client *ZonesClient) Get(ctx context.Context, resourceGroupName string, zoneName string, options *ZonesClientGetOptions) (ZonesClientGetResponse, error)
Get - Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- zoneName - The name of the DNS zone (without a terminating dot).
- options - ZonesClientGetOptions contains the optional parameters for the ZonesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetZone.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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.NewZonesClient().Get(ctx, "rg1", "zone1", 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.Zone = armdns.Zone{ // Name: to.Ptr("zone1"), // Type: to.Ptr("Microsoft.Network/dnsZones"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // }, // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // Properties: &armdns.ZoneProperties{ // MaxNumberOfRecordSets: to.Ptr[int64](5000), // NameServers: []*string{ // to.Ptr("ns1-01.azure-dns.com"), // to.Ptr("ns2-01.azure-dns.net"), // to.Ptr("ns3-01.azure-dns.org"), // to.Ptr("ns4-01.azure-dns.info")}, // NumberOfRecordSets: to.Ptr[int64](2), // }, // } }
Output:
func (*ZonesClient) NewListByResourceGroupPager ¶
func (client *ZonesClient) NewListByResourceGroupPager(resourceGroupName string, options *ZonesClientListByResourceGroupOptions) *runtime.Pager[ZonesClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists the DNS zones within a resource group.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - ZonesClientListByResourceGroupOptions contains the optional parameters for the ZonesClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesByResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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.NewZonesClient().NewListByResourceGroupPager("rg1", &armdns.ZonesClientListByResourceGroupOptions{Top: 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.ZoneListResult = armdns.ZoneListResult{ // Value: []*armdns.Zone{ // { // Name: to.Ptr("zone1"), // Type: to.Ptr("Microsoft.Network/dnsZones"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // }, // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // Properties: &armdns.ZoneProperties{ // MaxNumberOfRecordSets: to.Ptr[int64](5000), // NameServers: []*string{ // to.Ptr("ns1-01.azure-dns.com"), // to.Ptr("ns2-01.azure-dns.net"), // to.Ptr("ns3-01.azure-dns.org"), // to.Ptr("ns4-01.azure-dns.info")}, // NumberOfRecordSets: to.Ptr[int64](2), // }, // }, // { // Name: to.Ptr("zone2"), // Type: to.Ptr("Microsoft.Network/dnsZones"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone2"), // Location: to.Ptr("global"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // Properties: &armdns.ZoneProperties{ // MaxNumberOfRecordSets: to.Ptr[int64](5000), // NameServers: []*string{ // to.Ptr("ns1-02.azure-dns.com"), // to.Ptr("ns2-02.azure-dns.net"), // to.Ptr("ns3-02.azure-dns.org"), // to.Ptr("ns4-02.azure-dns.info")}, // NumberOfRecordSets: to.Ptr[int64](300), // }, // }}, // } } }
Output:
func (*ZonesClient) NewListPager ¶
func (client *ZonesClient) NewListPager(options *ZonesClientListOptions) *runtime.Pager[ZonesClientListResponse]
NewListPager - Lists the DNS zones in all resource groups in a subscription.
Generated from API version 2023-07-01-preview
- options - ZonesClientListOptions contains the optional parameters for the ZonesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesBySubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) func main() { 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.NewZonesClient().NewListPager(&armdns.ZonesClientListOptions{Top: 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.ZoneListResult = armdns.ZoneListResult{ // Value: []*armdns.Zone{ // { // Name: to.Ptr("zone1"), // Type: to.Ptr("Microsoft.Network/dnsZones"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // }, // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // Properties: &armdns.ZoneProperties{ // MaxNumberOfRecordSets: to.Ptr[int64](5000), // NameServers: []*string{ // to.Ptr("ns1-01.azure-dns.com"), // to.Ptr("ns2-01.azure-dns.net"), // to.Ptr("ns3-01.azure-dns.org"), // to.Ptr("ns4-01.azure-dns.info")}, // NumberOfRecordSets: to.Ptr[int64](2), // }, // }, // { // Name: to.Ptr("zone2"), // Type: to.Ptr("Microsoft.Network/dnsZones"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/dnsZones/zone2"), // Location: to.Ptr("global"), // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // Properties: &armdns.ZoneProperties{ // MaxNumberOfRecordSets: to.Ptr[int64](5000), // NameServers: []*string{ // to.Ptr("ns1-02.azure-dns.com"), // to.Ptr("ns2-02.azure-dns.net"), // to.Ptr("ns3-02.azure-dns.org"), // to.Ptr("ns4-02.azure-dns.info")}, // NumberOfRecordSets: to.Ptr[int64](300), // }, // }}, // } } }
Output:
func (*ZonesClient) Update ¶
func (client *ZonesClient) Update(ctx context.Context, resourceGroupName string, zoneName string, parameters ZoneUpdate, options *ZonesClientUpdateOptions) (ZonesClientUpdateResponse, error)
Update - Updates a DNS zone. Does not modify DNS records within the zone. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- zoneName - The name of the DNS zone (without a terminating dot).
- parameters - Parameters supplied to the Update operation.
- options - ZonesClientUpdateOptions contains the optional parameters for the ZonesClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchZone.json
package main 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" ) func main() { 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.NewZonesClient().Update(ctx, "rg1", "zone1", armdns.ZoneUpdate{ Tags: map[string]*string{ "key2": to.Ptr("value2"), }, }, &armdns.ZonesClientUpdateOptions{IfMatch: 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.Zone = armdns.Zone{ // Name: to.Ptr("zone1"), // Type: to.Ptr("Microsoft.Network/dnsZones"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "key2": to.Ptr("value2"), // }, // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), // Properties: &armdns.ZoneProperties{ // MaxNumberOfRecordSets: to.Ptr[int64](5000), // NameServers: []*string{ // to.Ptr("ns1-01.azure-dns.com"), // to.Ptr("ns2-01.azure-dns.net"), // to.Ptr("ns3-01.azure-dns.org"), // to.Ptr("ns4-01.azure-dns.info")}, // NumberOfRecordSets: to.Ptr[int64](2), // }, // } }
Output:
type ZonesClientBeginDeleteOptions ¶
type ZonesClientBeginDeleteOptions struct { // The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen etag value to prevent // accidentally deleting any concurrent changes. IfMatch *string // Resumes the LRO from the provided token. ResumeToken string }
ZonesClientBeginDeleteOptions contains the optional parameters for the ZonesClient.BeginDelete method.
type ZonesClientCreateOrUpdateOptions ¶
type ZonesClientCreateOrUpdateOptions struct { // The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent // accidentally overwriting any concurrent changes. IfMatch *string // Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. Other values will be ignored. IfNoneMatch *string }
ZonesClientCreateOrUpdateOptions contains the optional parameters for the ZonesClient.CreateOrUpdate method.
type ZonesClientCreateOrUpdateResponse ¶
type ZonesClientCreateOrUpdateResponse struct { // Describes a DNS zone. Zone }
ZonesClientCreateOrUpdateResponse contains the response from method ZonesClient.CreateOrUpdate.
type ZonesClientDeleteResponse ¶
type ZonesClientDeleteResponse struct { }
ZonesClientDeleteResponse contains the response from method ZonesClient.BeginDelete.
type ZonesClientGetOptions ¶
type ZonesClientGetOptions struct { }
ZonesClientGetOptions contains the optional parameters for the ZonesClient.Get method.
type ZonesClientGetResponse ¶
type ZonesClientGetResponse struct { // Describes a DNS zone. Zone }
ZonesClientGetResponse contains the response from method ZonesClient.Get.
type ZonesClientListByResourceGroupOptions ¶
type ZonesClientListByResourceGroupOptions struct { // The maximum number of record sets to return. If not specified, returns up to 100 record sets. Top *int32 }
ZonesClientListByResourceGroupOptions contains the optional parameters for the ZonesClient.NewListByResourceGroupPager method.
type ZonesClientListByResourceGroupResponse ¶
type ZonesClientListByResourceGroupResponse struct { // The response to a Zone List or ListAll operation. ZoneListResult }
ZonesClientListByResourceGroupResponse contains the response from method ZonesClient.NewListByResourceGroupPager.
type ZonesClientListOptions ¶
type ZonesClientListOptions struct { // The maximum number of DNS zones to return. If not specified, returns up to 100 zones. Top *int32 }
ZonesClientListOptions contains the optional parameters for the ZonesClient.NewListPager method.
type ZonesClientListResponse ¶
type ZonesClientListResponse struct { // The response to a Zone List or ListAll operation. ZoneListResult }
ZonesClientListResponse contains the response from method ZonesClient.NewListPager.
type ZonesClientUpdateOptions ¶
type ZonesClientUpdateOptions struct { // The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent // accidentally overwriting any concurrent changes. IfMatch *string }
ZonesClientUpdateOptions contains the optional parameters for the ZonesClient.Update method.
type ZonesClientUpdateResponse ¶
type ZonesClientUpdateResponse struct { // Describes a DNS zone. Zone }
ZonesClientUpdateResponse contains the response from method ZonesClient.Update.