armdnsresolver

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 15 Imported by: 3

README

Azure DNS Private Resolver Module for Go

PkgGoDev

The armdnsresolver module provides operations for working with Azure DNS Private Resolver.

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 DNS Private Resolver module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure DNS Private Resolver. 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 DNS Private Resolver 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 := armdnsresolver.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 := armdnsresolver.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.NewDNSResolversClient()

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.

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the DNS Private Resolver 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 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 - The ID of the target subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewDNSForwardingRulesetsClient added in v1.1.0

func (c *ClientFactory) NewDNSForwardingRulesetsClient() *DNSForwardingRulesetsClient

NewDNSForwardingRulesetsClient creates a new instance of DNSForwardingRulesetsClient.

func (*ClientFactory) NewDNSResolversClient added in v1.1.0

func (c *ClientFactory) NewDNSResolversClient() *DNSResolversClient

NewDNSResolversClient creates a new instance of DNSResolversClient.

func (*ClientFactory) NewForwardingRulesClient added in v1.1.0

func (c *ClientFactory) NewForwardingRulesClient() *ForwardingRulesClient

NewForwardingRulesClient creates a new instance of ForwardingRulesClient.

func (*ClientFactory) NewInboundEndpointsClient added in v1.1.0

func (c *ClientFactory) NewInboundEndpointsClient() *InboundEndpointsClient

NewInboundEndpointsClient creates a new instance of InboundEndpointsClient.

func (*ClientFactory) NewOutboundEndpointsClient added in v1.1.0

func (c *ClientFactory) NewOutboundEndpointsClient() *OutboundEndpointsClient

NewOutboundEndpointsClient creates a new instance of OutboundEndpointsClient.

func (*ClientFactory) NewVirtualNetworkLinksClient added in v1.1.0

func (c *ClientFactory) NewVirtualNetworkLinksClient() *VirtualNetworkLinksClient

NewVirtualNetworkLinksClient creates a new instance of VirtualNetworkLinksClient.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type DNSForwardingRuleset

type DNSForwardingRuleset struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// REQUIRED; Properties of the DNS forwarding ruleset.
	Properties *DNSForwardingRulesetProperties

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

	// READ-ONLY; ETag of the DNS forwarding ruleset.
	Etag *string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

DNSForwardingRuleset - Describes a DNS forwarding ruleset.

func (DNSForwardingRuleset) MarshalJSON

func (d DNSForwardingRuleset) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DNSForwardingRuleset.

func (*DNSForwardingRuleset) UnmarshalJSON added in v1.0.0

func (d *DNSForwardingRuleset) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DNSForwardingRuleset.

type DNSForwardingRulesetListResult

