armprivatedns

package module
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 13 Imported by: 43

README

Azure Private DNS Module for Go

PkgGoDev

The armprivatedns module provides operations for working with Azure Private DNS.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Private DNS module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Private DNS. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Private DNS module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armprivatedns.NewClientFactory(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armprivatedns.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewPrivateZonesClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

More sample code

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Private DNS label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

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 added in v1.1.0

func (a ARecord) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ARecord.

func (*ARecord) UnmarshalJSON added in v1.1.0

func (a *ARecord) UnmarshalJSON(data []byte) error

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 added in v1.1.0

func (a AaaaRecord) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AaaaRecord.

func (*AaaaRecord) UnmarshalJSON added in v1.1.0

func (a *AaaaRecord) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AaaaRecord.

type ClientFactory added in v1.1.0

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 added in v1.1.0

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 - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewPrivateZonesClient added in v1.1.0

func (c *ClientFactory) NewPrivateZonesClient() *PrivateZonesClient

NewPrivateZonesClient creates a new instance of PrivateZonesClient.

func (*ClientFactory) NewRecordSetsClient added in v1.1.0

func (c *ClientFactory) NewRecordSetsClient() *RecordSetsClient

NewRecordSetsClient creates a new instance of RecordSetsClient.

func (*ClientFactory) NewVirtualNetworkLinksClient added in v1.1.0

func (c *ClientFactory) NewVirtualNetworkLinksClient() *VirtualNetworkLinksClient

NewVirtualNetworkLinksClient creates a new instance of VirtualNetworkLinksClient.

type CnameRecord

type CnameRecord struct {
	// The canonical name for this CNAME record.
	Cname *string
}

CnameRecord - A CNAME record.

func (CnameRecord) MarshalJSON added in v1.1.0

func (c CnameRecord) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CnameRecord.

func (*CnameRecord) UnmarshalJSON added in v1.1.0

func (c *CnameRecord) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CnameRecord.

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 added in v1.1.0

func (m MxRecord) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MxRecord.

func (*MxRecord) UnmarshalJSON added in v1.1.0

func (m *MxRecord) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MxRecord.

type PrivateZone

type PrivateZone struct {
	// The ETag of the zone.
	Etag *string

	// The Azure Region where the resource lives
	Location *string

	// Properties of the Private DNS zone.
	Properties *PrivateZoneProperties

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource Id for the resource. Example - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateDnsZoneName}'.
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. Example - 'Microsoft.Network/privateDnsZones'.
	Type *string
}

PrivateZone - Describes a Private DNS zone.

func (PrivateZone) MarshalJSON

func (p PrivateZone) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateZone.

func (*PrivateZone) UnmarshalJSON added in v1.1.0

func (p *PrivateZone) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateZone.

type PrivateZoneListResult

type PrivateZoneListResult struct {
	// Information about the Private DNS zones.
	Value []*PrivateZone

	// READ-ONLY; The continuation token for the next page of results.
	NextLink *string
}

PrivateZoneListResult - The response to a Private DNS zone list operation.

func (PrivateZoneListResult) MarshalJSON