type DNSForwardingRulesetListResult struct {
	// Enumeration of the DNS forwarding rulesets.
	Value []*DNSForwardingRuleset

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

DNSForwardingRulesetListResult - The response to an enumeration operation on DNS forwarding rulesets.

func (DNSForwardingRulesetListResult) MarshalJSON

func (d DNSForwardingRulesetListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DNSForwardingRulesetListResult.

func (*DNSForwardingRulesetListResult) UnmarshalJSON added in v1.0.0

func (d *DNSForwardingRulesetListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DNSForwardingRulesetListResult.

type DNSForwardingRulesetPatch

type DNSForwardingRulesetPatch struct {
	// The reference to the DNS resolver outbound endpoints that are used to route DNS queries matching the forwarding rules in
	// the ruleset to the target DNS servers.
	DNSResolverOutboundEndpoints []*SubResource

	// Tags for DNS Resolver.
	Tags map[string]*string
}

DNSForwardingRulesetPatch - Describes a DNS forwarding ruleset PATCH operation.

func (DNSForwardingRulesetPatch) MarshalJSON

func (d DNSForwardingRulesetPatch) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DNSForwardingRulesetPatch.

func (*DNSForwardingRulesetPatch) UnmarshalJSON added in v1.0.0

func (d *DNSForwardingRulesetPatch) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DNSForwardingRulesetPatch.

type DNSForwardingRulesetProperties

type DNSForwardingRulesetProperties struct {
	// REQUIRED; The reference to the DNS resolver outbound endpoints that are used to route DNS queries matching the forwarding
	// rules in the ruleset to the target DNS servers.
	DNSResolverOutboundEndpoints []*SubResource

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

	// READ-ONLY; The resourceGuid for the DNS forwarding ruleset.
	ResourceGUID *string
}

DNSForwardingRulesetProperties - Represents the properties of a DNS forwarding ruleset.

func (DNSForwardingRulesetProperties) MarshalJSON

func (d DNSForwardingRulesetProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DNSForwardingRulesetProperties.

func (*DNSForwardingRulesetProperties) UnmarshalJSON added in v1.0.0

func (d *DNSForwardingRulesetProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DNSForwardingRulesetProperties.

type DNSForwardingRulesetsClient

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

DNSForwardingRulesetsClient contains the methods for the DNSForwardingRulesets group. Don't use this type directly, use NewDNSForwardingRulesetsClient() instead.

func NewDNSForwardingRulesetsClient

func NewDNSForwardingRulesetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DNSForwardingRulesetsClient, error)

NewDNSForwardingRulesetsClient creates a new instance of DNSForwardingRulesetsClient with the specified values.

  • subscriptionID - The ID of the target subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*DNSForwardingRulesetsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates a DNS forwarding ruleset. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsForwardingRulesetName - The name of the DNS forwarding ruleset.
  • parameters - Parameters supplied to the CreateOrUpdate operation.
  • options - DNSForwardingRulesetsClientBeginCreateOrUpdateOptions contains the optional parameters for the DNSForwardingRulesetsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsForwardingRuleset_Put.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/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDNSForwardingRulesetsClient().BeginCreateOrUpdate(ctx, "sampleResourceGroup", "samplednsForwardingRuleset", armdnsresolver.DNSForwardingRuleset{
		Location: to.Ptr("westus2"),
		Tags: map[string]*string{
			"key1": to.Ptr("value1"),
		},
		Properties: &armdnsresolver.DNSForwardingRulesetProperties{
			DNSResolverOutboundEndpoints: []*armdnsresolver.SubResource{
				{
					ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint0"),
				},
				{
					ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint1"),
				}},
		},
	}, &armdnsresolver.DNSForwardingRulesetsClientBeginCreateOrUpdateOptions{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.DNSForwardingRuleset = armdnsresolver.DNSForwardingRuleset{
	// 	Name: to.Ptr("sampleDnsForwardingRuleset"),
	// 	Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRulesets/sampleDnsForwardingRuleset"),
	// 	Location: to.Ptr("westus2"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.DNSForwardingRulesetProperties{
	// 		DNSResolverOutboundEndpoints: []*armdnsresolver.SubResource{
	// 			{
	// 				ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint0"),
	// 			},
	// 			{
	// 				ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint1"),
	// 		}},
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		ResourceGUID: to.Ptr("a7e1a32c-498c-401c-a805-5bc3518257b8"),
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-03T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*DNSForwardingRulesetsClient) BeginDelete

BeginDelete - Deletes a DNS forwarding ruleset. WARNING: This operation cannot be undone. All forwarding rules within the ruleset will be deleted. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsForwardingRulesetName - The name of the DNS forwarding ruleset.
  • options - DNSForwardingRulesetsClientBeginDeleteOptions contains the optional parameters for the DNSForwardingRulesetsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsForwardingRuleset_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDNSForwardingRulesetsClient().BeginDelete(ctx, "sampleResourceGroup", "samplednsForwardingRulesetName", &armdnsresolver.DNSForwardingRulesetsClientBeginDeleteOptions{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 (*DNSForwardingRulesetsClient) BeginUpdate

BeginUpdate - Updates a DNS forwarding ruleset. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsForwardingRulesetName - The name of the DNS forwarding ruleset.
  • parameters - Parameters supplied to the Update operation.
  • options - DNSForwardingRulesetsClientBeginUpdateOptions contains the optional parameters for the DNSForwardingRulesetsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsForwardingRuleset_Patch.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/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDNSForwardingRulesetsClient().BeginUpdate(ctx, "sampleResourceGroup", "sampleDnsForwardingRuleset", armdnsresolver.DNSForwardingRulesetPatch{
		Tags: map[string]*string{
			"key1": to.Ptr("value1"),
		},
	}, &armdnsresolver.DNSForwardingRulesetsClientBeginUpdateOptions{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.DNSForwardingRuleset = armdnsresolver.DNSForwardingRuleset{
	// 	Name: to.Ptr("sampleDnsForwardingRuleset"),
	// 	Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRulesets/sampleDnsForwardingRuleset"),
	// 	Location: to.Ptr("westus2"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.DNSForwardingRulesetProperties{
	// 		DNSResolverOutboundEndpoints: []*armdnsresolver.SubResource{
	// 			{
	// 				ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint0"),
	// 			},
	// 			{
	// 				ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint1"),
	// 		}},
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		ResourceGUID: to.Ptr("a7e1a32c-498c-401c-a805-5bc3518257b8"),
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-03T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*DNSForwardingRulesetsClient) Get

func (client *DNSForwardingRulesetsClient) Get(ctx context.Context, resourceGroupName string, dnsForwardingRulesetName string, options *DNSForwardingRulesetsClientGetOptions) (DNSForwardingRulesetsClientGetResponse, error)

Get - Gets a DNS forwarding ruleset properties. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsForwardingRulesetName - The name of the DNS forwarding ruleset.
  • options - DNSForwardingRulesetsClientGetOptions contains the optional parameters for the DNSForwardingRulesetsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsForwardingRuleset_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDNSForwardingRulesetsClient().Get(ctx, "sampleResourceGroup", "sampleDnsForwardingRuleset", 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.DNSForwardingRuleset = armdnsresolver.DNSForwardingRuleset{
	// 	Name: to.Ptr("sampleDnsForwardingRuleset"),
	// 	Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRulesets/sampleDnsForwardingRuleset"),
	// 	Location: to.Ptr("westus2"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.DNSForwardingRulesetProperties{
	// 		DNSResolverOutboundEndpoints: []*armdnsresolver.SubResource{
	// 			{
	// 				ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint0"),
	// 			},
	// 			{
	// 				ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint1"),
	// 		}},
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		ResourceGUID: to.Ptr("a7e1a32c-498c-401c-a805-5bc3518257b8"),
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-03T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*DNSForwardingRulesetsClient) NewListByResourceGroupPager added in v0.3.0

NewListByResourceGroupPager - Lists DNS forwarding rulesets within a resource group.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - DNSForwardingRulesetsClientListByResourceGroupOptions contains the optional parameters for the DNSForwardingRulesetsClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsForwardingRuleset_ListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDNSForwardingRulesetsClient().NewListByResourceGroupPager("sampleResourceGroup", &armdnsresolver.DNSForwardingRulesetsClientListByResourceGroupOptions{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.DNSForwardingRulesetListResult = armdnsresolver.DNSForwardingRulesetListResult{
		// 	Value: []*armdnsresolver.DNSForwardingRuleset{
		// 		{
		// 			Name: to.Ptr("sampleDnsForwardingRuleset"),
		// 			Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets"),
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRulesets/sampleDnsForwardingRuleset"),
		// 			Location: to.Ptr("westus2"),
		// 			Tags: map[string]*string{
		// 				"key1": to.Ptr("value1"),
		// 			},
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armdnsresolver.DNSForwardingRulesetProperties{
		// 				DNSResolverOutboundEndpoints: []*armdnsresolver.SubResource{
		// 					{
		// 						ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint0"),
		// 					},
		// 					{
		// 						ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint1"),
		// 				}},
		// 				ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
		// 				ResourceGUID: to.Ptr("a7e1a32c-498c-401c-a805-5bc3518257b8"),
		// 			},
		// 			SystemData: &armdnsresolver.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-03T01:01:01.107Z"); return t}()),
		// 				CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("sampleDnsForwardingRuleset"),
		// 			Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets"),
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRulesets/sampleDnsForwardingRuleset1"),
		// 			Location: to.Ptr("westus2"),
		// 			Tags: map[string]*string{
		// 				"key1": to.Ptr("value1"),
		// 			},
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armdnsresolver.DNSForwardingRulesetProperties{
		// 				DNSResolverOutboundEndpoints: []*armdnsresolver.SubResource{
		// 					{
		// 						ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint2"),
		// 					},
		// 					{
		// 						ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint3"),
		// 				}},
		// 				ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
		// 				ResourceGUID: to.Ptr("c2aed17a-708d-48d1-89c3-d6a9b648d222"),
		// 			},
		// 			SystemData: &armdnsresolver.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-04T01:01:01.107Z"); return t}()),
		// 				CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-05T02:03:01.197Z"); return t}()),
		// 				LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*DNSForwardingRulesetsClient) NewListByVirtualNetworkPager added in v0.3.0

NewListByVirtualNetworkPager - Lists DNS forwarding ruleset resource IDs attached to a virtual network.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • virtualNetworkName - The name of the virtual network.
  • options - DNSForwardingRulesetsClientListByVirtualNetworkOptions contains the optional parameters for the DNSForwardingRulesetsClient.NewListByVirtualNetworkPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsForwardingRuleset_ListByVirtualNetwork.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDNSForwardingRulesetsClient().NewListByVirtualNetworkPager("sampleResourceGroup", "sampleVirtualNetwork", &armdnsresolver.DNSForwardingRulesetsClientListByVirtualNetworkOptions{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.VirtualNetworkDNSForwardingRulesetListResult = armdnsresolver.VirtualNetworkDNSForwardingRulesetListResult{
		// 	Value: []*armdnsresolver.VirtualNetworkDNSForwardingRuleset{
		// 		{
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRulesets/sampleDnsForwardingRuleset"),
		// 			Properties: &armdnsresolver.VirtualNetworkLinkSubResourceProperties{
		// 				VirtualNetworkLink: &armdnsresolver.SubResource{
		// 					ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRuleset/sampleDnsForwardingRuleset/virtualNetworkLinks/sampleVirtualNetworkLink"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*DNSForwardingRulesetsClient) NewListPager added in v0.3.0

NewListPager - Lists DNS forwarding rulesets in all resource groups of a subscription.

Generated from API version 2022-07-01

  • options - DNSForwardingRulesetsClientListOptions contains the optional parameters for the DNSForwardingRulesetsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsForwardingRuleset_ListBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDNSForwardingRulesetsClient().NewListPager(&armdnsresolver.DNSForwardingRulesetsClientListOptions{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.DNSForwardingRulesetListResult = armdnsresolver.DNSForwardingRulesetListResult{
		// 	Value: []*armdnsresolver.DNSForwardingRuleset{
		// 		{
		// 			Name: to.Ptr("sampleDnsForwardingRuleset"),
		// 			Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets"),
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRulesets/sampleDnsForwardingRuleset"),
		// 			Location: to.Ptr("westus2"),
		// 			Tags: map[string]*string{
		// 				"key1": to.Ptr("value1"),
		// 			},
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armdnsresolver.DNSForwardingRulesetProperties{
		// 				DNSResolverOutboundEndpoints: []*armdnsresolver.SubResource{
		// 					{
		// 						ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint0"),
		// 					},
		// 					{
		// 						ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint1"),
		// 				}},
		// 				ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
		// 				ResourceGUID: to.Ptr("a7e1a32c-498c-401c-a805-5bc3518257b8"),
		// 			},
		// 			SystemData: &armdnsresolver.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-03T01:01:01.107Z"); return t}()),
		// 				CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("sampleDnsForwardingRuleset"),
		// 			Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets"),
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRulesets/sampleDnsForwardingRuleset1"),
		// 			Location: to.Ptr("westus2"),
		// 			Tags: map[string]*string{
		// 				"key1": to.Ptr("value1"),
		// 			},
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armdnsresolver.DNSForwardingRulesetProperties{
		// 				DNSResolverOutboundEndpoints: []*armdnsresolver.SubResource{
		// 					{
		// 						ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint2"),
		// 					},
		// 					{
		// 						ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint3"),
		// 				}},
		// 				ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
		// 				ResourceGUID: to.Ptr("a7e1a32c-498c-401c-a805-5bc3518257b8"),
		// 			},
		// 			SystemData: &armdnsresolver.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-04T01:01:01.107Z"); return t}()),
		// 				CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-05T02:03:01.197Z"); return t}()),
		// 				LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 			},
		// 	}},
		// }
	}
}
Output:

type DNSForwardingRulesetsClientBeginCreateOrUpdateOptions

type DNSForwardingRulesetsClientBeginCreateOrUpdateOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string

	// Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored.
	IfNoneMatch *string

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

DNSForwardingRulesetsClientBeginCreateOrUpdateOptions contains the optional parameters for the DNSForwardingRulesetsClient.BeginCreateOrUpdate method.

type DNSForwardingRulesetsClientBeginDeleteOptions

type DNSForwardingRulesetsClientBeginDeleteOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string

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

DNSForwardingRulesetsClientBeginDeleteOptions contains the optional parameters for the DNSForwardingRulesetsClient.BeginDelete method.

type DNSForwardingRulesetsClientBeginUpdateOptions

type DNSForwardingRulesetsClientBeginUpdateOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string

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

DNSForwardingRulesetsClientBeginUpdateOptions contains the optional parameters for the DNSForwardingRulesetsClient.BeginUpdate method.

type DNSForwardingRulesetsClientCreateOrUpdateResponse

type DNSForwardingRulesetsClientCreateOrUpdateResponse struct {
	// Describes a DNS forwarding ruleset.
	DNSForwardingRuleset
}

DNSForwardingRulesetsClientCreateOrUpdateResponse contains the response from method DNSForwardingRulesetsClient.BeginCreateOrUpdate.

type DNSForwardingRulesetsClientDeleteResponse

type DNSForwardingRulesetsClientDeleteResponse struct {
}

DNSForwardingRulesetsClientDeleteResponse contains the response from method DNSForwardingRulesetsClient.BeginDelete.

type DNSForwardingRulesetsClientGetOptions

type DNSForwardingRulesetsClientGetOptions struct {
}

DNSForwardingRulesetsClientGetOptions contains the optional parameters for the DNSForwardingRulesetsClient.Get method.

type DNSForwardingRulesetsClientGetResponse

type DNSForwardingRulesetsClientGetResponse struct {
	// Describes a DNS forwarding ruleset.
	DNSForwardingRuleset
}

DNSForwardingRulesetsClientGetResponse contains the response from method DNSForwardingRulesetsClient.Get.

type DNSForwardingRulesetsClientListByResourceGroupOptions

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

DNSForwardingRulesetsClientListByResourceGroupOptions contains the optional parameters for the DNSForwardingRulesetsClient.NewListByResourceGroupPager method.

type DNSForwardingRulesetsClientListByResourceGroupResponse

type DNSForwardingRulesetsClientListByResourceGroupResponse struct {
	// The response to an enumeration operation on DNS forwarding rulesets.
	DNSForwardingRulesetListResult
}

DNSForwardingRulesetsClientListByResourceGroupResponse contains the response from method DNSForwardingRulesetsClient.NewListByResourceGroupPager.

type DNSForwardingRulesetsClientListByVirtualNetworkOptions

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

DNSForwardingRulesetsClientListByVirtualNetworkOptions contains the optional parameters for the DNSForwardingRulesetsClient.NewListByVirtualNetworkPager method.

type DNSForwardingRulesetsClientListByVirtualNetworkResponse

type DNSForwardingRulesetsClientListByVirtualNetworkResponse struct {
	// The response to an enumeration operation on Virtual Network DNS Forwarding Ruleset.
	VirtualNetworkDNSForwardingRulesetListResult
}

DNSForwardingRulesetsClientListByVirtualNetworkResponse contains the response from method DNSForwardingRulesetsClient.NewListByVirtualNetworkPager.

type DNSForwardingRulesetsClientListOptions

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

DNSForwardingRulesetsClientListOptions contains the optional parameters for the DNSForwardingRulesetsClient.NewListPager method.

type DNSForwardingRulesetsClientListResponse

type DNSForwardingRulesetsClientListResponse struct {
	// The response to an enumeration operation on DNS forwarding rulesets.
	DNSForwardingRulesetListResult
}

DNSForwardingRulesetsClientListResponse contains the response from method DNSForwardingRulesetsClient.NewListPager.

type DNSForwardingRulesetsClientUpdateResponse

type DNSForwardingRulesetsClientUpdateResponse struct {
	// Describes a DNS forwarding ruleset.
	DNSForwardingRuleset
}

DNSForwardingRulesetsClientUpdateResponse contains the response from method DNSForwardingRulesetsClient.BeginUpdate.

type DNSResolver

type DNSResolver struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// REQUIRED; Properties of the DNS resolver.
	Properties *Properties

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

	// READ-ONLY; ETag of the DNS resolver.
	Etag *string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

DNSResolver - Describes a DNS resolver.

func (DNSResolver) MarshalJSON

func (d DNSResolver) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DNSResolver.

func (*DNSResolver) UnmarshalJSON added in v1.0.0

func (d *DNSResolver) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DNSResolver.

type DNSResolverState

type DNSResolverState string

DNSResolverState - The current status of the DNS resolver. This is a read-only property and any attempt to set this value will be ignored.

const (
	DNSResolverStateConnected    DNSResolverState = "Connected"
	DNSResolverStateDisconnected DNSResolverState = "Disconnected"
)

func PossibleDNSResolverStateValues

func PossibleDNSResolverStateValues() []DNSResolverState

PossibleDNSResolverStateValues returns the possible values for the DNSResolverState const type.

type DNSResolversClient

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

DNSResolversClient contains the methods for the DNSResolvers group. Don't use this type directly, use NewDNSResolversClient() instead.

func NewDNSResolversClient

func NewDNSResolversClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DNSResolversClient, error)

NewDNSResolversClient creates a new instance of DNSResolversClient with the specified values.

  • subscriptionID - The ID of the target subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*DNSResolversClient) BeginCreateOrUpdate

func (client *DNSResolversClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, dnsResolverName string, parameters DNSResolver, options *DNSResolversClientBeginCreateOrUpdateOptions) (*runtime.Poller[DNSResolversClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates a DNS resolver. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsResolverName - The name of the DNS resolver.
  • parameters - Parameters supplied to the CreateOrUpdate operation.
  • options - DNSResolversClientBeginCreateOrUpdateOptions contains the optional parameters for the DNSResolversClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsResolver_Put.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/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDNSResolversClient().BeginCreateOrUpdate(ctx, "sampleResourceGroup", "sampleDnsResolver", armdnsresolver.DNSResolver{
		Location: to.Ptr("westus2"),
		Tags: map[string]*string{
			"key1": to.Ptr("value1"),
		},
		Properties: &armdnsresolver.Properties{
			VirtualNetwork: &armdnsresolver.SubResource{
				ID: to.Ptr("/subscriptions/cbb1387e-4b03-44f2-ad41-58d4677b9873/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork"),
			},
		},
	}, &armdnsresolver.DNSResolversClientBeginCreateOrUpdateOptions{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.DNSResolver = armdnsresolver.DNSResolver{
	// 	Name: to.Ptr("sampleDnsResolver"),
	// 	Type: to.Ptr("Microsoft.Network/dnsResolvers"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver"),
	// 	Location: to.Ptr("westus2"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.Properties{
	// 		DNSResolverState: to.Ptr(armdnsresolver.DNSResolverStateConnected),
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		ResourceGUID: to.Ptr("b6b2d964-8588-4e3a-a7fe-8a5b7fe8eca5"),
	// 		VirtualNetwork: &armdnsresolver.SubResource{
	// 			ID: to.Ptr("/subscriptions/cbb1387e-4b03-44f2-ad41-58d4677b9873/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork"),
	// 		},
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*DNSResolversClient) BeginDelete

func (client *DNSResolversClient) BeginDelete(ctx context.Context, resourceGroupName string, dnsResolverName string, options *DNSResolversClientBeginDeleteOptions) (*runtime.Poller[DNSResolversClientDeleteResponse], error)

BeginDelete - Deletes a DNS resolver. WARNING: This operation cannot be undone. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsResolverName - The name of the DNS resolver.
  • options - DNSResolversClientBeginDeleteOptions contains the optional parameters for the DNSResolversClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsResolver_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDNSResolversClient().BeginDelete(ctx, "sampleResourceGroup", "sampleDnsResolver", &armdnsresolver.DNSResolversClientBeginDeleteOptions{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 (*DNSResolversClient) BeginUpdate

func (client *DNSResolversClient) BeginUpdate(ctx context.Context, resourceGroupName string, dnsResolverName string, parameters Patch, options *DNSResolversClientBeginUpdateOptions) (*runtime.Poller[DNSResolversClientUpdateResponse], error)

BeginUpdate - Updates a DNS resolver. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsResolverName - The name of the DNS resolver.
  • parameters - Parameters supplied to the Update operation.
  • options - DNSResolversClientBeginUpdateOptions contains the optional parameters for the DNSResolversClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsResolver_Patch.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/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDNSResolversClient().BeginUpdate(ctx, "sampleResourceGroup", "sampleDnsResolver", armdnsresolver.Patch{
		Tags: map[string]*string{
			"key1": to.Ptr("value1"),
		},
	}, &armdnsresolver.DNSResolversClientBeginUpdateOptions{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.DNSResolver = armdnsresolver.DNSResolver{
	// 	Name: to.Ptr("sampleDnsResolver"),
	// 	Type: to.Ptr("Microsoft.Network/dnsResolvers"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver"),
	// 	Location: to.Ptr("westus2"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.Properties{
	// 		DNSResolverState: to.Ptr(armdnsresolver.DNSResolverStateConnected),
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		ResourceGUID: to.Ptr("b6b2d964-8588-4e3a-a7fe-8a5b7fe8eca5"),
	// 		VirtualNetwork: &armdnsresolver.SubResource{
	// 			ID: to.Ptr("/subscriptions/cbb1387e-4b03-44f2-ad41-58d4677b9873/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork"),
	// 		},
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*DNSResolversClient) Get

func (client *DNSResolversClient) Get(ctx context.Context, resourceGroupName string, dnsResolverName string, options *DNSResolversClientGetOptions) (DNSResolversClientGetResponse, error)

Get - Gets properties of a DNS resolver. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsResolverName - The name of the DNS resolver.
  • options - DNSResolversClientGetOptions contains the optional parameters for the DNSResolversClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsResolver_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDNSResolversClient().Get(ctx, "sampleResourceGroup", "sampleDnsResolver", 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.DNSResolver = armdnsresolver.DNSResolver{
	// 	Name: to.Ptr("sampleDnsResolver"),
	// 	Type: to.Ptr("Microsoft.Network/dnsResolvers"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver"),
	// 	Location: to.Ptr("westus2"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.Properties{
	// 		DNSResolverState: to.Ptr(armdnsresolver.DNSResolverStateConnected),
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		ResourceGUID: to.Ptr("a7e1a32c-498c-401c-a805-5bc3518257b8"),
	// 		VirtualNetwork: &armdnsresolver.SubResource{
	// 			ID: to.Ptr("/subscriptions/cbb1387e-4b03-44f2-ad41-58d4677b9873/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork"),
	// 		},
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-03T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-04T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*DNSResolversClient) NewListByResourceGroupPager added in v0.3.0

NewListByResourceGroupPager - Lists DNS resolvers within a resource group.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - DNSResolversClientListByResourceGroupOptions contains the optional parameters for the DNSResolversClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsResolver_ListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDNSResolversClient().NewListByResourceGroupPager("sampleResourceGroup", &armdnsresolver.DNSResolversClientListByResourceGroupOptions{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.ListResult = armdnsresolver.ListResult{
		// 	Value: []*armdnsresolver.DNSResolver{
		// 		{
		// 			Name: to.Ptr("sampleDnsResolver1"),
		// 			Type: to.Ptr("Microsoft.Network/dnsResolvers"),
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver1"),
		// 			Location: to.Ptr("westus2"),
		// 			Tags: map[string]*string{
		// 				"key1": to.Ptr("value1"),
		// 			},
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armdnsresolver.Properties{
		// 				DNSResolverState: to.Ptr(armdnsresolver.DNSResolverStateConnected),
		// 				ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
		// 				ResourceGUID: to.Ptr("ad9c8da4-3bb2-4821-a878-c2cb07b01fb6"),
		// 				VirtualNetwork: &armdnsresolver.SubResource{
		// 					ID: to.Ptr("/subscriptions/cbb1387e-4b03-44f2-ad41-58d4677b9873/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork1"),
		// 				},
		// 			},
		// 			SystemData: &armdnsresolver.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
		// 				CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
		// 				LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("sampleDnsResolver2"),
		// 			Type: to.Ptr("Microsoft.Network/dnsResolvers"),
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver2"),
		// 			Location: to.Ptr("westus2"),
		// 			Tags: map[string]*string{
		// 				"key1": to.Ptr("value1"),
		// 			},
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armdnsresolver.Properties{
		// 				DNSResolverState: to.Ptr(armdnsresolver.DNSResolverStateConnected),
		// 				ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
		// 				ResourceGUID: to.Ptr("b6b2d964-8588-4e3a-a7fe-8a5b7fe8eca5"),
		// 				VirtualNetwork: &armdnsresolver.SubResource{
		// 					ID: to.Ptr("/subscriptions/cbb1387e-4b03-44f2-ad41-58d4677b9873/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork2"),
		// 				},
		// 			},
		// 			SystemData: &armdnsresolver.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-03T01:01:01.107Z"); return t}()),
		// 				CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-04T02:03:01.197Z"); return t}()),
		// 				LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*DNSResolversClient) NewListByVirtualNetworkPager added in v0.3.0

func (client *DNSResolversClient) NewListByVirtualNetworkPager(resourceGroupName string, virtualNetworkName string, options *DNSResolversClientListByVirtualNetworkOptions) *runtime.Pager[DNSResolversClientListByVirtualNetworkResponse]

NewListByVirtualNetworkPager - Lists DNS resolver resource IDs linked to a virtual network.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • virtualNetworkName - The name of the virtual network.
  • options - DNSResolversClientListByVirtualNetworkOptions contains the optional parameters for the DNSResolversClient.NewListByVirtualNetworkPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsResolver_ListByVirtualNetwork.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDNSResolversClient().NewListByVirtualNetworkPager("sampleResourceGroup", "sampleVirtualNetwork", &armdnsresolver.DNSResolversClientListByVirtualNetworkOptions{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.SubResourceListResult = armdnsresolver.SubResourceListResult{
		// 	Value: []*armdnsresolver.SubResource{
		// 		{
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver1"),
		// 	}},
		// }
	}
}
Output:

func (*DNSResolversClient) NewListPager added in v0.3.0

NewListPager - Lists DNS resolvers in all resource groups of a subscription.

Generated from API version 2022-07-01

  • options - DNSResolversClientListOptions contains the optional parameters for the DNSResolversClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsResolver_ListBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDNSResolversClient().NewListPager(&armdnsresolver.DNSResolversClientListOptions{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.ListResult = armdnsresolver.ListResult{
		// 	Value: []*armdnsresolver.DNSResolver{
		// 		{
		// 			Name: to.Ptr("sampleDnsResolver1"),
		// 			Type: to.Ptr("Microsoft.Network/dnsResolvers"),
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver1"),
		// 			Location: to.Ptr("westus2"),
		// 			Tags: map[string]*string{
		// 				"key1": to.Ptr("value1"),
		// 			},
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armdnsresolver.Properties{
		// 				DNSResolverState: to.Ptr(armdnsresolver.DNSResolverStateConnected),
		// 				ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
		// 				ResourceGUID: to.Ptr("ad9c8da4-3bb2-4821-a878-c2cb07b01fb6"),
		// 				VirtualNetwork: &armdnsresolver.SubResource{
		// 					ID: to.Ptr("/subscriptions/cbb1387e-4b03-44f2-ad41-58d4677b9873/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork1"),
		// 				},
		// 			},
		// 			SystemData: &armdnsresolver.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
		// 				CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
		// 				LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("sampleDnsResolver2"),
		// 			Type: to.Ptr("Microsoft.Network/dnsResolvers"),
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver2"),
		// 			Location: to.Ptr("westus2"),
		// 			Tags: map[string]*string{
		// 				"key1": to.Ptr("value1"),
		// 			},
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armdnsresolver.Properties{
		// 				DNSResolverState: to.Ptr(armdnsresolver.DNSResolverStateConnected),
		// 				ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
		// 				ResourceGUID: to.Ptr("b6b2d964-8588-4e3a-a7fe-8a5b7fe8eca5"),
		// 				VirtualNetwork: &armdnsresolver.SubResource{
		// 					ID: to.Ptr("/subscriptions/cbb1387e-4b03-44f2-ad41-58d4677b9873/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork2"),
		// 				},
		// 			},
		// 			SystemData: &armdnsresolver.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
		// 				CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
		// 				LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 			},
		// 	}},
		// }
	}
}
Output:

type DNSResolversClientBeginCreateOrUpdateOptions

type DNSResolversClientBeginCreateOrUpdateOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string

	// Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored.
	IfNoneMatch *string

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

DNSResolversClientBeginCreateOrUpdateOptions contains the optional parameters for the DNSResolversClient.BeginCreateOrUpdate method.

type DNSResolversClientBeginDeleteOptions

type DNSResolversClientBeginDeleteOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string

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

DNSResolversClientBeginDeleteOptions contains the optional parameters for the DNSResolversClient.BeginDelete method.

type DNSResolversClientBeginUpdateOptions

type DNSResolversClientBeginUpdateOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string

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

DNSResolversClientBeginUpdateOptions contains the optional parameters for the DNSResolversClient.BeginUpdate method.

type DNSResolversClientCreateOrUpdateResponse

type DNSResolversClientCreateOrUpdateResponse struct {
	// Describes a DNS resolver.
	DNSResolver
}

DNSResolversClientCreateOrUpdateResponse contains the response from method DNSResolversClient.BeginCreateOrUpdate.

type DNSResolversClientDeleteResponse

type DNSResolversClientDeleteResponse struct {
}

DNSResolversClientDeleteResponse contains the response from method DNSResolversClient.BeginDelete.

type DNSResolversClientGetOptions

type DNSResolversClientGetOptions struct {
}

DNSResolversClientGetOptions contains the optional parameters for the DNSResolversClient.Get method.

type DNSResolversClientGetResponse

type DNSResolversClientGetResponse struct {
	// Describes a DNS resolver.
	DNSResolver
}

DNSResolversClientGetResponse contains the response from method DNSResolversClient.Get.

type DNSResolversClientListByResourceGroupOptions

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

DNSResolversClientListByResourceGroupOptions contains the optional parameters for the DNSResolversClient.NewListByResourceGroupPager method.

type DNSResolversClientListByResourceGroupResponse

type DNSResolversClientListByResourceGroupResponse struct {
	// The response to an enumeration operation on DNS resolvers.
	ListResult
}

DNSResolversClientListByResourceGroupResponse contains the response from method DNSResolversClient.NewListByResourceGroupPager.

type DNSResolversClientListByVirtualNetworkOptions

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

DNSResolversClientListByVirtualNetworkOptions contains the optional parameters for the DNSResolversClient.NewListByVirtualNetworkPager method.

type DNSResolversClientListByVirtualNetworkResponse

type DNSResolversClientListByVirtualNetworkResponse struct {
	// The response to an enumeration operation on sub-resources.
	SubResourceListResult
}

DNSResolversClientListByVirtualNetworkResponse contains the response from method DNSResolversClient.NewListByVirtualNetworkPager.

type DNSResolversClientListOptions

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

DNSResolversClientListOptions contains the optional parameters for the DNSResolversClient.NewListPager method.

type DNSResolversClientListResponse

type DNSResolversClientListResponse struct {
	// The response to an enumeration operation on DNS resolvers.
	ListResult
}

DNSResolversClientListResponse contains the response from method DNSResolversClient.NewListPager.

type DNSResolversClientUpdateResponse

type DNSResolversClientUpdateResponse struct {
	// Describes a DNS resolver.
	DNSResolver
}

DNSResolversClientUpdateResponse contains the response from method DNSResolversClient.BeginUpdate.

type ForwardingRule

type ForwardingRule struct {
	// REQUIRED; Properties of the forwarding rule.
	Properties *ForwardingRuleProperties

	// READ-ONLY; ETag of the forwarding rule.
	Etag *string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ForwardingRule - Describes a forwarding rule within a DNS forwarding ruleset.

func (ForwardingRule) MarshalJSON added in v1.0.0

func (f ForwardingRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ForwardingRule.

func (*ForwardingRule) UnmarshalJSON added in v1.0.0

func (f *ForwardingRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ForwardingRule.

type ForwardingRuleListResult

type ForwardingRuleListResult struct {
	// Enumeration of the forwarding rules.
	Value []*ForwardingRule

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

ForwardingRuleListResult - The response to an enumeration operation on forwarding rules within a DNS forwarding ruleset.

func (ForwardingRuleListResult) MarshalJSON

func (f ForwardingRuleListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ForwardingRuleListResult.

func (*ForwardingRuleListResult) UnmarshalJSON added in v1.0.0

func (f *ForwardingRuleListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ForwardingRuleListResult.

type ForwardingRulePatch

type ForwardingRulePatch struct {
	// Updatable properties of the forwarding rule.
	Properties *ForwardingRulePatchProperties
}

ForwardingRulePatch - Describes a forwarding rule for PATCH operation.

func (ForwardingRulePatch) MarshalJSON

func (f ForwardingRulePatch) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ForwardingRulePatch.

func (*ForwardingRulePatch) UnmarshalJSON added in v1.0.0

func (f *ForwardingRulePatch) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ForwardingRulePatch.

type ForwardingRulePatchProperties

type ForwardingRulePatchProperties struct {
	// The state of forwarding rule.
	ForwardingRuleState *ForwardingRuleState

	// Metadata attached to the forwarding rule.
	Metadata map[string]*string

	// DNS servers to forward the DNS query to.
	TargetDNSServers []*TargetDNSServer
}

ForwardingRulePatchProperties - Represents the updatable properties of a forwarding rule within a DNS forwarding ruleset.

func (ForwardingRulePatchProperties) MarshalJSON

func (f ForwardingRulePatchProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ForwardingRulePatchProperties.

func (*ForwardingRulePatchProperties) UnmarshalJSON added in v1.0.0

func (f *ForwardingRulePatchProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ForwardingRulePatchProperties.

type ForwardingRuleProperties

type ForwardingRuleProperties struct {
	// REQUIRED; The domain name for the forwarding rule.
	DomainName *string

	// REQUIRED; DNS servers to forward the DNS query to.
	TargetDNSServers []*TargetDNSServer

	// The state of forwarding rule.
	ForwardingRuleState *ForwardingRuleState

	// Metadata attached to the forwarding rule.
	Metadata map[string]*string

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

ForwardingRuleProperties - Represents the properties of a forwarding rule within a DNS forwarding ruleset.

func (ForwardingRuleProperties) MarshalJSON

func (f ForwardingRuleProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ForwardingRuleProperties.

func (*ForwardingRuleProperties) UnmarshalJSON added in v1.0.0

func (f *ForwardingRuleProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ForwardingRuleProperties.

type ForwardingRuleState

type ForwardingRuleState string

ForwardingRuleState - The state of forwarding rule.

const (
	ForwardingRuleStateDisabled ForwardingRuleState = "Disabled"
	ForwardingRuleStateEnabled  ForwardingRuleState = "Enabled"
)

func PossibleForwardingRuleStateValues

func PossibleForwardingRuleStateValues() []ForwardingRuleState

PossibleForwardingRuleStateValues returns the possible values for the ForwardingRuleState const type.

type ForwardingRulesClient

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

ForwardingRulesClient contains the methods for the ForwardingRules group. Don't use this type directly, use NewForwardingRulesClient() instead.

func NewForwardingRulesClient

func NewForwardingRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ForwardingRulesClient, error)

NewForwardingRulesClient creates a new instance of ForwardingRulesClient with the specified values.

  • subscriptionID - The ID of the target subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ForwardingRulesClient) CreateOrUpdate

func (client *ForwardingRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, dnsForwardingRulesetName string, forwardingRuleName string, parameters ForwardingRule, options *ForwardingRulesClientCreateOrUpdateOptions) (ForwardingRulesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates a forwarding rule in a DNS forwarding ruleset. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsForwardingRulesetName - The name of the DNS forwarding ruleset.
  • forwardingRuleName - The name of the forwarding rule.
  • parameters - Parameters supplied to the CreateOrUpdate operation.
  • options - ForwardingRulesClientCreateOrUpdateOptions contains the optional parameters for the ForwardingRulesClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/ForwardingRule_Put.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/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewForwardingRulesClient().CreateOrUpdate(ctx, "sampleResourceGroup", "sampleDnsForwardingRuleset", "sampleForwardingRule", armdnsresolver.ForwardingRule{
		Properties: &armdnsresolver.ForwardingRuleProperties{
			DomainName:          to.Ptr("contoso.com."),
			ForwardingRuleState: to.Ptr(armdnsresolver.ForwardingRuleStateEnabled),
			Metadata: map[string]*string{
				"additionalProp1": to.Ptr("value1"),
			},
			TargetDNSServers: []*armdnsresolver.TargetDNSServer{
				{
					IPAddress: to.Ptr("10.0.0.1"),
					Port:      to.Ptr[int32](53),
				},
				{
					IPAddress: to.Ptr("10.0.0.2"),
					Port:      to.Ptr[int32](53),
				}},
		},
	}, &armdnsresolver.ForwardingRulesClientCreateOrUpdateOptions{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.ForwardingRule = armdnsresolver.ForwardingRule{
	// 	Name: to.Ptr("sampleForwardingRule"),
	// 	Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets/forwardingRules"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRulesets/sampleDnsForwardingRuleset/forwardingRules/sampleForwardingRule"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.ForwardingRuleProperties{
	// 		DomainName: to.Ptr("contoso.com."),
	// 		ForwardingRuleState: to.Ptr(armdnsresolver.ForwardingRuleStateEnabled),
	// 		Metadata: map[string]*string{
	// 			"additionalProp1": to.Ptr("value1"),
	// 		},
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		TargetDNSServers: []*armdnsresolver.TargetDNSServer{
	// 			{
	// 				IPAddress: to.Ptr("10.0.0.1"),
	// 				Port: to.Ptr[int32](53),
	// 			},
	// 			{
	// 				IPAddress: to.Ptr("10.0.0.2"),
	// 				Port: to.Ptr[int32](53),
	// 		}},
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*ForwardingRulesClient) Delete

func (client *ForwardingRulesClient) Delete(ctx context.Context, resourceGroupName string, dnsForwardingRulesetName string, forwardingRuleName string, options *ForwardingRulesClientDeleteOptions) (ForwardingRulesClientDeleteResponse, error)

Delete - Deletes a forwarding rule in a DNS forwarding ruleset. WARNING: This operation cannot be undone. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsForwardingRulesetName - The name of the DNS forwarding ruleset.
  • forwardingRuleName - The name of the forwarding rule.
  • options - ForwardingRulesClientDeleteOptions contains the optional parameters for the ForwardingRulesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/ForwardingRule_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewForwardingRulesClient().Delete(ctx, "sampleResourceGroup", "sampleDnsForwardingRuleset", "sampleForwardingRule", &armdnsresolver.ForwardingRulesClientDeleteOptions{IfMatch: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ForwardingRulesClient) Get

func (client *ForwardingRulesClient) Get(ctx context.Context, resourceGroupName string, dnsForwardingRulesetName string, forwardingRuleName string, options *ForwardingRulesClientGetOptions) (ForwardingRulesClientGetResponse, error)

Get - Gets properties of a forwarding rule in a DNS forwarding ruleset. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsForwardingRulesetName - The name of the DNS forwarding ruleset.
  • forwardingRuleName - The name of the forwarding rule.
  • options - ForwardingRulesClientGetOptions contains the optional parameters for the ForwardingRulesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/ForwardingRule_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewForwardingRulesClient().Get(ctx, "sampleResourceGroup", "sampleDnsForwardingRuleset", "sampleForwardingRule", 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.ForwardingRule = armdnsresolver.ForwardingRule{
	// 	Name: to.Ptr("sampleForwardingRule"),
	// 	Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets/forwardingRules"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRulesets/sampleDnsForwardingRuleset/forwardingRules/sampleForwardingRule"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.ForwardingRuleProperties{
	// 		DomainName: to.Ptr("contoso.com."),
	// 		ForwardingRuleState: to.Ptr(armdnsresolver.ForwardingRuleStateEnabled),
	// 		Metadata: map[string]*string{
	// 			"additionalProp1": to.Ptr("value1"),
	// 		},
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		TargetDNSServers: []*armdnsresolver.TargetDNSServer{
	// 			{
	// 				IPAddress: to.Ptr("10.0.0.1"),
	// 				Port: to.Ptr[int32](53),
	// 			},
	// 			{
	// 				IPAddress: to.Ptr("10.0.0.2"),
	// 				Port: to.Ptr[int32](53),
	// 		}},
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*ForwardingRulesClient) NewListPager added in v0.3.0

func (client *ForwardingRulesClient) NewListPager(resourceGroupName string, dnsForwardingRulesetName string, options *ForwardingRulesClientListOptions) *runtime.Pager[ForwardingRulesClientListResponse]

NewListPager - Lists forwarding rules in a DNS forwarding ruleset.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsForwardingRulesetName - The name of the DNS forwarding ruleset.
  • options - ForwardingRulesClientListOptions contains the optional parameters for the ForwardingRulesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/ForwardingRule_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewForwardingRulesClient().NewListPager("sampleResourceGroup", "sampleDnsForwardingRuleset", &armdnsresolver.ForwardingRulesClientListOptions{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.ForwardingRuleListResult = armdnsresolver.ForwardingRuleListResult{
		// 	Value: []*armdnsresolver.ForwardingRule{
		// 		{
		// 			Name: to.Ptr("sampleForwardingRule"),
		// 			Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets/forwardingRules"),
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRulesets/sampleDnsForwardingRuleset/forwardingRules/sampleForwardingRule"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armdnsresolver.ForwardingRuleProperties{
		// 				DomainName: to.Ptr("contoso.com."),
		// 				ForwardingRuleState: to.Ptr(armdnsresolver.ForwardingRuleStateEnabled),
		// 				Metadata: map[string]*string{
		// 					"additionalProp1": to.Ptr("value1"),
		// 				},
		// 				ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
		// 				TargetDNSServers: []*armdnsresolver.TargetDNSServer{
		// 					{
		// 						IPAddress: to.Ptr("10.0.0.1"),
		// 						Port: to.Ptr[int32](53),
		// 					},
		// 					{
		// 						IPAddress: to.Ptr("10.0.0.2"),
		// 						Port: to.Ptr[int32](53),
		// 				}},
		// 			},
		// 			SystemData: &armdnsresolver.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
		// 				CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
		// 				LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("sampleForwardingRule1"),
		// 			Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets/forwardingRules"),
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRulesets/sampleDnsForwardingRuleset/forwardingRules/sampleForwardingRule1"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armdnsresolver.ForwardingRuleProperties{
		// 				DomainName: to.Ptr("foobar.com."),
		// 				ForwardingRuleState: to.Ptr(armdnsresolver.ForwardingRuleStateEnabled),
		// 				Metadata: map[string]*string{
		// 					"additionalProp1": to.Ptr("value1"),
		// 				},
		// 				ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
		// 				TargetDNSServers: []*armdnsresolver.TargetDNSServer{
		// 					{
		// 						IPAddress: to.Ptr("10.0.0.3"),
		// 						Port: to.Ptr[int32](53),
		// 					},
		// 					{
		// 						IPAddress: to.Ptr("10.0.0.4"),
		// 						Port: to.Ptr[int32](53),
		// 				}},
		// 			},
		// 			SystemData: &armdnsresolver.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
		// 				CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
		// 				LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ForwardingRulesClient) Update

func (client *ForwardingRulesClient) Update(ctx context.Context, resourceGroupName string, dnsForwardingRulesetName string, forwardingRuleName string, parameters ForwardingRulePatch, options *ForwardingRulesClientUpdateOptions) (ForwardingRulesClientUpdateResponse, error)

Update - Updates a forwarding rule in a DNS forwarding ruleset. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsForwardingRulesetName - The name of the DNS forwarding ruleset.
  • forwardingRuleName - The name of the forwarding rule.
  • parameters - Parameters supplied to the Update operation.
  • options - ForwardingRulesClientUpdateOptions contains the optional parameters for the ForwardingRulesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/ForwardingRule_Patch.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/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewForwardingRulesClient().Update(ctx, "sampleResourceGroup", "sampleDnsForwardingRuleset", "sampleForwardingRule", armdnsresolver.ForwardingRulePatch{
		Properties: &armdnsresolver.ForwardingRulePatchProperties{
			ForwardingRuleState: to.Ptr(armdnsresolver.ForwardingRuleStateDisabled),
			Metadata: map[string]*string{
				"additionalProp2": to.Ptr("value2"),
			},
		},
	}, &armdnsresolver.ForwardingRulesClientUpdateOptions{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.ForwardingRule = armdnsresolver.ForwardingRule{
	// 	Name: to.Ptr("sampleForwardingRule"),
	// 	Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets/forwardingRules"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRulesets/sampleDnsForwardingRuleset/forwardingRules/sampleForwardingRule"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.ForwardingRuleProperties{
	// 		DomainName: to.Ptr("contoso.com."),
	// 		ForwardingRuleState: to.Ptr(armdnsresolver.ForwardingRuleStateDisabled),
	// 		Metadata: map[string]*string{
	// 			"additionalProp2": to.Ptr("value2"),
	// 		},
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		TargetDNSServers: []*armdnsresolver.TargetDNSServer{
	// 			{
	// 				IPAddress: to.Ptr("10.0.0.1"),
	// 				Port: to.Ptr[int32](53),
	// 			},
	// 			{
	// 				IPAddress: to.Ptr("10.0.0.2"),
	// 				Port: to.Ptr[int32](53),
	// 		}},
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

type ForwardingRulesClientCreateOrUpdateOptions

type ForwardingRulesClientCreateOrUpdateOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string

	// Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored.
	IfNoneMatch *string
}

ForwardingRulesClientCreateOrUpdateOptions contains the optional parameters for the ForwardingRulesClient.CreateOrUpdate method.

type ForwardingRulesClientCreateOrUpdateResponse

type ForwardingRulesClientCreateOrUpdateResponse struct {
	// Describes a forwarding rule within a DNS forwarding ruleset.
	ForwardingRule
}

ForwardingRulesClientCreateOrUpdateResponse contains the response from method ForwardingRulesClient.CreateOrUpdate.

type ForwardingRulesClientDeleteOptions

type ForwardingRulesClientDeleteOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string
}

ForwardingRulesClientDeleteOptions contains the optional parameters for the ForwardingRulesClient.Delete method.

type ForwardingRulesClientDeleteResponse

type ForwardingRulesClientDeleteResponse struct {
}

ForwardingRulesClientDeleteResponse contains the response from method ForwardingRulesClient.Delete.

type ForwardingRulesClientGetOptions

type ForwardingRulesClientGetOptions struct {
}

ForwardingRulesClientGetOptions contains the optional parameters for the ForwardingRulesClient.Get method.

type ForwardingRulesClientGetResponse

type ForwardingRulesClientGetResponse struct {
	// Describes a forwarding rule within a DNS forwarding ruleset.
	ForwardingRule
}

ForwardingRulesClientGetResponse contains the response from method ForwardingRulesClient.Get.

type ForwardingRulesClientListOptions

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

ForwardingRulesClientListOptions contains the optional parameters for the ForwardingRulesClient.NewListPager method.

type ForwardingRulesClientListResponse

type ForwardingRulesClientListResponse struct {
	// The response to an enumeration operation on forwarding rules within a DNS forwarding ruleset.
	ForwardingRuleListResult
}

ForwardingRulesClientListResponse contains the response from method ForwardingRulesClient.NewListPager.

type ForwardingRulesClientUpdateOptions

type ForwardingRulesClientUpdateOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string
}

ForwardingRulesClientUpdateOptions contains the optional parameters for the ForwardingRulesClient.Update method.

type ForwardingRulesClientUpdateResponse

type ForwardingRulesClientUpdateResponse struct {
	// Describes a forwarding rule within a DNS forwarding ruleset.
	ForwardingRule
}

ForwardingRulesClientUpdateResponse contains the response from method ForwardingRulesClient.Update.

type IPAllocationMethod

type IPAllocationMethod string

IPAllocationMethod - Private IP address allocation method.

const (
	IPAllocationMethodDynamic IPAllocationMethod = "Dynamic"
	IPAllocationMethodStatic  IPAllocationMethod = "Static"
)

func PossibleIPAllocationMethodValues

func PossibleIPAllocationMethodValues() []IPAllocationMethod

PossibleIPAllocationMethodValues returns the possible values for the IPAllocationMethod const type.

type IPConfiguration

type IPConfiguration struct {
	// REQUIRED; The reference to the subnet bound to the IP configuration.
	Subnet *SubResource

	// Private IP address of the IP configuration.
	PrivateIPAddress *string

	// Private IP address allocation method.
	PrivateIPAllocationMethod *IPAllocationMethod
}

IPConfiguration - IP configuration.

func (IPConfiguration) MarshalJSON added in v1.0.0

func (i IPConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IPConfiguration.

func (*IPConfiguration) UnmarshalJSON added in v1.0.0

func (i *IPConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IPConfiguration.

type InboundEndpoint

type InboundEndpoint struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// REQUIRED; Properties of the inbound endpoint.
	Properties *InboundEndpointProperties

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

	// READ-ONLY; ETag of the inbound endpoint.
	Etag *string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

InboundEndpoint - Describes an inbound endpoint for a DNS resolver.

func (InboundEndpoint) MarshalJSON

func (i InboundEndpoint) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InboundEndpoint.

func (*InboundEndpoint) UnmarshalJSON added in v1.0.0

func (i *InboundEndpoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type InboundEndpoint.

type InboundEndpointListResult

type InboundEndpointListResult struct {
	// Enumeration of the inbound endpoints for a DNS resolver.
	Value []*InboundEndpoint

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

InboundEndpointListResult - The response to an enumeration operation on inbound endpoints for a DNS resolver.

func (InboundEndpointListResult) MarshalJSON

func (i InboundEndpointListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InboundEndpointListResult.

func (*InboundEndpointListResult) UnmarshalJSON added in v1.0.0

func (i *InboundEndpointListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type InboundEndpointListResult.

type InboundEndpointPatch

type InboundEndpointPatch struct {
	// Tags for inbound endpoint.
	Tags map[string]*string
}

InboundEndpointPatch - Describes an inbound endpoint for a DNS resolver for PATCH operation.

func (InboundEndpointPatch) MarshalJSON

func (i InboundEndpointPatch) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InboundEndpointPatch.

func (*InboundEndpointPatch) UnmarshalJSON added in v1.0.0

func (i *InboundEndpointPatch) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type InboundEndpointPatch.

type InboundEndpointProperties

type InboundEndpointProperties struct {
	// REQUIRED; IP configurations for the inbound endpoint.
	IPConfigurations []*IPConfiguration

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

	// READ-ONLY; The resourceGuid property of the inbound endpoint resource.
	ResourceGUID *string
}

InboundEndpointProperties - Represents the properties of an inbound endpoint for a DNS resolver.

func (InboundEndpointProperties) MarshalJSON

func (i InboundEndpointProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InboundEndpointProperties.

func (*InboundEndpointProperties) UnmarshalJSON added in v1.0.0

func (i *InboundEndpointProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type InboundEndpointProperties.

type InboundEndpointsClient

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

InboundEndpointsClient contains the methods for the InboundEndpoints group. Don't use this type directly, use NewInboundEndpointsClient() instead.

func NewInboundEndpointsClient

func NewInboundEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InboundEndpointsClient, error)

NewInboundEndpointsClient creates a new instance of InboundEndpointsClient with the specified values.

  • subscriptionID - The ID of the target subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*InboundEndpointsClient) BeginCreateOrUpdate

func (client *InboundEndpointsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, dnsResolverName string, inboundEndpointName string, parameters InboundEndpoint, options *InboundEndpointsClientBeginCreateOrUpdateOptions) (*runtime.Poller[InboundEndpointsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates an inbound endpoint for a DNS resolver. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsResolverName - The name of the DNS resolver.
  • inboundEndpointName - The name of the inbound endpoint for the DNS resolver.
  • parameters - Parameters supplied to the CreateOrUpdate operation.
  • options - InboundEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the InboundEndpointsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/InboundEndpoint_Put.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/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewInboundEndpointsClient().BeginCreateOrUpdate(ctx, "sampleResourceGroup", "sampleDnsResolver", "sampleInboundEndpoint", armdnsresolver.InboundEndpoint{
		Location: to.Ptr("westus2"),
		Tags: map[string]*string{
			"key1": to.Ptr("value1"),
		},
		Properties: &armdnsresolver.InboundEndpointProperties{
			IPConfigurations: []*armdnsresolver.IPConfiguration{
				{
					PrivateIPAllocationMethod: to.Ptr(armdnsresolver.IPAllocationMethodDynamic),
					Subnet: &armdnsresolver.SubResource{
						ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet"),
					},
				}},
		},
	}, &armdnsresolver.InboundEndpointsClientBeginCreateOrUpdateOptions{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.InboundEndpoint = armdnsresolver.InboundEndpoint{
	// 	Name: to.Ptr("sampleInboundEndpoint"),
	// 	Type: to.Ptr("Microsoft.Network/dnsResolvers/inboundEndpoints"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/inboundEndpoints/sampleInboundEndpoint"),
	// 	Location: to.Ptr("westus2"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.InboundEndpointProperties{
	// 		IPConfigurations: []*armdnsresolver.IPConfiguration{
	// 			{
	// 				PrivateIPAddress: to.Ptr("255.255.255.255"),
	// 				PrivateIPAllocationMethod: to.Ptr(armdnsresolver.IPAllocationMethodDynamic),
	// 				Subnet: &armdnsresolver.SubResource{
	// 					ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet"),
	// 				},
	// 		}},
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		ResourceGUID: to.Ptr("87b3e20a-5833-4c40-8ad7-c5160bb1c5bd"),
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*InboundEndpointsClient) BeginDelete

func (client *InboundEndpointsClient) BeginDelete(ctx context.Context, resourceGroupName string, dnsResolverName string, inboundEndpointName string, options *InboundEndpointsClientBeginDeleteOptions) (*runtime.Poller[InboundEndpointsClientDeleteResponse], error)

BeginDelete - Deletes an inbound endpoint for a DNS resolver. WARNING: This operation cannot be undone. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsResolverName - The name of the DNS resolver.
  • inboundEndpointName - The name of the inbound endpoint for the DNS resolver.
  • options - InboundEndpointsClientBeginDeleteOptions contains the optional parameters for the InboundEndpointsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/InboundEndpoint_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewInboundEndpointsClient().BeginDelete(ctx, "sampleResourceGroup", "sampleDnsResolver", "sampleInboundEndpoint", &armdnsresolver.InboundEndpointsClientBeginDeleteOptions{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 (*InboundEndpointsClient) BeginUpdate

func (client *InboundEndpointsClient) BeginUpdate(ctx context.Context, resourceGroupName string, dnsResolverName string, inboundEndpointName string, parameters InboundEndpointPatch, options *InboundEndpointsClientBeginUpdateOptions) (*runtime.Poller[InboundEndpointsClientUpdateResponse], error)

BeginUpdate - Updates an inbound endpoint for a DNS resolver. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsResolverName - The name of the DNS resolver.
  • inboundEndpointName - The name of the inbound endpoint for the DNS resolver.
  • parameters - Parameters supplied to the Update operation.
  • options - InboundEndpointsClientBeginUpdateOptions contains the optional parameters for the InboundEndpointsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/InboundEndpoint_Patch.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/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewInboundEndpointsClient().BeginUpdate(ctx, "sampleResourceGroup", "sampleDnsResolver", "sampleInboundEndpoint", armdnsresolver.InboundEndpointPatch{
		Tags: map[string]*string{
			"key1": to.Ptr("value1"),
		},
	}, &armdnsresolver.InboundEndpointsClientBeginUpdateOptions{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.InboundEndpoint = armdnsresolver.InboundEndpoint{
	// 	Name: to.Ptr("sampleInboundEndpoint"),
	// 	Type: to.Ptr("Microsoft.Network/dnsResolvers/inboundEndpoints"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/inboundEndpoints/sampleInboundEndpoint"),
	// 	Location: to.Ptr("westus2"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.InboundEndpointProperties{
	// 		IPConfigurations: []*armdnsresolver.IPConfiguration{
	// 			{
	// 				PrivateIPAddress: to.Ptr("255.255.255.255"),
	// 				PrivateIPAllocationMethod: to.Ptr(armdnsresolver.IPAllocationMethodDynamic),
	// 				Subnet: &armdnsresolver.SubResource{
	// 					ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet"),
	// 				},
	// 		}},
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		ResourceGUID: to.Ptr("87b3e20a-5833-4c40-8ad7-c5160bb1c5bd"),
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*InboundEndpointsClient) Get

func (client *InboundEndpointsClient) Get(ctx context.Context, resourceGroupName string, dnsResolverName string, inboundEndpointName string, options *InboundEndpointsClientGetOptions) (InboundEndpointsClientGetResponse, error)

Get - Gets properties of an inbound endpoint for a DNS resolver. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsResolverName - The name of the DNS resolver.
  • inboundEndpointName - The name of the inbound endpoint for the DNS resolver.
  • options - InboundEndpointsClientGetOptions contains the optional parameters for the InboundEndpointsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/InboundEndpoint_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewInboundEndpointsClient().Get(ctx, "sampleResourceGroup", "sampleDnsResolver", "sampleInboundEndpoint", 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.InboundEndpoint = armdnsresolver.InboundEndpoint{
	// 	Name: to.Ptr("sampleInboundEndpoint"),
	// 	Type: to.Ptr("Microsoft.Network/dnsResolvers/inboundEndpoints"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/inboundEndpoints/sampleInboundEndpoint"),
	// 	Location: to.Ptr("westus2"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.InboundEndpointProperties{
	// 		IPConfigurations: []*armdnsresolver.IPConfiguration{
	// 			{
	// 				PrivateIPAddress: to.Ptr("255.255.255.255"),
	// 				PrivateIPAllocationMethod: to.Ptr(armdnsresolver.IPAllocationMethodDynamic),
	// 				Subnet: &armdnsresolver.SubResource{
	// 					ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet"),
	// 				},
	// 		}},
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		ResourceGUID: to.Ptr("b6b2d964-8588-4e3a-a7fe-8a5b7fe8eca5"),
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*InboundEndpointsClient) NewListPager added in v0.3.0

func (client *InboundEndpointsClient) NewListPager(resourceGroupName string, dnsResolverName string, options *InboundEndpointsClientListOptions) *runtime.Pager[InboundEndpointsClientListResponse]

NewListPager - Lists inbound endpoints for a DNS resolver.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsResolverName - The name of the DNS resolver.
  • options - InboundEndpointsClientListOptions contains the optional parameters for the InboundEndpointsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/InboundEndpoint_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewInboundEndpointsClient().NewListPager("sampleResourceGroup", "sampleDnsResolver", &armdnsresolver.InboundEndpointsClientListOptions{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.InboundEndpointListResult = armdnsresolver.InboundEndpointListResult{
		// 	Value: []*armdnsresolver.InboundEndpoint{
		// 		{
		// 			Name: to.Ptr("sampleInboundEndpoint1"),
		// 			Type: to.Ptr("Microsoft.Network/dnsResolvers/inboundEndpoints"),
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/inboundEndpoints/sampleInboundEndpoint1"),
		// 			Location: to.Ptr("westus2"),
		// 			Tags: map[string]*string{
		// 				"key1": to.Ptr("value1"),
		// 			},
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armdnsresolver.InboundEndpointProperties{
		// 				IPConfigurations: []*armdnsresolver.IPConfiguration{
		// 					{
		// 						PrivateIPAddress: to.Ptr("255.1.255.1"),
		// 						PrivateIPAllocationMethod: to.Ptr(armdnsresolver.IPAllocationMethodDynamic),
		// 						Subnet: &armdnsresolver.SubResource{
		// 							ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet1"),
		// 						},
		// 				}},
		// 				ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
		// 				ResourceGUID: to.Ptr("b6b2d964-8588-4e3a-a7fe-8a5b7fe8eca5"),
		// 			},
		// 			SystemData: &armdnsresolver.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
		// 				CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
		// 				LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("sampleInboundEndpoint2"),
		// 			Type: to.Ptr("Microsoft.Network/dnsResolvers/inboundEndpoints"),
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/inboundEndpoints/sampleInboundEndpoint2"),
		// 			Location: to.Ptr("westus2"),
		// 			Tags: map[string]*string{
		// 				"key1": to.Ptr("value1"),
		// 			},
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armdnsresolver.InboundEndpointProperties{
		// 				IPConfigurations: []*armdnsresolver.IPConfiguration{
		// 					{
		// 						PrivateIPAddress: to.Ptr("1.1.255.1"),
		// 						PrivateIPAllocationMethod: to.Ptr(armdnsresolver.IPAllocationMethodDynamic),
		// 						Subnet: &armdnsresolver.SubResource{
		// 							ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet1"),
		// 						},
		// 				}},
		// 				ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
		// 				ResourceGUID: to.Ptr("87b3e20a-5833-4c40-8ad7-c5160bb1c5bd"),
		// 			},
		// 			SystemData: &armdnsresolver.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T01:01:01.107Z"); return t}()),
		// 				CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-03T02:03:01.197Z"); return t}()),
		// 				LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 			},
		// 	}},
		// }
	}
}
Output:

type InboundEndpointsClientBeginCreateOrUpdateOptions

type InboundEndpointsClientBeginCreateOrUpdateOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string

	// Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored.
	IfNoneMatch *string

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

InboundEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the InboundEndpointsClient.BeginCreateOrUpdate method.

type InboundEndpointsClientBeginDeleteOptions

type InboundEndpointsClientBeginDeleteOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string

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

InboundEndpointsClientBeginDeleteOptions contains the optional parameters for the InboundEndpointsClient.BeginDelete method.

type InboundEndpointsClientBeginUpdateOptions

type InboundEndpointsClientBeginUpdateOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string

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

InboundEndpointsClientBeginUpdateOptions contains the optional parameters for the InboundEndpointsClient.BeginUpdate method.

type InboundEndpointsClientCreateOrUpdateResponse

type InboundEndpointsClientCreateOrUpdateResponse struct {
	// Describes an inbound endpoint for a DNS resolver.
	InboundEndpoint
}

InboundEndpointsClientCreateOrUpdateResponse contains the response from method InboundEndpointsClient.BeginCreateOrUpdate.

type InboundEndpointsClientDeleteResponse

type InboundEndpointsClientDeleteResponse struct {
}

InboundEndpointsClientDeleteResponse contains the response from method InboundEndpointsClient.BeginDelete.

type InboundEndpointsClientGetOptions

type InboundEndpointsClientGetOptions struct {
}

InboundEndpointsClientGetOptions contains the optional parameters for the InboundEndpointsClient.Get method.

type InboundEndpointsClientGetResponse

type InboundEndpointsClientGetResponse struct {
	// Describes an inbound endpoint for a DNS resolver.
	InboundEndpoint
}

InboundEndpointsClientGetResponse contains the response from method InboundEndpointsClient.Get.

type InboundEndpointsClientListOptions

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

InboundEndpointsClientListOptions contains the optional parameters for the InboundEndpointsClient.NewListPager method.

type InboundEndpointsClientListResponse

type InboundEndpointsClientListResponse struct {
	// The response to an enumeration operation on inbound endpoints for a DNS resolver.
	InboundEndpointListResult
}

InboundEndpointsClientListResponse contains the response from method InboundEndpointsClient.NewListPager.

type InboundEndpointsClientUpdateResponse

type InboundEndpointsClientUpdateResponse struct {
	// Describes an inbound endpoint for a DNS resolver.
	InboundEndpoint
}

InboundEndpointsClientUpdateResponse contains the response from method InboundEndpointsClient.BeginUpdate.

type ListResult

type ListResult struct {
	// Enumeration of the DNS resolvers.
	Value []*DNSResolver

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

ListResult - The response to an enumeration operation on DNS resolvers.

func (ListResult) MarshalJSON

func (l ListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ListResult.

func (*ListResult) UnmarshalJSON added in v1.0.0

func (l *ListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListResult.

type OutboundEndpoint

type OutboundEndpoint struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// REQUIRED; Properties of the outbound endpoint.
	Properties *OutboundEndpointProperties

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

	// READ-ONLY; ETag of the outbound endpoint.
	Etag *string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

OutboundEndpoint - Describes an outbound endpoint for a DNS resolver.

func (OutboundEndpoint) MarshalJSON

func (o OutboundEndpoint) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OutboundEndpoint.

func (*OutboundEndpoint) UnmarshalJSON added in v1.0.0

func (o *OutboundEndpoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEndpoint.

type OutboundEndpointListResult

type OutboundEndpointListResult struct {
	// Enumeration of the outbound endpoints for a DNS resolver.
	Value []*OutboundEndpoint

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

OutboundEndpointListResult - The response to an enumeration operation on outbound endpoints for a DNS resolver.

func (OutboundEndpointListResult) MarshalJSON

func (o OutboundEndpointListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OutboundEndpointListResult.

func (*OutboundEndpointListResult) UnmarshalJSON added in v1.0.0

func (o *OutboundEndpointListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEndpointListResult.

type OutboundEndpointPatch

type OutboundEndpointPatch struct {
	// Tags for outbound endpoint.
	Tags map[string]*string
}

OutboundEndpointPatch - Describes an outbound endpoint for a DNS resolver for PATCH operation.

func (OutboundEndpointPatch) MarshalJSON

func (o OutboundEndpointPatch) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OutboundEndpointPatch.

func (*OutboundEndpointPatch) UnmarshalJSON added in v1.0.0

func (o *OutboundEndpointPatch) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEndpointPatch.

type OutboundEndpointProperties

type OutboundEndpointProperties struct {
	// REQUIRED; The reference to the subnet used for the outbound endpoint.
	Subnet *SubResource

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

	// READ-ONLY; The resourceGuid property of the outbound endpoint resource.
	ResourceGUID *string
}

OutboundEndpointProperties - Represents the properties of an outbound endpoint for a DNS resolver.

func (OutboundEndpointProperties) MarshalJSON added in v1.0.0

func (o OutboundEndpointProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OutboundEndpointProperties.

func (*OutboundEndpointProperties) UnmarshalJSON added in v1.0.0

func (o *OutboundEndpointProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEndpointProperties.

type OutboundEndpointsClient

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

OutboundEndpointsClient contains the methods for the OutboundEndpoints group. Don't use this type directly, use NewOutboundEndpointsClient() instead.

func NewOutboundEndpointsClient

func NewOutboundEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OutboundEndpointsClient, error)

NewOutboundEndpointsClient creates a new instance of OutboundEndpointsClient with the specified values.

  • subscriptionID - The ID of the target subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OutboundEndpointsClient) BeginCreateOrUpdate

func (client *OutboundEndpointsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, dnsResolverName string, outboundEndpointName string, parameters OutboundEndpoint, options *OutboundEndpointsClientBeginCreateOrUpdateOptions) (*runtime.Poller[OutboundEndpointsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates an outbound endpoint for a DNS resolver. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsResolverName - The name of the DNS resolver.
  • outboundEndpointName - The name of the outbound endpoint for the DNS resolver.
  • parameters - Parameters supplied to the CreateOrUpdate operation.
  • options - OutboundEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the OutboundEndpointsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/OutboundEndpoint_Put.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/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewOutboundEndpointsClient().BeginCreateOrUpdate(ctx, "sampleResourceGroup", "sampleDnsResolver", "sampleOutboundEndpoint", armdnsresolver.OutboundEndpoint{
		Location: to.Ptr("westus2"),
		Tags: map[string]*string{
			"key1": to.Ptr("value1"),
		},
		Properties: &armdnsresolver.OutboundEndpointProperties{
			Subnet: &armdnsresolver.SubResource{
				ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet"),
			},
		},
	}, &armdnsresolver.OutboundEndpointsClientBeginCreateOrUpdateOptions{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.OutboundEndpoint = armdnsresolver.OutboundEndpoint{
	// 	Name: to.Ptr("sampleOutboundEndpoint"),
	// 	Type: to.Ptr("Microsoft.Network/dnsResolvers/outboundEndpoints"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/outboundEndpoints/sampleOutboundEndpoint"),
	// 	Location: to.Ptr("westus2"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.OutboundEndpointProperties{
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		ResourceGUID: to.Ptr("87b3e20a-5833-4c40-8ad7-c5160bb1c5bd"),
	// 		Subnet: &armdnsresolver.SubResource{
	// 			ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet"),
	// 		},
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*OutboundEndpointsClient) BeginDelete

func (client *OutboundEndpointsClient) BeginDelete(ctx context.Context, resourceGroupName string, dnsResolverName string, outboundEndpointName string, options *OutboundEndpointsClientBeginDeleteOptions) (*runtime.Poller[OutboundEndpointsClientDeleteResponse], error)

BeginDelete - Deletes an outbound endpoint for a DNS resolver. WARNING: This operation cannot be undone. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsResolverName - The name of the DNS resolver.
  • outboundEndpointName - The name of the outbound endpoint for the DNS resolver.
  • options - OutboundEndpointsClientBeginDeleteOptions contains the optional parameters for the OutboundEndpointsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/OutboundEndpoint_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewOutboundEndpointsClient().BeginDelete(ctx, "sampleResourceGroup", "sampleDnsResolver", "sampleOutboundEndpoint", &armdnsresolver.OutboundEndpointsClientBeginDeleteOptions{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 (*OutboundEndpointsClient) BeginUpdate

func (client *OutboundEndpointsClient) BeginUpdate(ctx context.Context, resourceGroupName string, dnsResolverName string, outboundEndpointName string, parameters OutboundEndpointPatch, options *OutboundEndpointsClientBeginUpdateOptions) (*runtime.Poller[OutboundEndpointsClientUpdateResponse], error)

BeginUpdate - Updates an outbound endpoint for a DNS resolver. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsResolverName - The name of the DNS resolver.
  • outboundEndpointName - The name of the outbound endpoint for the DNS resolver.
  • parameters - Parameters supplied to the Update operation.
  • options - OutboundEndpointsClientBeginUpdateOptions contains the optional parameters for the OutboundEndpointsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/OutboundEndpoint_Patch.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/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewOutboundEndpointsClient().BeginUpdate(ctx, "sampleResourceGroup", "sampleDnsResolver", "sampleOutboundEndpoint", armdnsresolver.OutboundEndpointPatch{
		Tags: map[string]*string{
			"key1": to.Ptr("value1"),
		},
	}, &armdnsresolver.OutboundEndpointsClientBeginUpdateOptions{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.OutboundEndpoint = armdnsresolver.OutboundEndpoint{
	// 	Name: to.Ptr("sampleOutboundEndpoint"),
	// 	Type: to.Ptr("Microsoft.Network/dnsResolvers/outboundEndpoints"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/outboundEndpoints/sampleOutboundEndpoint"),
	// 	Location: to.Ptr("westus2"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.OutboundEndpointProperties{
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		ResourceGUID: to.Ptr("b4d35f41-0c70-4ec7-bb3e-0cd9f8b7e4be"),
	// 		Subnet: &armdnsresolver.SubResource{
	// 			ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet"),
	// 		},
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*OutboundEndpointsClient) Get

func (client *OutboundEndpointsClient) Get(ctx context.Context, resourceGroupName string, dnsResolverName string, outboundEndpointName string, options *OutboundEndpointsClientGetOptions) (OutboundEndpointsClientGetResponse, error)

Get - Gets properties of an outbound endpoint for a DNS resolver. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsResolverName - The name of the DNS resolver.
  • outboundEndpointName - The name of the outbound endpoint for the DNS resolver.
  • options - OutboundEndpointsClientGetOptions contains the optional parameters for the OutboundEndpointsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/OutboundEndpoint_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOutboundEndpointsClient().Get(ctx, "sampleResourceGroup", "sampleDnsResolver", "sampleOutboundEndpoint", 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.OutboundEndpoint = armdnsresolver.OutboundEndpoint{
	// 	Name: to.Ptr("sampleOutboundEndpoint"),
	// 	Type: to.Ptr("Microsoft.Network/dnsResolvers/outboundEndpoints"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/outboundEndpoints/sampleOutboundEndpoint"),
	// 	Location: to.Ptr("westus2"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 	},
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.OutboundEndpointProperties{
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		ResourceGUID: to.Ptr("b4d35f41-0c70-4ec7-bb3e-0cd9f8b7e4be"),
	// 		Subnet: &armdnsresolver.SubResource{
	// 			ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet"),
	// 		},
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*OutboundEndpointsClient) NewListPager added in v0.3.0

func (client *OutboundEndpointsClient) NewListPager(resourceGroupName string, dnsResolverName string, options *OutboundEndpointsClientListOptions) *runtime.Pager[OutboundEndpointsClientListResponse]

NewListPager - Lists outbound endpoints for a DNS resolver.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsResolverName - The name of the DNS resolver.
  • options - OutboundEndpointsClientListOptions contains the optional parameters for the OutboundEndpointsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/OutboundEndpoint_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOutboundEndpointsClient().NewListPager("sampleResourceGroup", "sampleDnsResolver", &armdnsresolver.OutboundEndpointsClientListOptions{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.OutboundEndpointListResult = armdnsresolver.OutboundEndpointListResult{
		// 	Value: []*armdnsresolver.OutboundEndpoint{
		// 		{
		// 			Name: to.Ptr("sampleOutboundEndpoint"),
		// 			Type: to.Ptr("Microsoft.Network/dnsResolvers/outboundEndpoints"),
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/outboundEndpoints/sampleOutboundEndpoint"),
		// 			Location: to.Ptr("westus2"),
		// 			Tags: map[string]*string{
		// 				"key1": to.Ptr("value1"),
		// 			},
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armdnsresolver.OutboundEndpointProperties{
		// 				ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
		// 				ResourceGUID: to.Ptr("b4d35f41-0c70-4ec7-bb3e-0cd9f8b7e4be"),
		// 				Subnet: &armdnsresolver.SubResource{
		// 					ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet"),
		// 				},
		// 			},
		// 			SystemData: &armdnsresolver.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
		// 				CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
		// 				LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("sampleOutboundEndpoint1"),
		// 			Type: to.Ptr("Microsoft.Network/dnsResolvers/outboundEndpoints"),
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/outboundEndpoints/sampleOutboundEndpoint1"),
		// 			Location: to.Ptr("westus2"),
		// 			Tags: map[string]*string{
		// 				"key1": to.Ptr("value1"),
		// 			},
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armdnsresolver.OutboundEndpointProperties{
		// 				ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
		// 				ResourceGUID: to.Ptr("b4d35f41-0c70-4ec7-bb3e-0cd9f8b7e4be"),
		// 				Subnet: &armdnsresolver.SubResource{
		// 					ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet1"),
		// 				},
		// 			},
		// 			SystemData: &armdnsresolver.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
		// 				CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
		// 				LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 			},
		// 	}},
		// }
	}
}
Output:

type OutboundEndpointsClientBeginCreateOrUpdateOptions

type OutboundEndpointsClientBeginCreateOrUpdateOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string

	// Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored.
	IfNoneMatch *string

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

OutboundEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the OutboundEndpointsClient.BeginCreateOrUpdate method.

type OutboundEndpointsClientBeginDeleteOptions

type OutboundEndpointsClientBeginDeleteOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string

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

OutboundEndpointsClientBeginDeleteOptions contains the optional parameters for the OutboundEndpointsClient.BeginDelete method.

type OutboundEndpointsClientBeginUpdateOptions

type OutboundEndpointsClientBeginUpdateOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string

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

OutboundEndpointsClientBeginUpdateOptions contains the optional parameters for the OutboundEndpointsClient.BeginUpdate method.

type OutboundEndpointsClientCreateOrUpdateResponse

type OutboundEndpointsClientCreateOrUpdateResponse struct {
	// Describes an outbound endpoint for a DNS resolver.
	OutboundEndpoint
}

OutboundEndpointsClientCreateOrUpdateResponse contains the response from method OutboundEndpointsClient.BeginCreateOrUpdate.

type OutboundEndpointsClientDeleteResponse

type OutboundEndpointsClientDeleteResponse struct {
}

OutboundEndpointsClientDeleteResponse contains the response from method OutboundEndpointsClient.BeginDelete.

type OutboundEndpointsClientGetOptions

type OutboundEndpointsClientGetOptions struct {
}

OutboundEndpointsClientGetOptions contains the optional parameters for the OutboundEndpointsClient.Get method.

type OutboundEndpointsClientGetResponse

type OutboundEndpointsClientGetResponse struct {
	// Describes an outbound endpoint for a DNS resolver.
	OutboundEndpoint
}

OutboundEndpointsClientGetResponse contains the response from method OutboundEndpointsClient.Get.

type OutboundEndpointsClientListOptions

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

OutboundEndpointsClientListOptions contains the optional parameters for the OutboundEndpointsClient.NewListPager method.

type OutboundEndpointsClientListResponse

type OutboundEndpointsClientListResponse struct {
	// The response to an enumeration operation on outbound endpoints for a DNS resolver.
	OutboundEndpointListResult
}

OutboundEndpointsClientListResponse contains the response from method OutboundEndpointsClient.NewListPager.

type OutboundEndpointsClientUpdateResponse

type OutboundEndpointsClientUpdateResponse struct {
	// Describes an outbound endpoint for a DNS resolver.
	OutboundEndpoint
}

OutboundEndpointsClientUpdateResponse contains the response from method OutboundEndpointsClient.BeginUpdate.

type Patch

type Patch struct {
	// Tags for DNS Resolver.
	Tags map[string]*string
}

Patch - Describes a DNS resolver for PATCH operation.

func (Patch) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Patch.

func (*Patch) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Patch.

type Properties

type Properties struct {
	// REQUIRED; The reference to the virtual network. This cannot be changed after creation.
	VirtualNetwork *SubResource

	// READ-ONLY; The current status of the DNS resolver. This is a read-only property and any attempt to set this value will
	// be ignored.
	DNSResolverState *DNSResolverState

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

	// READ-ONLY; The resourceGuid property of the DNS resolver resource.
	ResourceGUID *string
}

Properties - Represents the properties of a DNS resolver.

func (Properties) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type Properties.

func (*Properties) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Properties.

type ProvisioningState

type ProvisioningState string

ProvisioningState - The current provisioning state of the resource.

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 SubResource

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

SubResource - Reference to another ARM resource.

func (SubResource) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type SubResource.

func (*SubResource) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubResource.

type SubResourceListResult

type SubResourceListResult struct {
	// Enumeration of the sub-resources.
	Value []*SubResource

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

SubResourceListResult - The response to an enumeration operation on sub-resources.

func (SubResourceListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SubResourceListResult.

func (*SubResourceListResult) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubResourceListResult.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type TargetDNSServer

type TargetDNSServer struct {
	// REQUIRED; DNS server IP address.
	IPAddress *string

	// DNS server port.
	Port *int32
}

TargetDNSServer - Describes a server to forward the DNS queries to.

func (TargetDNSServer) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type TargetDNSServer.

func (*TargetDNSServer) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TargetDNSServer.

type VirtualNetworkDNSForwardingRuleset

type VirtualNetworkDNSForwardingRuleset struct {
	// DNS Forwarding Ruleset Resource ID.
	ID *string

	// Properties of the virtual network link sub-resource reference.
	Properties *VirtualNetworkLinkSubResourceProperties
}

VirtualNetworkDNSForwardingRuleset - Reference to DNS forwarding ruleset and associated virtual network link.

func (VirtualNetworkDNSForwardingRuleset) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkDNSForwardingRuleset.

func (*VirtualNetworkDNSForwardingRuleset) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkDNSForwardingRuleset.

type VirtualNetworkDNSForwardingRulesetListResult

type VirtualNetworkDNSForwardingRulesetListResult struct {
	// Enumeration of the Virtual Network DNS Forwarding Ruleset.
	Value []*VirtualNetworkDNSForwardingRuleset

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

VirtualNetworkDNSForwardingRulesetListResult - The response to an enumeration operation on Virtual Network DNS Forwarding Ruleset.

func (VirtualNetworkDNSForwardingRulesetListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkDNSForwardingRulesetListResult.

func (*VirtualNetworkDNSForwardingRulesetListResult) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkDNSForwardingRulesetListResult.

type VirtualNetworkLink struct {
	// REQUIRED; Properties of the virtual network link.
	Properties *VirtualNetworkLinkProperties

	// READ-ONLY; ETag of the virtual network link.
	Etag *string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

VirtualNetworkLink - Describes a virtual network link.

func (VirtualNetworkLink) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLink.

func (*VirtualNetworkLink) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkLink.

type VirtualNetworkLinkListResult

type VirtualNetworkLinkListResult struct {
	// Enumeration of the virtual network links.
	Value []*VirtualNetworkLink

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

VirtualNetworkLinkListResult - The response to an enumeration operation on virtual network links.

func (VirtualNetworkLinkListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLinkListResult.

func (*VirtualNetworkLinkListResult) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkLinkListResult.

type VirtualNetworkLinkPatch

type VirtualNetworkLinkPatch struct {
	// Updatable properties of the virtual network link.
	Properties *VirtualNetworkLinkPatchProperties
}

VirtualNetworkLinkPatch - Describes a virtual network link for PATCH operation.

func (VirtualNetworkLinkPatch) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLinkPatch.

func (*VirtualNetworkLinkPatch) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkLinkPatch.

type VirtualNetworkLinkPatchProperties

type VirtualNetworkLinkPatchProperties struct {
	// Metadata attached to the virtual network link.
	Metadata map[string]*string
}

VirtualNetworkLinkPatchProperties - Represents the updatable properties of the virtual network link.

func (VirtualNetworkLinkPatchProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLinkPatchProperties.

func (*VirtualNetworkLinkPatchProperties) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkLinkPatchProperties.

type VirtualNetworkLinkProperties

type VirtualNetworkLinkProperties struct {
	// REQUIRED; The reference to the virtual network. This cannot be changed after creation.
	VirtualNetwork *SubResource

	// Metadata attached to the virtual network link.
	Metadata map[string]*string

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

VirtualNetworkLinkProperties - Represents the properties of a virtual network link.

func (VirtualNetworkLinkProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLinkProperties.

func (*VirtualNetworkLinkProperties) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkLinkProperties.

type VirtualNetworkLinkSubResourceProperties

type VirtualNetworkLinkSubResourceProperties struct {
	// The reference to the virtual network link.
	VirtualNetworkLink *SubResource
}

VirtualNetworkLinkSubResourceProperties - The reference to the virtual network link that associates between the DNS forwarding ruleset and virtual network.

func (VirtualNetworkLinkSubResourceProperties) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLinkSubResourceProperties.

func (*VirtualNetworkLinkSubResourceProperties) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkLinkSubResourceProperties.

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 - The ID of the target subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*VirtualNetworkLinksClient) BeginCreateOrUpdate

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

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

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsForwardingRulesetName - The name of the DNS forwarding ruleset.
  • 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/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/VirtualNetworkLink_Put.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/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualNetworkLinksClient().BeginCreateOrUpdate(ctx, "sampleResourceGroup", "sampleDnsForwardingRuleset", "sampleVirtualNetworkLink", armdnsresolver.VirtualNetworkLink{
		Properties: &armdnsresolver.VirtualNetworkLinkProperties{
			Metadata: map[string]*string{
				"additionalProp1": to.Ptr("value1"),
			},
			VirtualNetwork: &armdnsresolver.SubResource{
				ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork"),
			},
		},
	}, &armdnsresolver.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 = armdnsresolver.VirtualNetworkLink{
	// 	Name: to.Ptr("sampleVirtualNetworkLink"),
	// 	Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets/virtualNetworkLinks"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRuleset/sampleDnsForwardingRuleset/virtualNetworkLinks/sampleVirtualNetworkLink"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.VirtualNetworkLinkProperties{
	// 		Metadata: map[string]*string{
	// 			"additionalProp1": to.Ptr("value1"),
	// 		},
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		VirtualNetwork: &armdnsresolver.SubResource{
	// 			ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork"),
	// 		},
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*VirtualNetworkLinksClient) BeginDelete

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

BeginDelete - Deletes a virtual network link to a DNS forwarding ruleset. WARNING: This operation cannot be undone. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsForwardingRulesetName - The name of the DNS forwarding ruleset.
  • 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/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/VirtualNetworkLink_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualNetworkLinksClient().BeginDelete(ctx, "sampleResourceGroup", "sampleDnsForwardingRuleset", "sampleVirtualNetworkLink", &armdnsresolver.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, dnsForwardingRulesetName string, virtualNetworkLinkName string, parameters VirtualNetworkLinkPatch, options *VirtualNetworkLinksClientBeginUpdateOptions) (*runtime.Poller[VirtualNetworkLinksClientUpdateResponse], error)

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

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsForwardingRulesetName - The name of the DNS forwarding ruleset.
  • 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/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/VirtualNetworkLink_Patch.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/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualNetworkLinksClient().BeginUpdate(ctx, "sampleResourceGroup", "sampleDnsForwardingRuleset", "sampleVirtualNetworkLink", armdnsresolver.VirtualNetworkLinkPatch{
		Properties: &armdnsresolver.VirtualNetworkLinkPatchProperties{
			Metadata: map[string]*string{
				"additionalProp1": to.Ptr("value1"),
			},
		},
	}, &armdnsresolver.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 = armdnsresolver.VirtualNetworkLink{
	// 	Name: to.Ptr("sampleVirtualNetworkLink"),
	// 	Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets/virtualNetworkLinks"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRuleset/sampleDnsForwardingRuleset/virtualNetworkLinks/sampleVirtualNetworkLink"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.VirtualNetworkLinkProperties{
	// 		Metadata: map[string]*string{
	// 			"additionalProp1": to.Ptr("value1"),
	// 		},
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		VirtualNetwork: &armdnsresolver.SubResource{
	// 			ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork"),
	// 		},
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*VirtualNetworkLinksClient) Get

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

Get - Gets properties of a virtual network link to a DNS forwarding ruleset. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsForwardingRulesetName - The name of the DNS forwarding ruleset.
  • 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/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/VirtualNetworkLink_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualNetworkLinksClient().Get(ctx, "sampleResourceGroup", "sampleDnsForwardingRuleset", "sampleVirtualNetworkLink", 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 = armdnsresolver.VirtualNetworkLink{
	// 	Name: to.Ptr("sampleVirtualNetworkLink"),
	// 	Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets/virtualNetworkLinks"),
	// 	ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRuleset/sampleDnsForwardingRuleset/virtualNetworkLinks/sampleVirtualNetworkLink"),
	// 	Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	Properties: &armdnsresolver.VirtualNetworkLinkProperties{
	// 		Metadata: map[string]*string{
	// 			"additionalProp1": to.Ptr("value1"),
	// 		},
	// 		ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
	// 		VirtualNetwork: &armdnsresolver.SubResource{
	// 			ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork"),
	// 		},
	// 	},
	// 	SystemData: &armdnsresolver.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
	// 		CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
	// 		LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

func (*VirtualNetworkLinksClient) NewListPager added in v0.3.0

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

NewListPager - Lists virtual network links to a DNS forwarding ruleset.

Generated from API version 2022-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • dnsForwardingRulesetName - The name of the DNS forwarding ruleset.
  • 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/b749953e21e5c3f275d839862323920ef7bf716e/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/VirtualNetworkLink_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdnsresolver.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualNetworkLinksClient().NewListPager("sampleResourceGroup", "sampleDnsForwardingRuleset", &armdnsresolver.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 = armdnsresolver.VirtualNetworkLinkListResult{
		// 	Value: []*armdnsresolver.VirtualNetworkLink{
		// 		{
		// 			Name: to.Ptr("sampleVirtualNetworkLink"),
		// 			Type: to.Ptr("Microsoft.Network/dnsForwardingRulesets/virtualNetworkLinks"),
		// 			ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsForwardingRuleset/sampleDnsForwardingRuleset/virtualNetworkLinks/sampleVirtualNetworkLink"),
		// 			Etag: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			Properties: &armdnsresolver.VirtualNetworkLinkProperties{
		// 				Metadata: map[string]*string{
		// 					"additionalProp1": to.Ptr("value1"),
		// 				},
		// 				ProvisioningState: to.Ptr(armdnsresolver.ProvisioningStateSucceeded),
		// 				VirtualNetwork: &armdnsresolver.SubResource{
		// 					ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork"),
		// 				},
		// 			},
		// 			SystemData: &armdnsresolver.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T01:01:01.107Z"); return t}()),
		// 				CreatedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T02:03:01.197Z"); return t}()),
		// 				LastModifiedByType: to.Ptr(armdnsresolver.CreatedByTypeApplication),
		// 			},
		// 	}},
		// }
	}
}
Output:

type VirtualNetworkLinksClientBeginCreateOrUpdateOptions

type VirtualNetworkLinksClientBeginCreateOrUpdateOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting any concurrent changes.
	IfMatch *string

	// Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. 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

type VirtualNetworkLinksClientBeginDeleteOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent
	// accidentally overwriting 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

type VirtualNetworkLinksClientBeginUpdateOptions struct {
	// ETag of the resource. Omit this value to always overwrite the current resource. 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

type VirtualNetworkLinksClientCreateOrUpdateResponse struct {
	// Describes a virtual network link.
	VirtualNetworkLink
}

VirtualNetworkLinksClientCreateOrUpdateResponse contains the response from method VirtualNetworkLinksClient.BeginCreateOrUpdate.

type VirtualNetworkLinksClientDeleteResponse

type VirtualNetworkLinksClientDeleteResponse struct {
}

VirtualNetworkLinksClientDeleteResponse contains the response from method VirtualNetworkLinksClient.BeginDelete.

type VirtualNetworkLinksClientGetOptions

type VirtualNetworkLinksClientGetOptions struct {
}

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

type VirtualNetworkLinksClientGetResponse

type VirtualNetworkLinksClientGetResponse struct {
	// Describes a virtual network link.
	VirtualNetworkLink
}

VirtualNetworkLinksClientGetResponse contains the response from method VirtualNetworkLinksClient.Get.

type VirtualNetworkLinksClientListOptions

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

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

type VirtualNetworkLinksClientListResponse

type VirtualNetworkLinksClientListResponse struct {
	// The response to an enumeration operation on virtual network links.
	VirtualNetworkLinkListResult
}

VirtualNetworkLinksClientListResponse contains the response from method VirtualNetworkLinksClient.NewListPager.

type VirtualNetworkLinksClientUpdateResponse

type VirtualNetworkLinksClientUpdateResponse struct {
	// Describes a virtual network link.
	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