func (p PrivateZoneListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateZoneListResult.

func (*PrivateZoneListResult) UnmarshalJSON added in v1.1.0

func (p *PrivateZoneListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateZoneListResult.

type PrivateZoneProperties

type PrivateZoneProperties struct {
	// READ-ONLY; Private zone internal Id
	InternalID *string

	// READ-ONLY; The maximum number of record sets that can be created in this Private 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 virtual networks that can be linked to this Private DNS zone. This is a read-only property
	// and any attempt to set this value will be ignored.
	MaxNumberOfVirtualNetworkLinks *int64

	// READ-ONLY; The maximum number of virtual networks that can be linked to this Private DNS zone with registration enabled.
	// This is a read-only property and any attempt to set this value will be ignored.
	MaxNumberOfVirtualNetworkLinksWithRegistration *int64

	// READ-ONLY; The current number of record sets in this Private DNS zone. This is a read-only property and any attempt to
	// set this value will be ignored.
	NumberOfRecordSets *int64

	// READ-ONLY; The current number of virtual networks that are linked to this Private DNS zone. This is a read-only property
	// and any attempt to set this value will be ignored.
	NumberOfVirtualNetworkLinks *int64

	// READ-ONLY; The current number of virtual networks that are linked to this Private DNS zone with registration enabled. This
	// is a read-only property and any attempt to set this value will be ignored.
	NumberOfVirtualNetworkLinksWithRegistration *int64

	// READ-ONLY; The provisioning state of the resource. This is a read-only property and any attempt to set this value will
	// be ignored.
	ProvisioningState *ProvisioningState
}

PrivateZoneProperties - Represents the properties of the Private DNS zone.

func (PrivateZoneProperties) MarshalJSON added in v1.1.0

func (p PrivateZoneProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateZoneProperties.

func (*PrivateZoneProperties) UnmarshalJSON added in v1.1.0

func (p *PrivateZoneProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateZoneProperties.

type PrivateZonesClient

type PrivateZonesClient struct {
	// contains filtered or unexported fields
}

PrivateZonesClient contains the methods for the PrivateZones group. Don't use this type directly, use NewPrivateZonesClient() instead.

func NewPrivateZonesClient

func NewPrivateZonesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateZonesClient, error)

NewPrivateZonesClient creates a new instance of PrivateZonesClient with the specified values.

  • subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*PrivateZonesClient) BeginCreateOrUpdate

func (client *PrivateZonesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateZoneName string, parameters PrivateZone, options *PrivateZonesClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateZonesClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • privateZoneName - The name of the Private DNS zone (without a terminating dot).
  • parameters - Parameters supplied to the CreateOrUpdate operation.
  • options - PrivateZonesClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateZonesClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/PrivateZonePut.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateZonesClient().BeginCreateOrUpdate(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.PrivateZone{
		Location: to.Ptr("Global"),
		Tags: map[string]*string{
			"key1": to.Ptr("value1"),
		},
	}, &armprivatedns.PrivateZonesClientBeginCreateOrUpdateOptions{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.PrivateZone = armprivatedns.PrivateZone{
	// 	Name: to.Ptr("privatezone1.com"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com"),
	// 	Location: to.Ptr("global"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.PrivateZoneProperties{
	// 		MaxNumberOfRecordSets: to.Ptr[int64](5000),
	// 		MaxNumberOfVirtualNetworkLinks: to.Ptr[int64](100),
	// 		MaxNumberOfVirtualNetworkLinksWithRegistration: to.Ptr[int64](50),
	// 		NumberOfRecordSets: to.Ptr[int64](1),
	// 		NumberOfVirtualNetworkLinks: to.Ptr[int64](0),
	// 		NumberOfVirtualNetworkLinksWithRegistration: to.Ptr[int64](0),
	// 		ProvisioningState: to.Ptr(armprivatedns.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*PrivateZonesClient) BeginDelete

func (client *PrivateZonesClient) BeginDelete(ctx context.Context, resourceGroupName string, privateZoneName string, options *PrivateZonesClientBeginDeleteOptions) (*runtime.Poller[PrivateZonesClientDeleteResponse], error)

BeginDelete - Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • privateZoneName - The name of the Private DNS zone (without a terminating dot).
  • options - PrivateZonesClientBeginDeleteOptions contains the optional parameters for the PrivateZonesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/PrivateZoneDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateZonesClient().BeginDelete(ctx, "resourceGroup1", "privatezone1.com", &armprivatedns.PrivateZonesClientBeginDeleteOptions{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 (*PrivateZonesClient) BeginUpdate

func (client *PrivateZonesClient) BeginUpdate(ctx context.Context, resourceGroupName string, privateZoneName string, parameters PrivateZone, options *PrivateZonesClientBeginUpdateOptions) (*runtime.Poller[PrivateZonesClientUpdateResponse], error)

BeginUpdate - Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • privateZoneName - The name of the Private DNS zone (without a terminating dot).
  • parameters - Parameters supplied to the Update operation.
  • options - PrivateZonesClientBeginUpdateOptions contains the optional parameters for the PrivateZonesClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/PrivateZonePatch.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateZonesClient().BeginUpdate(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.PrivateZone{
		Tags: map[string]*string{
			"key2": to.Ptr("value2"),
		},
	}, &armprivatedns.PrivateZonesClientBeginUpdateOptions{IfMatch: 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.PrivateZone = armprivatedns.PrivateZone{
	// 	Name: to.Ptr("privatezone1.com"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com"),
	// 	Location: to.Ptr("global"),
	// 	Tags: map[string]*string{
	// 		"key2": to.Ptr("value2"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.PrivateZoneProperties{
	// 		MaxNumberOfRecordSets: to.Ptr[int64](5000),
	// 		MaxNumberOfVirtualNetworkLinks: to.Ptr[int64](100),
	// 		MaxNumberOfVirtualNetworkLinksWithRegistration: to.Ptr[int64](50),
	// 		NumberOfRecordSets: to.Ptr[int64](1),
	// 		NumberOfVirtualNetworkLinks: to.Ptr[int64](0),
	// 		NumberOfVirtualNetworkLinksWithRegistration: to.Ptr[int64](0),
	// 		ProvisioningState: to.Ptr(armprivatedns.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*PrivateZonesClient) Get

func (client *PrivateZonesClient) Get(ctx context.Context, resourceGroupName string, privateZoneName string, options *PrivateZonesClientGetOptions) (PrivateZonesClientGetResponse, error)

Get - Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets within the zone. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • privateZoneName - The name of the Private DNS zone (without a terminating dot).
  • options - PrivateZonesClientGetOptions contains the optional parameters for the PrivateZonesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/PrivateZoneGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateZonesClient().Get(ctx, "resourceGroup1", "privatezone1.com", 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.PrivateZone = armprivatedns.PrivateZone{
	// 	Name: to.Ptr("privatezone1.com"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com"),
	// 	Location: to.Ptr("global"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.PrivateZoneProperties{
	// 		MaxNumberOfRecordSets: to.Ptr[int64](5000),
	// 		MaxNumberOfVirtualNetworkLinks: to.Ptr[int64](100),
	// 		MaxNumberOfVirtualNetworkLinksWithRegistration: to.Ptr[int64](50),
	// 		NumberOfRecordSets: to.Ptr[int64](1),
	// 		NumberOfVirtualNetworkLinks: to.Ptr[int64](0),
	// 		NumberOfVirtualNetworkLinksWithRegistration: to.Ptr[int64](0),
	// 		ProvisioningState: to.Ptr(armprivatedns.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*PrivateZonesClient) NewListByResourceGroupPager added in v0.5.0

NewListByResourceGroupPager - Lists the Private DNS zones within a resource group.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • options - PrivateZonesClientListByResourceGroupOptions contains the optional parameters for the PrivateZonesClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/PrivateZoneListInResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPrivateZonesClient().NewListByResourceGroupPager("resourceGroup1", &armprivatedns.PrivateZonesClientListByResourceGroupOptions{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.PrivateZoneListResult = armprivatedns.PrivateZoneListResult{
		// 	Value: []*armprivatedns.PrivateZone{
		// 		{
		// 			Name: to.Ptr("privatezone1.com"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com"),
		// 			Location: to.Ptr("global"),
		// 			Tags: map[string]*string{
		// 				"key1": to.Ptr("value1"),
		// 			},
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.PrivateZoneProperties{
		// 				MaxNumberOfRecordSets: to.Ptr[int64](5000),
		// 				MaxNumberOfVirtualNetworkLinks: to.Ptr[int64](100),
		// 				MaxNumberOfVirtualNetworkLinksWithRegistration: to.Ptr[int64](50),
		// 				NumberOfRecordSets: to.Ptr[int64](1),
		// 				NumberOfVirtualNetworkLinks: to.Ptr[int64](0),
		// 				NumberOfVirtualNetworkLinksWithRegistration: to.Ptr[int64](0),
		// 				ProvisioningState: to.Ptr(armprivatedns.ProvisioningStateSucceeded),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("privatezone2.com"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone2.com"),
		// 			Location: to.Ptr("global"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.PrivateZoneProperties{
		// 				MaxNumberOfRecordSets: to.Ptr[int64](5000),
		// 				MaxNumberOfVirtualNetworkLinks: to.Ptr[int64](100),
		// 				MaxNumberOfVirtualNetworkLinksWithRegistration: to.Ptr[int64](50),
		// 				NumberOfRecordSets: to.Ptr[int64](1),
		// 				NumberOfVirtualNetworkLinks: to.Ptr[int64](0),
		// 				NumberOfVirtualNetworkLinksWithRegistration: to.Ptr[int64](0),
		// 				ProvisioningState: to.Ptr(armprivatedns.ProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*PrivateZonesClient) NewListPager added in v0.5.0

NewListPager - Lists the Private DNS zones in all resource groups in a subscription.

Generated from API version 2024-06-01

  • options - PrivateZonesClientListOptions contains the optional parameters for the PrivateZonesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/PrivateZoneListInSubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPrivateZonesClient().NewListPager(&armprivatedns.PrivateZonesClientListOptions{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.PrivateZoneListResult = armprivatedns.PrivateZoneListResult{
		// 	Value: []*armprivatedns.PrivateZone{
		// 		{
		// 			Name: to.Ptr("privatezone1.com"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com"),
		// 			Location: to.Ptr("global"),
		// 			Tags: map[string]*string{
		// 				"key1": to.Ptr("value1"),
		// 			},
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.PrivateZoneProperties{
		// 				MaxNumberOfRecordSets: to.Ptr[int64](5000),
		// 				MaxNumberOfVirtualNetworkLinks: to.Ptr[int64](100),
		// 				MaxNumberOfVirtualNetworkLinksWithRegistration: to.Ptr[int64](50),
		// 				NumberOfRecordSets: to.Ptr[int64](1),
		// 				NumberOfVirtualNetworkLinks: to.Ptr[int64](0),
		// 				NumberOfVirtualNetworkLinksWithRegistration: to.Ptr[int64](0),
		// 				ProvisioningState: to.Ptr(armprivatedns.ProvisioningStateSucceeded),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("privatezone2.com"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup2/providers/Microsoft.Network/privateDnsZones/privatezone2.com"),
		// 			Location: to.Ptr("global"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.PrivateZoneProperties{
		// 				MaxNumberOfRecordSets: to.Ptr[int64](5000),
		// 				MaxNumberOfVirtualNetworkLinks: to.Ptr[int64](100),
		// 				MaxNumberOfVirtualNetworkLinksWithRegistration: to.Ptr[int64](50),
		// 				NumberOfRecordSets: to.Ptr[int64](1),
		// 				NumberOfVirtualNetworkLinks: to.Ptr[int64](0),
		// 				NumberOfVirtualNetworkLinksWithRegistration: to.Ptr[int64](0),
		// 				ProvisioningState: to.Ptr(armprivatedns.ProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

type PrivateZonesClientBeginCreateOrUpdateOptions added in v0.3.0

type PrivateZonesClientBeginCreateOrUpdateOptions struct {
	// The ETag of the Private 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 Private DNS zone to be created, but to prevent updating an existing zone. Other values will be
	// ignored.
	IfNoneMatch *string

	// Resumes the LRO from the provided token.
	ResumeToken string
}

PrivateZonesClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateZonesClient.BeginCreateOrUpdate method.

type PrivateZonesClientBeginDeleteOptions added in v0.3.0

type PrivateZonesClientBeginDeleteOptions struct {
	// The ETag of the Private 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
}

PrivateZonesClientBeginDeleteOptions contains the optional parameters for the PrivateZonesClient.BeginDelete method.

type PrivateZonesClientBeginUpdateOptions added in v0.3.0

type PrivateZonesClientBeginUpdateOptions struct {
	// The ETag of the Private 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

	// Resumes the LRO from the provided token.
	ResumeToken string
}

PrivateZonesClientBeginUpdateOptions contains the optional parameters for the PrivateZonesClient.BeginUpdate method.

type PrivateZonesClientCreateOrUpdateResponse added in v0.3.0

type PrivateZonesClientCreateOrUpdateResponse struct {
	// Describes a Private DNS zone.
	PrivateZone
}

PrivateZonesClientCreateOrUpdateResponse contains the response from method PrivateZonesClient.BeginCreateOrUpdate.

type PrivateZonesClientDeleteResponse added in v0.3.0

type PrivateZonesClientDeleteResponse struct {
}

PrivateZonesClientDeleteResponse contains the response from method PrivateZonesClient.BeginDelete.

type PrivateZonesClientGetOptions added in v0.3.0

type PrivateZonesClientGetOptions struct {
}

PrivateZonesClientGetOptions contains the optional parameters for the PrivateZonesClient.Get method.

type PrivateZonesClientGetResponse added in v0.3.0

type PrivateZonesClientGetResponse struct {
	// Describes a Private DNS zone.
	PrivateZone
}

PrivateZonesClientGetResponse contains the response from method PrivateZonesClient.Get.

type PrivateZonesClientListByResourceGroupOptions added in v0.3.0

type PrivateZonesClientListByResourceGroupOptions struct {
	// The maximum number of record sets to return. If not specified, returns up to 100 record sets.
	Top *int32
}

PrivateZonesClientListByResourceGroupOptions contains the optional parameters for the PrivateZonesClient.NewListByResourceGroupPager method.

type PrivateZonesClientListByResourceGroupResponse added in v0.3.0

type PrivateZonesClientListByResourceGroupResponse struct {
	// The response to a Private DNS zone list operation.
	PrivateZoneListResult
}

PrivateZonesClientListByResourceGroupResponse contains the response from method PrivateZonesClient.NewListByResourceGroupPager.

type PrivateZonesClientListOptions added in v0.3.0

type PrivateZonesClientListOptions struct {
	// The maximum number of Private DNS zones to return. If not specified, returns up to 100 zones.
	Top *int32
}

PrivateZonesClientListOptions contains the optional parameters for the PrivateZonesClient.NewListPager method.

type PrivateZonesClientListResponse added in v0.3.0

type PrivateZonesClientListResponse struct {
	// The response to a Private DNS zone list operation.
	PrivateZoneListResult
}

PrivateZonesClientListResponse contains the response from method PrivateZonesClient.NewListPager.

type PrivateZonesClientUpdateResponse added in v0.3.0

type PrivateZonesClientUpdateResponse struct {
	// Describes a Private DNS zone.
	PrivateZone
}

PrivateZonesClientUpdateResponse contains the response from method PrivateZonesClient.BeginUpdate.

type ProvisioningState

type ProvisioningState string

ProvisioningState - The provisioning state of the resource. This is a read-only property and any attempt to set this value will be ignored.

const (
	ProvisioningStateCanceled  ProvisioningState = "Canceled"
	ProvisioningStateCreating  ProvisioningState = "Creating"
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type ProxyResource

type ProxyResource struct {
	// READ-ONLY; Fully qualified resource Id for the resource. Example - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateDnsZoneName}'.
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. Example - 'Microsoft.Network/privateDnsZones'.
	Type *string
}

ProxyResource - The resource model definition for an ARM proxy resource.

func (ProxyResource) MarshalJSON added in v1.1.0

func (p ProxyResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ProxyResource.

func (*ProxyResource) UnmarshalJSON added in v1.1.0

func (p *ProxyResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.

type PtrRecord

type PtrRecord struct {
	// The PTR target domain name for this PTR record.
	Ptrdname *string
}

PtrRecord - A PTR record.

func (PtrRecord) MarshalJSON added in v1.1.0

func (p PtrRecord) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PtrRecord.

func (*PtrRecord) UnmarshalJSON added in v1.1.0

func (p *PtrRecord) UnmarshalJSON(data []byte) error

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; Fully qualified resource Id for the resource. Example - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateDnsZoneName}'.
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. Example - 'Microsoft.Network/privateDnsZones'.
	Type *string
}

RecordSet - Describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS zone.

func (RecordSet) MarshalJSON

func (r RecordSet) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RecordSet.

func (*RecordSet) UnmarshalJSON added in v1.1.0

func (r *RecordSet) UnmarshalJSON(data []byte) error

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 added in v1.1.0

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 CNAME record in the record set.
	CnameRecord *CnameRecord

	// 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 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

	// 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; Is the record set auto-registered in the Private DNS zone through a virtual network link?
	IsAutoRegistered *bool
}

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 added in v1.1.0

func (r *RecordSetProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RecordSetProperties.

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 - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • 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, privateZoneName string, recordType RecordType, relativeRecordSetName string, parameters RecordSet, options *RecordSetsClientCreateOrUpdateOptions) (RecordSetsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates a record set within a Private DNS zone. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • privateZoneName - The name of the Private DNS zone (without a terminating dot).
  • recordType - The type of DNS record in this record set. Record sets of type SOA can be updated but not created (they are created when the Private DNS zone is created).
  • relativeRecordSetName - The name of the record set, relative to the name of the zone.
  • parameters - Parameters supplied to the CreateOrUpdate operation.
  • options - RecordSetsClientCreateOrUpdateOptions contains the optional parameters for the RecordSetsClient.CreateOrUpdate method.
Example (PutPrivateDnsZoneARecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetAPut.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeA, "recordA", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			ARecords: []*armprivatedns.ARecord{
				{
					IPv4Address: to.Ptr("1.2.3.4"),
				}},
			Metadata: map[string]*string{
				"key1": to.Ptr("value1"),
			},
			TTL: to.Ptr[int64](3600),
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recorda"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/A"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/A/recorda"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		ARecords: []*armprivatedns.ARecord{
	// 			{
	// 				IPv4Address: to.Ptr("1.2.3.4"),
	// 		}},
	// 		Fqdn: to.Ptr("recorda.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		TTL: to.Ptr[int64](3600),
	// 	},
	// }
}
Output:

Example (PutPrivateDnsZoneAaaaRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetAAAAPut.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeAAAA, "recordAAAA", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			AaaaRecords: []*armprivatedns.AaaaRecord{
				{
					IPv6Address: to.Ptr("::1"),
				}},
			Metadata: map[string]*string{
				"key1": to.Ptr("value1"),
			},
			TTL: to.Ptr[int64](3600),
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recordaaaa"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/AAAA"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/AAAA/recordaaaa"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		AaaaRecords: []*armprivatedns.AaaaRecord{
	// 			{
	// 				IPv6Address: to.Ptr("::1"),
	// 		}},
	// 		Fqdn: to.Ptr("recordaaaa.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		TTL: to.Ptr[int64](3600),
	// 	},
	// }
}
Output:

Example (PutPrivateDnsZoneCnameRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetCNAMEPut.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeCNAME, "recordCNAME", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			CnameRecord: &armprivatedns.CnameRecord{
				Cname: to.Ptr("contoso.com"),
			},
			Metadata: map[string]*string{
				"key1": to.Ptr("value1"),
			},
			TTL: to.Ptr[int64](3600),
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recordcname"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/CNAME"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/CNAME/recordcname"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		CnameRecord: &armprivatedns.CnameRecord{
	// 			Cname: to.Ptr("contoso.com"),
	// 		},
	// 		Fqdn: to.Ptr("recordcname.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		TTL: to.Ptr[int64](3600),
	// 	},
	// }
}
Output:

Example (PutPrivateDnsZoneMxRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetMXPut.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeMX, "recordMX", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			Metadata: map[string]*string{
				"key1": to.Ptr("value1"),
			},
			MxRecords: []*armprivatedns.MxRecord{
				{
					Exchange:   to.Ptr("mail.privatezone1.com"),
					Preference: to.Ptr[int32](0),
				}},
			TTL: to.Ptr[int64](3600),
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recordmx"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/MX"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/MX/recordmx"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		Fqdn: to.Ptr("recordmx.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		MxRecords: []*armprivatedns.MxRecord{
	// 			{
	// 				Exchange: to.Ptr("mail.privatezone1.com"),
	// 				Preference: to.Ptr[int32](0),
	// 		}},
	// 		TTL: to.Ptr[int64](3600),
	// 	},
	// }
}
Output:

Example (PutPrivateDnsZonePtrRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetPTRPut.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "resourceGroup1", "0.0.127.in-addr.arpa", armprivatedns.RecordTypePTR, "1", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			Metadata: map[string]*string{
				"key1": to.Ptr("value1"),
			},
			PtrRecords: []*armprivatedns.PtrRecord{
				{
					Ptrdname: to.Ptr("localhost"),
				}},
			TTL: to.Ptr[int64](3600),
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("1"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/PTR"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/0.0.127.in-addr.arpa/PTR/1"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		Fqdn: to.Ptr("1.0.0.127.in-addr.arpa."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		PtrRecords: []*armprivatedns.PtrRecord{
	// 			{
	// 				Ptrdname: to.Ptr("localhost"),
	// 		}},
	// 		TTL: to.Ptr[int64](3600),
	// 	},
	// }
}
Output:

Example (PutPrivateDnsZoneSoaRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetSOAPut.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeSOA, "@", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			Metadata: map[string]*string{
				"key1": to.Ptr("value1"),
			},
			SoaRecord: &armprivatedns.SoaRecord{
				Email:        to.Ptr("azureprivatedns-hostmaster.microsoft.com"),
				ExpireTime:   to.Ptr[int64](2419200),
				Host:         to.Ptr("azureprivatedns.net"),
				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),
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("@"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/SOA"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/SOA/@"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		Fqdn: to.Ptr("privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		SoaRecord: &armprivatedns.SoaRecord{
	// 			Email: to.Ptr("azureprivatedns-hostmaster.microsoft.com"),
	// 			ExpireTime: to.Ptr[int64](2419200),
	// 			Host: to.Ptr("azureprivatedns.net"),
	// 			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),
	// 	},
	// }
}
Output:

Example (PutPrivateDnsZoneSrvRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetSRVPut.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeSRV, "recordSRV", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			Metadata: map[string]*string{
				"key1": to.Ptr("value1"),
			},
			SrvRecords: []*armprivatedns.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),
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recordsrv"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/SRV"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/SRV/recordsrv"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		Fqdn: to.Ptr("recordsrv.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		SrvRecords: []*armprivatedns.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),
	// 	},
	// }
}
Output:

Example (PutPrivateDnsZoneTxtRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetTXTPut.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeTXT, "recordTXT", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			Metadata: map[string]*string{
				"key1": to.Ptr("value1"),
			},
			TTL: to.Ptr[int64](3600),
			TxtRecords: []*armprivatedns.TxtRecord{
				{
					Value: []*string{
						to.Ptr("string1"),
						to.Ptr("string2")},
				}},
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recordtxt"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/TXT"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/TXT/recordtxt"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		Fqdn: to.Ptr("recordtxt.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		TTL: to.Ptr[int64](3600),
	// 		TxtRecords: []*armprivatedns.TxtRecord{
	// 			{
	// 				Value: []*string{
	// 					to.Ptr("string1"),
	// 					to.Ptr("string2")},
	// 			}},
	// 		},
	// 	}
}
Output:

func (*RecordSetsClient) Delete

func (client *RecordSetsClient) Delete(ctx context.Context, resourceGroupName string, privateZoneName string, recordType RecordType, relativeRecordSetName string, options *RecordSetsClientDeleteOptions) (RecordSetsClientDeleteResponse, error)

Delete - Deletes a record set from a Private DNS zone. This operation cannot be undone. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • privateZoneName - The name of the Private DNS zone (without a terminating dot).
  • recordType - The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the Private DNS zone is deleted).
  • relativeRecordSetName - The name of the record set, relative to the name of the zone.
  • options - RecordSetsClientDeleteOptions contains the optional parameters for the RecordSetsClient.Delete method.
Example (DeletePrivateDnsZoneARecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetADelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewRecordSetsClient().Delete(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeA, "recordA", &armprivatedns.RecordSetsClientDeleteOptions{IfMatch: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

Example (DeletePrivateDnsZoneAaaaRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetAAAADelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewRecordSetsClient().Delete(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeAAAA, "recordAAAA", &armprivatedns.RecordSetsClientDeleteOptions{IfMatch: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

Example (DeletePrivateDnsZoneCnameRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetCNAMEDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewRecordSetsClient().Delete(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeCNAME, "recordCNAME", &armprivatedns.RecordSetsClientDeleteOptions{IfMatch: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

Example (DeletePrivateDnsZoneMxRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetMXDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewRecordSetsClient().Delete(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeMX, "recordMX", &armprivatedns.RecordSetsClientDeleteOptions{IfMatch: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

Example (DeletePrivateDnsZonePtrRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetPTRDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewRecordSetsClient().Delete(ctx, "resourceGroup1", "0.0.127.in-addr.arpa", armprivatedns.RecordTypePTR, "1", &armprivatedns.RecordSetsClientDeleteOptions{IfMatch: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

Example (DeletePrivateDnsZoneSrvRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetSRVDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewRecordSetsClient().Delete(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeSRV, "recordSRV", &armprivatedns.RecordSetsClientDeleteOptions{IfMatch: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

Example (DeletePrivateDnsZoneTxtRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetTXTDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewRecordSetsClient().Delete(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeTXT, "recordTXT", &armprivatedns.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, privateZoneName string, recordType RecordType, relativeRecordSetName string, options *RecordSetsClientGetOptions) (RecordSetsClientGetResponse, error)

Get - Gets a record set. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • privateZoneName - The name of the Private DNS zone (without a terminating dot).
  • recordType - The type of DNS record in this record set.
  • relativeRecordSetName - The name of the record set, relative to the name of the zone.
  • options - RecordSetsClientGetOptions contains the optional parameters for the RecordSetsClient.Get method.
Example (GetPrivateDnsZoneARecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetAGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Get(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeA, "recordA", 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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recorda"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/A"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/A/recorda"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		ARecords: []*armprivatedns.ARecord{
	// 			{
	// 				IPv4Address: to.Ptr("1.2.3.4"),
	// 		}},
	// 		Fqdn: to.Ptr("recorda.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		TTL: to.Ptr[int64](3600),
	// 	},
	// }
}
Output:

Example (GetPrivateDnsZoneAaaaRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetAAAAGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Get(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeAAAA, "recordAAAA", 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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recordaaaa"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/AAAA"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/AAAA/recordaaaa"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		AaaaRecords: []*armprivatedns.AaaaRecord{
	// 			{
	// 				IPv6Address: to.Ptr("::1"),
	// 		}},
	// 		Fqdn: to.Ptr("recordaaaa.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		TTL: to.Ptr[int64](3600),
	// 	},
	// }
}
Output:

Example (GetPrivateDnsZoneCnameRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetCNAMEGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Get(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeCNAME, "recordCNAME", 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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recordcname"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/CNAME"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/CNAME/recordcname"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		CnameRecord: &armprivatedns.CnameRecord{
	// 			Cname: to.Ptr("contoso.com"),
	// 		},
	// 		Fqdn: to.Ptr("recordcname.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		TTL: to.Ptr[int64](3600),
	// 	},
	// }
}
Output:

Example (GetPrivateDnsZoneMxRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetMXGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Get(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeMX, "recordMX", 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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recordmx"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/MX"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/MX/recordmx"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		Fqdn: to.Ptr("recordmx.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		MxRecords: []*armprivatedns.MxRecord{
	// 			{
	// 				Exchange: to.Ptr("mail.privatezone1.com"),
	// 				Preference: to.Ptr[int32](0),
	// 		}},
	// 		TTL: to.Ptr[int64](3600),
	// 	},
	// }
}
Output:

Example (GetPrivateDnsZonePtrRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetPTRGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Get(ctx, "resourceGroup1", "0.0.127.in-addr.arpa", armprivatedns.RecordTypePTR, "1", 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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("1"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/PTR"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/0.0.127.in-addr.arpa/PTR/1"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		Fqdn: to.Ptr("1.0.0.127.in-addr.arpa."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		PtrRecords: []*armprivatedns.PtrRecord{
	// 			{
	// 				Ptrdname: to.Ptr("localhost"),
	// 		}},
	// 		TTL: to.Ptr[int64](3600),
	// 	},
	// }
}
Output:

Example (GetPrivateDnsZoneSoaRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetSOAGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Get(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("@"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/SOA"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/SOA/@"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		Fqdn: to.Ptr("privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		SoaRecord: &armprivatedns.SoaRecord{
	// 			Email: to.Ptr("azureprivatedns-hostmaster.microsoft.com"),
	// 			ExpireTime: to.Ptr[int64](2419200),
	// 			Host: to.Ptr("azureprivatedns.net"),
	// 			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),
	// 	},
	// }
}
Output:

Example (GetPrivateDnsZoneSrvRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetSRVGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Get(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeSRV, "recordSRV", 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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recordsrv"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/SRV"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/SRV/recordsrv"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		Fqdn: to.Ptr("recordsrv.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		SrvRecords: []*armprivatedns.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),
	// 	},
	// }
}
Output:

Example (GetPrivateDnsZoneTxtRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetTXTGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Get(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeTXT, "recordTXT", 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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recordtxt"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/TXT"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/TXT/recordtxt"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		Fqdn: to.Ptr("recordtxt.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		TTL: to.Ptr[int64](3600),
	// 		TxtRecords: []*armprivatedns.TxtRecord{
	// 			{
	// 				Value: []*string{
	// 					to.Ptr("string1"),
	// 					to.Ptr("string2")},
	// 			}},
	// 		},
	// 	}
}
Output:

func (*RecordSetsClient) NewListByTypePager added in v0.5.0

func (client *RecordSetsClient) NewListByTypePager(resourceGroupName string, privateZoneName string, recordType RecordType, options *RecordSetsClientListByTypeOptions) *runtime.Pager[RecordSetsClientListByTypeResponse]

NewListByTypePager - Lists the record sets of a specified type in a Private DNS zone.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • privateZoneName - The name of the Private DNS zone (without a terminating dot).
  • recordType - The type of record sets to enumerate.
  • options - RecordSetsClientListByTypeOptions contains the optional parameters for the RecordSetsClient.NewListByTypePager method.
Example (GetPrivateDnsZoneARecordSets)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetAList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRecordSetsClient().NewListByTypePager("resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeA, &armprivatedns.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 = armprivatedns.RecordSetListResult{
		// 	Value: []*armprivatedns.RecordSet{
		// 		{
		// 			Name: to.Ptr("recorda1"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/A"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/A/recorda1"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.RecordSetProperties{
		// 				ARecords: []*armprivatedns.ARecord{
		// 					{
		// 						IPv4Address: to.Ptr("1.2.3.4"),
		// 				}},
		// 				Fqdn: to.Ptr("recorda1.privatezone1.com."),
		// 				IsAutoRegistered: to.Ptr(false),
		// 				Metadata: map[string]*string{
		// 					"key1": to.Ptr("value1"),
		// 				},
		// 				TTL: to.Ptr[int64](3600),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("recorda2"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/A"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/A/recorda2"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.RecordSetProperties{
		// 				ARecords: []*armprivatedns.ARecord{
		// 					{
		// 						IPv4Address: to.Ptr("5.6.7.8"),
		// 				}},
		// 				Fqdn: to.Ptr("recorda2.privatezone1.com."),
		// 				IsAutoRegistered: to.Ptr(false),
		// 				TTL: to.Ptr[int64](3600),
		// 			},
		// 	}},
		// }
	}
}
Output:

Example (GetPrivateDnsZoneAaaaRecordSets)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetAAAAList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRecordSetsClient().NewListByTypePager("resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeAAAA, &armprivatedns.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 = armprivatedns.RecordSetListResult{
		// 	Value: []*armprivatedns.RecordSet{
		// 		{
		// 			Name: to.Ptr("recordaaaa1"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/AAAA"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/AAAA/recordaaaa1"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.RecordSetProperties{
		// 				AaaaRecords: []*armprivatedns.AaaaRecord{
		// 					{
		// 						IPv6Address: to.Ptr("::1"),
		// 				}},
		// 				Fqdn: to.Ptr("recordaaaa1.privatezone1.com."),
		// 				IsAutoRegistered: to.Ptr(false),
		// 				Metadata: map[string]*string{
		// 					"key1": to.Ptr("value1"),
		// 				},
		// 				TTL: to.Ptr[int64](3600),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("recordaaaa2"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/AAAA"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/AAAA/recordaaaa2"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.RecordSetProperties{
		// 				AaaaRecords: []*armprivatedns.AaaaRecord{
		// 					{
		// 						IPv6Address: to.Ptr("::1"),
		// 				}},
		// 				Fqdn: to.Ptr("recordaaaa2.privatezone1.com."),
		// 				IsAutoRegistered: to.Ptr(false),
		// 				TTL: to.Ptr[int64](3600),
		// 			},
		// 	}},
		// }
	}
}
Output:

Example (GetPrivateDnsZoneCnameRecordSets)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetCNAMEList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRecordSetsClient().NewListByTypePager("resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeCNAME, &armprivatedns.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 = armprivatedns.RecordSetListResult{
		// 	Value: []*armprivatedns.RecordSet{
		// 		{
		// 			Name: to.Ptr("recordcname"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/CNAME"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/CNAME/recordcname"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.RecordSetProperties{
		// 				CnameRecord: &armprivatedns.CnameRecord{
		// 					Cname: to.Ptr("contoso.com"),
		// 				},
		// 				Fqdn: to.Ptr("recordcname.privatezone1.com."),
		// 				IsAutoRegistered: to.Ptr(false),
		// 				Metadata: map[string]*string{
		// 					"key1": to.Ptr("value1"),
		// 				},
		// 				TTL: to.Ptr[int64](3600),
		// 			},
		// 	}},
		// }
	}
}
Output:

Example (GetPrivateDnsZoneMxRecordSets)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetMXList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRecordSetsClient().NewListByTypePager("resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeMX, &armprivatedns.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 = armprivatedns.RecordSetListResult{
		// 	Value: []*armprivatedns.RecordSet{
		// 		{
		// 			Name: to.Ptr("recordmx1"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/MX"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/MX/recordmx1"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.RecordSetProperties{
		// 				Fqdn: to.Ptr("recordmx1.privatezone1.com."),
		// 				IsAutoRegistered: to.Ptr(false),
		// 				Metadata: map[string]*string{
		// 					"key1": to.Ptr("value1"),
		// 				},
		// 				MxRecords: []*armprivatedns.MxRecord{
		// 					{
		// 						Exchange: to.Ptr("mail.contoso1.com"),
		// 						Preference: to.Ptr[int32](0),
		// 				}},
		// 				TTL: to.Ptr[int64](3600),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("recordmx2"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/MX"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/MX/recordmx2"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.RecordSetProperties{
		// 				Fqdn: to.Ptr("recordmx2.privatezone1.com."),
		// 				IsAutoRegistered: to.Ptr(false),
		// 				MxRecords: []*armprivatedns.MxRecord{
		// 					{
		// 						Exchange: to.Ptr("mail.contoso2.com"),
		// 						Preference: to.Ptr[int32](0),
		// 				}},
		// 				TTL: to.Ptr[int64](3600),
		// 			},
		// 	}},
		// }
	}
}
Output:

Example (GetPrivateDnsZonePtrRecordSets)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetPTRList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRecordSetsClient().NewListByTypePager("resourceGroup1", "0.0.127.in-addr.arpa", armprivatedns.RecordTypePTR, &armprivatedns.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 = armprivatedns.RecordSetListResult{
		// 	Value: []*armprivatedns.RecordSet{
		// 		{
		// 			Name: to.Ptr("1"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/PTR"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/0.0.127.in-addr.arpa/PTR/1"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.RecordSetProperties{
		// 				Fqdn: to.Ptr("1.0.0.127.in-addr.arpa."),
		// 				IsAutoRegistered: to.Ptr(false),
		// 				Metadata: map[string]*string{
		// 					"key1": to.Ptr("value1"),
		// 				},
		// 				PtrRecords: []*armprivatedns.PtrRecord{
		// 					{
		// 						Ptrdname: to.Ptr("localhost"),
		// 				}},
		// 				TTL: to.Ptr[int64](3600),
		// 			},
		// 	}},
		// }
	}
}
Output:

Example (GetPrivateDnsZoneSoaRecordSets)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetSOAList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRecordSetsClient().NewListByTypePager("resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeSOA, &armprivatedns.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 = armprivatedns.RecordSetListResult{
		// 	Value: []*armprivatedns.RecordSet{
		// 		{
		// 			Name: to.Ptr("@"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/SOA"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/SOA/@"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.RecordSetProperties{
		// 				Fqdn: to.Ptr("privatezone1.com."),
		// 				IsAutoRegistered: to.Ptr(false),
		// 				Metadata: map[string]*string{
		// 					"key1": to.Ptr("value1"),
		// 				},
		// 				SoaRecord: &armprivatedns.SoaRecord{
		// 					Email: to.Ptr("azureprivatedns-hostmaster.microsoft.com"),
		// 					ExpireTime: to.Ptr[int64](2419200),
		// 					Host: to.Ptr("azureprivatedns.net"),
		// 					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),
		// 			},
		// 	}},
		// }
	}
}
Output:

Example (GetPrivateDnsZoneSrvRecordSets)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetSRVList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRecordSetsClient().NewListByTypePager("resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeSRV, &armprivatedns.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 = armprivatedns.RecordSetListResult{
		// 	Value: []*armprivatedns.RecordSet{
		// 		{
		// 			Name: to.Ptr("recordsrv"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/SRV"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/SRV/recordsrv"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.RecordSetProperties{
		// 				Fqdn: to.Ptr("recordsrv.privatezone1.com."),
		// 				IsAutoRegistered: to.Ptr(false),
		// 				Metadata: map[string]*string{
		// 					"key1": to.Ptr("value1"),
		// 				},
		// 				SrvRecords: []*armprivatedns.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),
		// 			},
		// 	}},
		// }
	}
}
Output:

Example (GetPrivateDnsZoneTxtRecordSets)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetTXTList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRecordSetsClient().NewListByTypePager("resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeTXT, &armprivatedns.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 = armprivatedns.RecordSetListResult{
		// 	Value: []*armprivatedns.RecordSet{
		// 		{
		// 			Name: to.Ptr("recordtxt"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/TXT"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/TXT/recordtxt"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.RecordSetProperties{
		// 				Fqdn: to.Ptr("recordtxt.privatezone1.com."),
		// 				IsAutoRegistered: to.Ptr(false),
		// 				Metadata: map[string]*string{
		// 					"key1": to.Ptr("value1"),
		// 				},
		// 				TTL: to.Ptr[int64](3600),
		// 				TxtRecords: []*armprivatedns.TxtRecord{
		// 					{
		// 						Value: []*string{
		// 							to.Ptr("string1"),
		// 							to.Ptr("string2")},
		// 					}},
		// 				},
		// 		}},
		// 	}
	}
}
Output:

func (*RecordSetsClient) NewListPager added in v0.5.0

func (client *RecordSetsClient) NewListPager(resourceGroupName string, privateZoneName string, options *RecordSetsClientListOptions) *runtime.Pager[RecordSetsClientListResponse]

NewListPager - Lists all record sets in a Private DNS zone.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • privateZoneName - The name of the Private DNS zone (without a terminating dot).
  • options - RecordSetsClientListOptions contains the optional parameters for the RecordSetsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetALLList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRecordSetsClient().NewListPager("resourceGroup1", "privatezone1.com", &armprivatedns.RecordSetsClientListOptions{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 = armprivatedns.RecordSetListResult{
		// 	Value: []*armprivatedns.RecordSet{
		// 		{
		// 			Name: to.Ptr("recorda"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/A"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/A/recorda"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.RecordSetProperties{
		// 				ARecords: []*armprivatedns.ARecord{
		// 					{
		// 						IPv4Address: to.Ptr("1.2.3.4"),
		// 				}},
		// 				Fqdn: to.Ptr("recorda.privatezone1.com."),
		// 				IsAutoRegistered: to.Ptr(false),
		// 				Metadata: map[string]*string{
		// 					"key1": to.Ptr("value1"),
		// 				},
		// 				TTL: to.Ptr[int64](3600),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("recordcname"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/CNAME"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/CNAME/recordcname"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.RecordSetProperties{
		// 				CnameRecord: &armprivatedns.CnameRecord{
		// 					Cname: to.Ptr("contoso.com"),
		// 				},
		// 				Fqdn: to.Ptr("recordcname.privatezone1.com."),
		// 				IsAutoRegistered: to.Ptr(false),
		// 				Metadata: map[string]*string{
		// 					"key1": to.Ptr("value1"),
		// 				},
		// 				TTL: to.Ptr[int64](3600),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("recordmx"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/MX"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/MX/recordmx"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.RecordSetProperties{
		// 				Fqdn: to.Ptr("recordmx.privatezone1.com."),
		// 				IsAutoRegistered: to.Ptr(false),
		// 				Metadata: map[string]*string{
		// 					"key1": to.Ptr("value1"),
		// 				},
		// 				MxRecords: []*armprivatedns.MxRecord{
		// 					{
		// 						Exchange: to.Ptr("mail.contoso1.com"),
		// 						Preference: to.Ptr[int32](0),
		// 				}},
		// 				TTL: to.Ptr[int64](3600),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*RecordSetsClient) Update

func (client *RecordSetsClient) Update(ctx context.Context, resourceGroupName string, privateZoneName string, recordType RecordType, relativeRecordSetName string, parameters RecordSet, options *RecordSetsClientUpdateOptions) (RecordSetsClientUpdateResponse, error)

Update - Updates a record set within a Private DNS zone. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • privateZoneName - The name of the Private DNS zone (without a terminating dot).
  • recordType - The type of DNS record in this record set.
  • relativeRecordSetName - The name of the record set, relative to the name of the zone.
  • parameters - Parameters supplied to the Update operation.
  • options - RecordSetsClientUpdateOptions contains the optional parameters for the RecordSetsClient.Update method.
Example (PatchPrivateDnsZoneARecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetAPatch.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Update(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeA, "recordA", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			Metadata: map[string]*string{
				"key2": to.Ptr("value2"),
			},
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recorda"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/A"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/A/recorda"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		ARecords: []*armprivatedns.ARecord{
	// 			{
	// 				IPv4Address: to.Ptr("1.2.3.4"),
	// 		}},
	// 		Fqdn: to.Ptr("recorda.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key2": to.Ptr("value2"),
	// 		},
	// 		TTL: to.Ptr[int64](3600),
	// 	},
	// }
}
Output:

Example (PatchPrivateDnsZoneAaaaRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetAAAAPatch.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Update(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeAAAA, "recordAAAA", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			Metadata: map[string]*string{
				"key2": to.Ptr("value2"),
			},
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recordaaaa"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/AAAA"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/AAAA/recordaaaa"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		AaaaRecords: []*armprivatedns.AaaaRecord{
	// 			{
	// 				IPv6Address: to.Ptr("::1"),
	// 		}},
	// 		Fqdn: to.Ptr("recordaaaa.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key2": to.Ptr("value2"),
	// 		},
	// 		TTL: to.Ptr[int64](3600),
	// 	},
	// }
}
Output:

Example (PatchPrivateDnsZoneCnameRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetCNAMEPatch.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Update(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeCNAME, "recordCNAME", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			Metadata: map[string]*string{
				"key2": to.Ptr("value2"),
			},
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recordcname"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/CNAME"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/CNAME/recordcname"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		CnameRecord: &armprivatedns.CnameRecord{
	// 			Cname: to.Ptr("contoso.com"),
	// 		},
	// 		Fqdn: to.Ptr("recordcname.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key2": to.Ptr("value2"),
	// 		},
	// 		TTL: to.Ptr[int64](3600),
	// 	},
	// }
}
Output:

Example (PatchPrivateDnsZoneMxRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetMXPatch.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Update(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeMX, "recordMX", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			Metadata: map[string]*string{
				"key2": to.Ptr("value2"),
			},
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recordmx"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/MX"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/MX/recordmx"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		Fqdn: to.Ptr("recordmx.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key2": to.Ptr("value2"),
	// 		},
	// 		MxRecords: []*armprivatedns.MxRecord{
	// 			{
	// 				Exchange: to.Ptr("mail.privatezone1.com"),
	// 				Preference: to.Ptr[int32](0),
	// 		}},
	// 		TTL: to.Ptr[int64](3600),
	// 	},
	// }
}
Output:

Example (PatchPrivateDnsZonePtrRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetPTRPatch.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Update(ctx, "resourceGroup1", "0.0.127.in-addr.arpa", armprivatedns.RecordTypePTR, "1", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			Metadata: map[string]*string{
				"key2": to.Ptr("value2"),
			},
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("1"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/PTR"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/0.0.127.in-addr.arpa/PTR/1"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		Fqdn: to.Ptr("1.0.0.127.in-addr.arpa."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key2": to.Ptr("value2"),
	// 		},
	// 		PtrRecords: []*armprivatedns.PtrRecord{
	// 			{
	// 				Ptrdname: to.Ptr("localhost"),
	// 		}},
	// 		TTL: to.Ptr[int64](3600),
	// 	},
	// }
}
Output:

Example (PatchPrivateDnsZoneSoaRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetSOAPatch.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Update(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeSOA, "@", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			Metadata: map[string]*string{
				"key2": to.Ptr("value2"),
			},
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("@"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/SOA"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/SOA/@"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		Fqdn: to.Ptr("privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key2": to.Ptr("value2"),
	// 		},
	// 		SoaRecord: &armprivatedns.SoaRecord{
	// 			Email: to.Ptr("azureprivatedns-hostmaster.microsoft.com"),
	// 			ExpireTime: to.Ptr[int64](2419200),
	// 			Host: to.Ptr("azureprivatedns.net"),
	// 			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),
	// 	},
	// }
}
Output:

Example (PatchPrivateDnsZoneSrvRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetSRVPatch.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Update(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeSRV, "recordSRV", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			Metadata: map[string]*string{
				"key2": to.Ptr("value2"),
			},
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recordsrv"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/SRV"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/SRV/recordsrv"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		Fqdn: to.Ptr("recordsrv.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key2": to.Ptr("value2"),
	// 		},
	// 		SrvRecords: []*armprivatedns.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),
	// 	},
	// }
}
Output:

Example (PatchPrivateDnsZoneTxtRecordSet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/RecordSetTXTPatch.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecordSetsClient().Update(ctx, "resourceGroup1", "privatezone1.com", armprivatedns.RecordTypeTXT, "recordTXT", armprivatedns.RecordSet{
		Properties: &armprivatedns.RecordSetProperties{
			Metadata: map[string]*string{
				"key2": to.Ptr("value2"),
			},
		},
	}, &armprivatedns.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 = armprivatedns.RecordSet{
	// 	Name: to.Ptr("recordtxt"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/TXT"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/TXT/recordtxt"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.RecordSetProperties{
	// 		Fqdn: to.Ptr("recordtxt.privatezone1.com."),
	// 		IsAutoRegistered: to.Ptr(false),
	// 		Metadata: map[string]*string{
	// 			"key2": to.Ptr("value2"),
	// 		},
	// 		TTL: to.Ptr[int64](3600),
	// 		TxtRecords: []*armprivatedns.TxtRecord{
	// 			{
	// 				Value: []*string{
	// 					to.Ptr("string1"),
	// 					to.Ptr("string2")},
	// 			}},
	// 		},
	// 	}
}
Output:

type RecordSetsClientCreateOrUpdateOptions added in v0.3.0

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 added in v0.3.0

type RecordSetsClientCreateOrUpdateResponse struct {
	// Describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS zone.
	RecordSet
}

RecordSetsClientCreateOrUpdateResponse contains the response from method RecordSetsClient.CreateOrUpdate.

type RecordSetsClientDeleteOptions added in v0.3.0

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 added in v0.3.0

type RecordSetsClientDeleteResponse struct {
}

RecordSetsClientDeleteResponse contains the response from method RecordSetsClient.Delete.

type RecordSetsClientGetOptions added in v0.3.0

type RecordSetsClientGetOptions struct {
}

RecordSetsClientGetOptions contains the optional parameters for the RecordSetsClient.Get method.

type RecordSetsClientGetResponse added in v0.3.0

type RecordSetsClientGetResponse struct {
	// Describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS zone.
	RecordSet
}

RecordSetsClientGetResponse contains the response from method RecordSetsClient.Get.

type RecordSetsClientListByTypeOptions added in v0.3.0

type RecordSetsClientListByTypeOptions struct {
	// The suffix label of the record set name to be used to filter the record set enumeration. If this parameter is specified,
	// the returned enumeration will only contain 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 added in v0.3.0

type RecordSetsClientListByTypeResponse struct {
	// The response to a record set list operation.
	RecordSetListResult
}

RecordSetsClientListByTypeResponse contains the response from method RecordSetsClient.NewListByTypePager.

type RecordSetsClientListOptions added in v0.3.0

type RecordSetsClientListOptions struct {
	// The suffix label of the record set name to be used to filter the record set enumeration. If this parameter is specified,
	// the returned enumeration will only contain 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
}

RecordSetsClientListOptions contains the optional parameters for the RecordSetsClient.NewListPager method.

type RecordSetsClientListResponse added in v0.3.0

type RecordSetsClientListResponse struct {
	// The response to a record set list operation.
	RecordSetListResult
}

RecordSetsClientListResponse contains the response from method RecordSetsClient.NewListPager.

type RecordSetsClientUpdateOptions added in v0.3.0

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 added in v0.3.0

type RecordSetsClientUpdateResponse struct {
	// Describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS zone.
	RecordSet
}

RecordSetsClientUpdateResponse contains the response from method RecordSetsClient.Update.

type RecordType

type RecordType string
const (
	RecordTypeA     RecordType = "A"
	RecordTypeAAAA  RecordType = "AAAA"
	RecordTypeCNAME RecordType = "CNAME"
	RecordTypeMX    RecordType = "MX"
	RecordTypePTR   RecordType = "PTR"
	RecordTypeSOA   RecordType = "SOA"
	RecordTypeSRV   RecordType = "SRV"
	RecordTypeTXT   RecordType = "TXT"
)

func PossibleRecordTypeValues

func PossibleRecordTypeValues() []RecordType

PossibleRecordTypeValues returns the possible values for the RecordType const type.

type ResolutionPolicy added in v1.3.0

type ResolutionPolicy string

ResolutionPolicy - The resolution policy on the virtual network link. Only applicable for virtual network links to privatelink zones, and for A,AAAA,CNAME queries. When set to 'NxDomainRedirect', Azure DNS resolver falls back to public resolution if private dns query resolution results in non-existent domain response.

const (
	ResolutionPolicyDefault          ResolutionPolicy = "Default"
	ResolutionPolicyNxDomainRedirect ResolutionPolicy = "NxDomainRedirect"
)

func PossibleResolutionPolicyValues added in v1.3.0

func PossibleResolutionPolicyValues() []ResolutionPolicy

PossibleResolutionPolicyValues returns the possible values for the ResolutionPolicy const type.

type Resource

type Resource struct {
	// READ-ONLY; Fully qualified resource Id for the resource. Example - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateDnsZoneName}'.
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. Example - 'Microsoft.Network/privateDnsZones'.
	Type *string
}

Resource - The core properties of ARM resources

func (Resource) MarshalJSON

func (r Resource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v1.1.0

func (r *Resource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

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 added in v1.1.0

func (s SoaRecord) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SoaRecord.

func (*SoaRecord) UnmarshalJSON added in v1.1.0

func (s *SoaRecord) UnmarshalJSON(data []byte) error

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 added in v1.1.0

func (s SrvRecord) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SrvRecord.

func (*SrvRecord) UnmarshalJSON added in v1.1.0

func (s *SrvRecord) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SrvRecord.

type SubResource

type SubResource struct {
	// Resource ID.
	ID *string
}

SubResource - Reference to another subresource.

func (SubResource) MarshalJSON added in v1.1.0

func (s SubResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SubResource.

func (*SubResource) UnmarshalJSON added in v1.1.0

func (s *SubResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SubResource.

type TrackedResource

type TrackedResource struct {
	// The Azure Region where the resource lives
	Location *string

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource Id for the resource. Example - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateDnsZoneName}'.
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. Example - 'Microsoft.Network/privateDnsZones'.
	Type *string
}

TrackedResource - The resource model definition for a ARM tracked top level resource

func (TrackedResource) MarshalJSON

func (t TrackedResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TrackedResource.

func (*TrackedResource) UnmarshalJSON added in v1.1.0

func (t *TrackedResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.

type TxtRecord

type TxtRecord struct {
	// The text value of this TXT record.
	Value []*string
}

TxtRecord - A TXT record.

func (TxtRecord) MarshalJSON

func (t TxtRecord) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TxtRecord.

func (*TxtRecord) UnmarshalJSON added in v1.1.0

func (t *TxtRecord) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TxtRecord.

type VirtualNetworkLink struct {
	// The ETag of the virtual network link.
	Etag *string

	// The Azure Region where the resource lives
	Location *string

	// Properties of the virtual network link to the Private DNS zone.
	Properties *VirtualNetworkLinkProperties

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource Id for the resource. Example - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateDnsZoneName}'.
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. Example - 'Microsoft.Network/privateDnsZones'.
	Type *string
}

VirtualNetworkLink - Describes a link to virtual network for a Private DNS zone.

func (VirtualNetworkLink) MarshalJSON

func (v VirtualNetworkLink) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLink.

func (*VirtualNetworkLink) UnmarshalJSON added in v1.1.0

func (v *VirtualNetworkLink) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkLink.

type VirtualNetworkLinkListResult

type VirtualNetworkLinkListResult struct {
	// Information about the virtual network links to the Private DNS zones.
	Value []*VirtualNetworkLink

	// READ-ONLY; The continuation token for the next page of results.
	NextLink *string
}

VirtualNetworkLinkListResult - The response to a list virtual network link to Private DNS zone operation.

func (VirtualNetworkLinkListResult) MarshalJSON

func (v VirtualNetworkLinkListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLinkListResult.

func (*VirtualNetworkLinkListResult) UnmarshalJSON added in v1.1.0

func (v *VirtualNetworkLinkListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkLinkListResult.

type VirtualNetworkLinkProperties

type VirtualNetworkLinkProperties struct {
	// Is auto-registration of virtual machine records in the virtual network in the Private DNS zone enabled?
	RegistrationEnabled *bool

	// The resolution policy on the virtual network link. Only applicable for virtual network links to privatelink zones, and
	// for A,AAAA,CNAME queries. When set to 'NxDomainRedirect', Azure DNS resolver
	// falls back to public resolution if private dns query resolution results in non-existent domain response.
	ResolutionPolicy *ResolutionPolicy

	// The reference of the virtual network.
	VirtualNetwork *SubResource

	// READ-ONLY; The provisioning state of the resource. This is a read-only property and any attempt to set this value will
	// be ignored.
	ProvisioningState *ProvisioningState

	// READ-ONLY; The status of the virtual network link to the Private DNS zone. Possible values are 'InProgress' and 'Done'.
	// This is a read-only property and any attempt to set this value will be ignored.
	VirtualNetworkLinkState *VirtualNetworkLinkState
}

VirtualNetworkLinkProperties - Represents the properties of the Private DNS zone.

func (VirtualNetworkLinkProperties) MarshalJSON added in v1.1.0

func (v VirtualNetworkLinkProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLinkProperties.

func (*VirtualNetworkLinkProperties) UnmarshalJSON added in v1.1.0

func (v *VirtualNetworkLinkProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkLinkProperties.

type VirtualNetworkLinkState

type VirtualNetworkLinkState string

VirtualNetworkLinkState - The status of the virtual network link to the Private DNS zone. Possible values are 'InProgress' and 'Done'. This is a read-only property and any attempt to set this value will be ignored.

const (
	VirtualNetworkLinkStateCompleted  VirtualNetworkLinkState = "Completed"
	VirtualNetworkLinkStateInProgress VirtualNetworkLinkState = "InProgress"
)

func PossibleVirtualNetworkLinkStateValues

func PossibleVirtualNetworkLinkStateValues() []VirtualNetworkLinkState

PossibleVirtualNetworkLinkStateValues returns the possible values for the VirtualNetworkLinkState const type.

type VirtualNetworkLinksClient

type VirtualNetworkLinksClient struct {
	// contains filtered or unexported fields
}

VirtualNetworkLinksClient contains the methods for the VirtualNetworkLinks group. Don't use this type directly, use NewVirtualNetworkLinksClient() instead.

func NewVirtualNetworkLinksClient

func NewVirtualNetworkLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkLinksClient, error)

NewVirtualNetworkLinksClient creates a new instance of VirtualNetworkLinksClient with the specified values.

  • subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*VirtualNetworkLinksClient) BeginCreateOrUpdate

func (client *VirtualNetworkLinksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateZoneName string, virtualNetworkLinkName string, parameters VirtualNetworkLink, options *VirtualNetworkLinksClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworkLinksClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates a virtual network link to the specified Private DNS zone. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • privateZoneName - The name of the Private DNS zone (without a terminating dot).
  • virtualNetworkLinkName - The name of the virtual network link.
  • parameters - Parameters supplied to the CreateOrUpdate operation.
  • options - VirtualNetworkLinksClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkLinksClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/VirtualNetworkLinkPut.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualNetworkLinksClient().BeginCreateOrUpdate(ctx, "resourceGroup1", "privatezone1.com", "virtualNetworkLink1", armprivatedns.VirtualNetworkLink{
		Location: to.Ptr("Global"),
		Tags: map[string]*string{
			"key1": to.Ptr("value1"),
		},
		Properties: &armprivatedns.VirtualNetworkLinkProperties{
			RegistrationEnabled: to.Ptr(false),
			VirtualNetwork: &armprivatedns.SubResource{
				ID: to.Ptr("/subscriptions/virtualNetworkSubscriptionId/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/virtualNetworkName"),
			},
		},
	}, &armprivatedns.VirtualNetworkLinksClientBeginCreateOrUpdateOptions{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.VirtualNetworkLink = armprivatedns.VirtualNetworkLink{
	// 	Name: to.Ptr("virtualNetworkLink1"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/virtualNetworkLinks"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/virtualNetworkLinks/virtualNetworkLink1"),
	// 	Location: to.Ptr("global"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.VirtualNetworkLinkProperties{
	// 		ProvisioningState: to.Ptr(armprivatedns.ProvisioningStateSucceeded),
	// 		RegistrationEnabled: to.Ptr(false),
	// 		VirtualNetwork: &armprivatedns.SubResource{
	// 			ID: to.Ptr("/subscriptions/virtualNetworkSubscriptionId/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/virtualNetworkName"),
	// 		},
	// 		VirtualNetworkLinkState: to.Ptr(armprivatedns.VirtualNetworkLinkStateCompleted),
	// 	},
	// }
}
Output:

func (*VirtualNetworkLinksClient) BeginDelete

func (client *VirtualNetworkLinksClient) BeginDelete(ctx context.Context, resourceGroupName string, privateZoneName string, virtualNetworkLinkName string, options *VirtualNetworkLinksClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkLinksClientDeleteResponse], error)

BeginDelete - Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation cannot be undone. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • privateZoneName - The name of the Private DNS zone (without a terminating dot).
  • virtualNetworkLinkName - The name of the virtual network link.
  • options - VirtualNetworkLinksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkLinksClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/VirtualNetworkLinkDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualNetworkLinksClient().BeginDelete(ctx, "resourceGroup1", "privatezone1.com", "virtualNetworkLink1", &armprivatedns.VirtualNetworkLinksClientBeginDeleteOptions{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 (*VirtualNetworkLinksClient) BeginUpdate

func (client *VirtualNetworkLinksClient) BeginUpdate(ctx context.Context, resourceGroupName string, privateZoneName string, virtualNetworkLinkName string, parameters VirtualNetworkLink, options *VirtualNetworkLinksClientBeginUpdateOptions) (*runtime.Poller[VirtualNetworkLinksClientUpdateResponse], error)

BeginUpdate - Updates a virtual network link to the specified Private DNS zone. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • privateZoneName - The name of the Private DNS zone (without a terminating dot).
  • virtualNetworkLinkName - The name of the virtual network link.
  • parameters - Parameters supplied to the Update operation.
  • options - VirtualNetworkLinksClientBeginUpdateOptions contains the optional parameters for the VirtualNetworkLinksClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/VirtualNetworkLinkPatch.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/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualNetworkLinksClient().BeginUpdate(ctx, "resourceGroup1", "privatelink.contoso.com", "virtualNetworkLink1", armprivatedns.VirtualNetworkLink{
		Tags: map[string]*string{
			"key2": to.Ptr("value2"),
		},
		Properties: &armprivatedns.VirtualNetworkLinkProperties{
			RegistrationEnabled: to.Ptr(true),
			ResolutionPolicy:    to.Ptr(armprivatedns.ResolutionPolicyNxDomainRedirect),
		},
	}, &armprivatedns.VirtualNetworkLinksClientBeginUpdateOptions{IfMatch: 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.VirtualNetworkLink = armprivatedns.VirtualNetworkLink{
	// 	Name: to.Ptr("virtualNetworkLink1"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/virtualNetworkLinks"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatelink.contoso.com/virtualNetworkLinks/virtualNetworkLink1"),
	// 	Location: to.Ptr("global"),
	// 	Tags: map[string]*string{
	// 		"key2": to.Ptr("value2"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.VirtualNetworkLinkProperties{
	// 		ProvisioningState: to.Ptr(armprivatedns.ProvisioningStateSucceeded),
	// 		RegistrationEnabled: to.Ptr(true),
	// 		ResolutionPolicy: to.Ptr(armprivatedns.ResolutionPolicyNxDomainRedirect),
	// 		VirtualNetwork: &armprivatedns.SubResource{
	// 			ID: to.Ptr("/subscriptions/virtualNetworkSubscriptionId/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/virtualNetworkName"),
	// 		},
	// 		VirtualNetworkLinkState: to.Ptr(armprivatedns.VirtualNetworkLinkStateCompleted),
	// 	},
	// }
}
Output:

func (*VirtualNetworkLinksClient) Get

func (client *VirtualNetworkLinksClient) Get(ctx context.Context, resourceGroupName string, privateZoneName string, virtualNetworkLinkName string, options *VirtualNetworkLinksClientGetOptions) (VirtualNetworkLinksClientGetResponse, error)

Get - Gets a virtual network link to the specified Private DNS zone. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • privateZoneName - The name of the Private DNS zone (without a terminating dot).
  • virtualNetworkLinkName - The name of the virtual network link.
  • options - VirtualNetworkLinksClientGetOptions contains the optional parameters for the VirtualNetworkLinksClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/VirtualNetworkLinkGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualNetworkLinksClient().Get(ctx, "resourceGroup1", "privatezone1.com", "virtualNetworkLink1", 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.VirtualNetworkLink = armprivatedns.VirtualNetworkLink{
	// 	Name: to.Ptr("virtualNetworkLink1"),
	// 	Type: to.Ptr("Microsoft.Network/privateDnsZones/virtualNetworkLinks"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/virtualNetworkLinks/virtualNetworkLink1"),
	// 	Location: to.Ptr("global"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armprivatedns.VirtualNetworkLinkProperties{
	// 		ProvisioningState: to.Ptr(armprivatedns.ProvisioningStateSucceeded),
	// 		RegistrationEnabled: to.Ptr(false),
	// 		VirtualNetwork: &armprivatedns.SubResource{
	// 			ID: to.Ptr("/subscriptions/virtualNetworkSubscriptionId/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/virtualNetworkName"),
	// 		},
	// 		VirtualNetworkLinkState: to.Ptr(armprivatedns.VirtualNetworkLinkStateCompleted),
	// 	},
	// }
}
Output:

func (*VirtualNetworkLinksClient) NewListPager added in v0.5.0

func (client *VirtualNetworkLinksClient) NewListPager(resourceGroupName string, privateZoneName string, options *VirtualNetworkLinksClientListOptions) *runtime.Pager[VirtualNetworkLinksClientListResponse]

NewListPager - Lists the virtual network links to the specified Private DNS zone.

Generated from API version 2024-06-01

  • resourceGroupName - The name of the resource group.
  • privateZoneName - The name of the Private DNS zone (without a terminating dot).
  • options - VirtualNetworkLinksClientListOptions contains the optional parameters for the VirtualNetworkLinksClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4991356eec55985c1af47096c9c2091126a7d0f/specification/privatedns/resource-manager/Microsoft.Network/stable/2024-06-01/examples/VirtualNetworkLinkList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprivatedns.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualNetworkLinksClient().NewListPager("resourceGroup1", "privatelink.contoso.com", &armprivatedns.VirtualNetworkLinksClientListOptions{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.VirtualNetworkLinkListResult = armprivatedns.VirtualNetworkLinkListResult{
		// 	Value: []*armprivatedns.VirtualNetworkLink{
		// 		{
		// 			Name: to.Ptr("virtualNetworkLink1"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/virtualNetworkLinks"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatelink.contoso.com/virtualNetworkLinks/virtualNetworkLink1"),
		// 			Location: to.Ptr("global"),
		// 			Tags: map[string]*string{
		// 				"key1": to.Ptr("value1"),
		// 			},
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.VirtualNetworkLinkProperties{
		// 				ProvisioningState: to.Ptr(armprivatedns.ProvisioningStateSucceeded),
		// 				RegistrationEnabled: to.Ptr(false),
		// 				ResolutionPolicy: to.Ptr(armprivatedns.ResolutionPolicyNxDomainRedirect),
		// 				VirtualNetwork: &armprivatedns.SubResource{
		// 					ID: to.Ptr("/subscriptions/virtualNetworkSubscriptionId/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/virtualNetworkName"),
		// 				},
		// 				VirtualNetworkLinkState: to.Ptr(armprivatedns.VirtualNetworkLinkStateCompleted),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("virtualNetworkLink2"),
		// 			Type: to.Ptr("Microsoft.Network/privateDnsZones/virtualNetworkLinks"),
		// 			ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatelink.contoso.com/virtualNetworkLinks/virtualNetworkLink2"),
		// 			Location: to.Ptr("global"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armprivatedns.VirtualNetworkLinkProperties{
		// 				ProvisioningState: to.Ptr(armprivatedns.ProvisioningStateSucceeded),
		// 				RegistrationEnabled: to.Ptr(true),
		// 				ResolutionPolicy: to.Ptr(armprivatedns.ResolutionPolicyDefault),
		// 				VirtualNetwork: &armprivatedns.SubResource{
		// 					ID: to.Ptr("/subscriptions/virtualNetworkSubscriptionId/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/virtualNetworkName"),
		// 				},
		// 				VirtualNetworkLinkState: to.Ptr(armprivatedns.VirtualNetworkLinkStateInProgress),
		// 			},
		// 	}},
		// }
	}
}
Output:

type VirtualNetworkLinksClientBeginCreateOrUpdateOptions added in v0.3.0

type VirtualNetworkLinksClientBeginCreateOrUpdateOptions struct {
	// The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite the current virtual network
	// link. Specify the last-seen ETag value to prevent accidentally overwriting
	// any concurrent changes.
	IfMatch *string

	// Set to '*' to allow a new virtual network link to the Private DNS zone to be created, but to prevent updating an existing
	// link. Other values will be ignored.
	IfNoneMatch *string

	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualNetworkLinksClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkLinksClient.BeginCreateOrUpdate method.

type VirtualNetworkLinksClientBeginDeleteOptions added in v0.3.0

type VirtualNetworkLinksClientBeginDeleteOptions struct {
	// The ETag of the virtual network link to the Private 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
}

VirtualNetworkLinksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkLinksClient.BeginDelete method.

type VirtualNetworkLinksClientBeginUpdateOptions added in v0.3.0

type VirtualNetworkLinksClientBeginUpdateOptions struct {
	// The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite the current virtual network
	// link. Specify the last-seen ETag value to prevent accidentally overwriting
	// any concurrent changes.
	IfMatch *string

	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualNetworkLinksClientBeginUpdateOptions contains the optional parameters for the VirtualNetworkLinksClient.BeginUpdate method.

type VirtualNetworkLinksClientCreateOrUpdateResponse added in v0.3.0

type VirtualNetworkLinksClientCreateOrUpdateResponse struct {
	// Describes a link to virtual network for a Private DNS zone.
	VirtualNetworkLink
}

VirtualNetworkLinksClientCreateOrUpdateResponse contains the response from method VirtualNetworkLinksClient.BeginCreateOrUpdate.

type VirtualNetworkLinksClientDeleteResponse added in v0.3.0

type VirtualNetworkLinksClientDeleteResponse struct {
}

VirtualNetworkLinksClientDeleteResponse contains the response from method VirtualNetworkLinksClient.BeginDelete.

type VirtualNetworkLinksClientGetOptions added in v0.3.0

type VirtualNetworkLinksClientGetOptions struct {
}

VirtualNetworkLinksClientGetOptions contains the optional parameters for the VirtualNetworkLinksClient.Get method.

type VirtualNetworkLinksClientGetResponse added in v0.3.0

type VirtualNetworkLinksClientGetResponse struct {
	// Describes a link to virtual network for a Private DNS zone.
	VirtualNetworkLink
}

VirtualNetworkLinksClientGetResponse contains the response from method VirtualNetworkLinksClient.Get.

type VirtualNetworkLinksClientListOptions added in v0.3.0

type VirtualNetworkLinksClientListOptions struct {
	// The maximum number of virtual network links to return. If not specified, returns up to 100 virtual network links.
	Top *int32
}

VirtualNetworkLinksClientListOptions contains the optional parameters for the VirtualNetworkLinksClient.NewListPager method.

type VirtualNetworkLinksClientListResponse added in v0.3.0

type VirtualNetworkLinksClientListResponse struct {
	// The response to a list virtual network link to Private DNS zone operation.
	VirtualNetworkLinkListResult
}

VirtualNetworkLinksClientListResponse contains the response from method VirtualNetworkLinksClient.NewListPager.

type VirtualNetworkLinksClientUpdateResponse added in v0.3.0

type VirtualNetworkLinksClientUpdateResponse struct {
	// Describes a link to virtual network for a Private DNS zone.
	VirtualNetworkLink
}

VirtualNetworkLinksClientUpdateResponse contains the response from method VirtualNetworkLinksClient.BeginUpdate.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL