armtrafficmanager

package module
v1.1.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 16 Imported by: 4

README

Azure Traffic Manager Module for Go

PkgGoDev

The armtrafficmanager module provides operations for working with Azure Traffic Manager.

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 Traffic Manager module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Traffic Manager. 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.

Clients

Azure Traffic Manager modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential.

client, err := armtrafficmanager.NewHeatMapClient(<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,
    },
}
client, err := armtrafficmanager.NewHeatMapClient(<subscription ID>, cred, &options)

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Traffic Manager 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 AllowedEndpointRecordType

type AllowedEndpointRecordType string

AllowedEndpointRecordType - The allowed type DNS record types for this profile.

const (
	AllowedEndpointRecordTypeAny         AllowedEndpointRecordType = "Any"
	AllowedEndpointRecordTypeDomainName  AllowedEndpointRecordType = "DomainName"
	AllowedEndpointRecordTypeIPv4Address AllowedEndpointRecordType = "IPv4Address"
	AllowedEndpointRecordTypeIPv6Address AllowedEndpointRecordType = "IPv6Address"
)

func PossibleAllowedEndpointRecordTypeValues

func PossibleAllowedEndpointRecordTypeValues() []AllowedEndpointRecordType

PossibleAllowedEndpointRecordTypeValues returns the possible values for the AllowedEndpointRecordType const type.

type AlwaysServe added in v1.2.0

type AlwaysServe string

AlwaysServe - If Always Serve is enabled, probing for endpoint health will be disabled and endpoints will be included in the traffic routing method.

const (
	AlwaysServeDisabled AlwaysServe = "Disabled"
	AlwaysServeEnabled  AlwaysServe = "Enabled"
)

func PossibleAlwaysServeValues added in v1.2.0

func PossibleAlwaysServeValues() []AlwaysServe

PossibleAlwaysServeValues returns the possible values for the AlwaysServe const type.

type CheckTrafficManagerRelativeDNSNameAvailabilityParameters

type CheckTrafficManagerRelativeDNSNameAvailabilityParameters struct {
	// The name of the resource.
	Name *string `json:"name,omitempty"`

	// The type of the resource.
	Type *string `json:"type,omitempty"`
}

CheckTrafficManagerRelativeDNSNameAvailabilityParameters - Parameters supplied to check Traffic Manager name operation.

func (CheckTrafficManagerRelativeDNSNameAvailabilityParameters) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type CheckTrafficManagerRelativeDNSNameAvailabilityParameters.

func (*CheckTrafficManagerRelativeDNSNameAvailabilityParameters) UnmarshalJSON added in v1.1.0

UnmarshalJSON implements the json.Unmarshaller interface for type CheckTrafficManagerRelativeDNSNameAvailabilityParameters.

type DNSConfig

type DNSConfig struct {
	// The relative DNS name provided by this Traffic Manager profile. This value is combined with the DNS domain name used by
	// Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the
	// profile.
	RelativeName *string `json:"relativeName,omitempty"`

	// The DNS Time-To-Live (TTL), in seconds. This informs the local DNS resolvers and DNS clients how long to cache DNS responses
	// provided by this Traffic Manager profile.
	TTL *int64 `json:"ttl,omitempty"`

	// READ-ONLY; The fully-qualified domain name (FQDN) of the Traffic Manager profile. This is formed from the concatenation
	// of the RelativeName with the DNS domain used by Azure Traffic Manager.
	Fqdn *string `json:"fqdn,omitempty" azure:"ro"`
}

DNSConfig - Class containing DNS settings in a Traffic Manager profile.

func (DNSConfig) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type DNSConfig.

func (*DNSConfig) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DNSConfig.

type DeleteOperationResult

type DeleteOperationResult struct {
	// READ-ONLY; The result of the operation or request.
	OperationResult *bool `json:"boolean,omitempty" azure:"ro"`
}

DeleteOperationResult - The result of the request or operation.

func (DeleteOperationResult) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type DeleteOperationResult.

func (*DeleteOperationResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DeleteOperationResult.

type Endpoint

type Endpoint struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// The properties of the Traffic Manager endpoint.
	Properties *EndpointProperties `json:"properties,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

Endpoint - Class representing a Traffic Manager endpoint.

func (Endpoint) MarshalJSON

func (e Endpoint) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Endpoint.

func (*Endpoint) UnmarshalJSON added in v1.1.0

func (e *Endpoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Endpoint.

type EndpointMonitorStatus

type EndpointMonitorStatus string

EndpointMonitorStatus - The monitoring status of the endpoint.

const (
	EndpointMonitorStatusCheckingEndpoint EndpointMonitorStatus = "CheckingEndpoint"
	EndpointMonitorStatusDegraded         EndpointMonitorStatus = "Degraded"
	EndpointMonitorStatusDisabled         EndpointMonitorStatus = "Disabled"
	EndpointMonitorStatusInactive         EndpointMonitorStatus = "Inactive"
	EndpointMonitorStatusOnline           EndpointMonitorStatus = "Online"
	EndpointMonitorStatusStopped          EndpointMonitorStatus = "Stopped"
)

func PossibleEndpointMonitorStatusValues

func PossibleEndpointMonitorStatusValues() []EndpointMonitorStatus

PossibleEndpointMonitorStatusValues returns the possible values for the EndpointMonitorStatus const type.

type EndpointProperties

type EndpointProperties struct {
	// If Always Serve is enabled, probing for endpoint health will be disabled and endpoints will be included in the traffic
	// routing method.
	AlwaysServe *AlwaysServe `json:"alwaysServe,omitempty"`

	// List of custom headers.
	CustomHeaders []*EndpointPropertiesCustomHeadersItem `json:"customHeaders,omitempty"`

	// Specifies the location of the external or nested endpoints when using the 'Performance' traffic routing method.
	EndpointLocation *string `json:"endpointLocation,omitempty"`

	// The monitoring status of the endpoint.
	EndpointMonitorStatus *EndpointMonitorStatus `json:"endpointMonitorStatus,omitempty"`

	// The status of the endpoint. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic
	// routing method.
	EndpointStatus *EndpointStatus `json:"endpointStatus,omitempty"`

	// The list of countries/regions mapped to this endpoint when using the 'Geographic' traffic routing method. Please consult
	// Traffic Manager Geographic documentation for a full list of accepted values.
	GeoMapping []*string `json:"geoMapping,omitempty"`

	// The minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered
	// available. Only applicable to endpoint of type 'NestedEndpoints'.
	MinChildEndpoints *int64 `json:"minChildEndpoints,omitempty"`

	// The minimum number of IPv4 (DNS record type A) endpoints that must be available in the child profile in order for the parent
	// profile to be considered available. Only applicable to endpoint of type
	// 'NestedEndpoints'.
	MinChildEndpointsIPv4 *int64 `json:"minChildEndpointsIPv4,omitempty"`

	// The minimum number of IPv6 (DNS record type AAAA) endpoints that must be available in the child profile in order for the
	// parent profile to be considered available. Only applicable to endpoint of type
	// 'NestedEndpoints'.
	MinChildEndpointsIPv6 *int64 `json:"minChildEndpointsIPv6,omitempty"`

	// The priority of this endpoint when using the 'Priority' traffic routing method. Possible values are from 1 to 1000, lower
	// values represent higher priority. This is an optional parameter. If specified,
	// it must be specified on all endpoints, and no two endpoints can share the same priority value.
	Priority *int64 `json:"priority,omitempty"`

	// The list of subnets, IP addresses, and/or address ranges mapped to this endpoint when using the 'Subnet' traffic routing
	// method. An empty list will match all ranges not covered by other endpoints.
	Subnets []*EndpointPropertiesSubnetsItem `json:"subnets,omitempty"`

	// The fully-qualified DNS name or IP address of the endpoint. Traffic Manager returns this value in DNS responses to direct
	// traffic to this endpoint.
	Target *string `json:"target,omitempty"`

	// The Azure Resource URI of the of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'.
	TargetResourceID *string `json:"targetResourceId,omitempty"`

	// The weight of this endpoint when using the 'Weighted' traffic routing method. Possible values are from 1 to 1000.
	Weight *int64 `json:"weight,omitempty"`
}

EndpointProperties - Class representing a Traffic Manager endpoint properties.

func (EndpointProperties) MarshalJSON

func (e EndpointProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EndpointProperties.

func (*EndpointProperties) UnmarshalJSON added in v1.1.0

func (e *EndpointProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EndpointProperties.

type EndpointPropertiesCustomHeadersItem

type EndpointPropertiesCustomHeadersItem struct {
	// Header name.
	Name *string `json:"name,omitempty"`

	// Header value.
	Value *string `json:"value,omitempty"`
}

EndpointPropertiesCustomHeadersItem - Custom header name and value.

func (EndpointPropertiesCustomHeadersItem) MarshalJSON added in v1.1.0

func (e EndpointPropertiesCustomHeadersItem) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EndpointPropertiesCustomHeadersItem.

func (*EndpointPropertiesCustomHeadersItem) UnmarshalJSON added in v1.1.0

func (e *EndpointPropertiesCustomHeadersItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EndpointPropertiesCustomHeadersItem.

type EndpointPropertiesSubnetsItem

type EndpointPropertiesSubnetsItem struct {
	// First address in the subnet.
	First *string `json:"first,omitempty"`

	// Last address in the subnet.
	Last *string `json:"last,omitempty"`

	// Block size (number of leading bits in the subnet mask).
	Scope *int32 `json:"scope,omitempty"`
}

EndpointPropertiesSubnetsItem - Subnet first address, scope, and/or last address.

func (EndpointPropertiesSubnetsItem) MarshalJSON added in v1.1.0

func (e EndpointPropertiesSubnetsItem) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EndpointPropertiesSubnetsItem.

func (*EndpointPropertiesSubnetsItem) UnmarshalJSON added in v1.1.0

func (e *EndpointPropertiesSubnetsItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EndpointPropertiesSubnetsItem.

type EndpointStatus

type EndpointStatus string

EndpointStatus - The status of the endpoint. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic routing method.

const (
	EndpointStatusDisabled EndpointStatus = "Disabled"
	EndpointStatusEnabled  EndpointStatus = "Enabled"
)

func PossibleEndpointStatusValues

func PossibleEndpointStatusValues() []EndpointStatus

PossibleEndpointStatusValues returns the possible values for the EndpointStatus const type.

type EndpointType added in v0.3.0

type EndpointType string
const (
	EndpointTypeAzureEndpoints    EndpointType = "AzureEndpoints"
	EndpointTypeExternalEndpoints EndpointType = "ExternalEndpoints"
	EndpointTypeNestedEndpoints   EndpointType = "NestedEndpoints"
)

func PossibleEndpointTypeValues added in v0.3.0

func PossibleEndpointTypeValues() []EndpointType

PossibleEndpointTypeValues returns the possible values for the EndpointType const type.

type EndpointsClient

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

EndpointsClient contains the methods for the Endpoints group. Don't use this type directly, use NewEndpointsClient() instead.

func NewEndpointsClient

func NewEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EndpointsClient, error)

NewEndpointsClient creates a new instance of EndpointsClient 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 (*EndpointsClient) CreateOrUpdate

func (client *EndpointsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, profileName string, endpointType EndpointType, endpointName string, parameters Endpoint, options *EndpointsClientCreateOrUpdateOptions) (EndpointsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or update a Traffic Manager endpoint. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-04-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. profileName - The name of the Traffic Manager profile. endpointType - The type of the Traffic Manager endpoint to be created or updated. endpointName - The name of the Traffic Manager endpoint to be created or updated. parameters - The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation. options - EndpointsClientCreateOrUpdateOptions contains the optional parameters for the EndpointsClient.CreateOrUpdate method.

Example (EndpointPutExternalWithAlwaysServe)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Endpoint-PUT-External-WithAlwaysServe.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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewEndpointsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", armtrafficmanager.Endpoint{
		Name: to.Ptr("azsmnet7187"),
		Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
		Properties: &armtrafficmanager.EndpointProperties{
			AlwaysServe:      to.Ptr(armtrafficmanager.AlwaysServeEnabled),
			EndpointLocation: to.Ptr("North Europe"),
			EndpointStatus:   to.Ptr(armtrafficmanager.EndpointStatusEnabled),
			Target:           to.Ptr("foobar.contoso.com"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (EndpointPutExternalWithCustomHeaders)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Endpoint-PUT-External-WithCustomHeaders.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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewEndpointsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", armtrafficmanager.Endpoint{
		Name: to.Ptr("azsmnet7187"),
		Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
		Properties: &armtrafficmanager.EndpointProperties{
			CustomHeaders: []*armtrafficmanager.EndpointPropertiesCustomHeadersItem{
				{
					Name:  to.Ptr("header-1"),
					Value: to.Ptr("value-1"),
				},
				{
					Name:  to.Ptr("header-2"),
					Value: to.Ptr("value-2"),
				}},
			EndpointLocation: to.Ptr("North Europe"),
			EndpointStatus:   to.Ptr(armtrafficmanager.EndpointStatusEnabled),
			Target:           to.Ptr("foobar.contoso.com"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (EndpointPutExternalWithGeoMapping)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Endpoint-PUT-External-WithGeoMapping.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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewEndpointsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224", armtrafficmanager.EndpointTypeExternalEndpoints, "My%20external%20endpoint", armtrafficmanager.Endpoint{
		Name: to.Ptr("My external endpoint"),
		Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
		Properties: &armtrafficmanager.EndpointProperties{
			EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled),
			GeoMapping: []*string{
				to.Ptr("GEO-AS"),
				to.Ptr("GEO-AF")},
			Target: to.Ptr("foobar.contoso.com"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (EndpointPutExternalWithLocation)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Endpoint-PUT-External-WithLocation.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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewEndpointsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", armtrafficmanager.Endpoint{
		Name: to.Ptr("azsmnet7187"),
		Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
		Properties: &armtrafficmanager.EndpointProperties{
			EndpointLocation: to.Ptr("North Europe"),
			EndpointStatus:   to.Ptr(armtrafficmanager.EndpointStatusEnabled),
			Target:           to.Ptr("foobar.contoso.com"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (EndpointPutExternalWithSubnetMapping)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Endpoint-PUT-External-WithSubnetMapping.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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewEndpointsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224", armtrafficmanager.EndpointTypeExternalEndpoints, "My%20external%20endpoint", armtrafficmanager.Endpoint{
		Name: to.Ptr("My external endpoint"),
		Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
		Properties: &armtrafficmanager.EndpointProperties{
			EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled),
			Subnets: []*armtrafficmanager.EndpointPropertiesSubnetsItem{
				{
					First: to.Ptr("1.2.3.0"),
					Scope: to.Ptr[int32](24),
				},
				{
					First: to.Ptr("25.26.27.28"),
					Last:  to.Ptr("29.30.31.32"),
				}},
			Target: to.Ptr("foobar.contoso.com"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*EndpointsClient) Delete

func (client *EndpointsClient) Delete(ctx context.Context, resourceGroupName string, profileName string, endpointType EndpointType, endpointName string, options *EndpointsClientDeleteOptions) (EndpointsClientDeleteResponse, error)

Delete - Deletes a Traffic Manager endpoint. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-04-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. profileName - The name of the Traffic Manager profile. endpointType - The type of the Traffic Manager endpoint to be deleted. endpointName - The name of the Traffic Manager endpoint to be deleted. options - EndpointsClientDeleteOptions contains the optional parameters for the EndpointsClient.Delete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Endpoint-DELETE-External.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewEndpointsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Delete(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*EndpointsClient) Get

func (client *EndpointsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointType EndpointType, endpointName string, options *EndpointsClientGetOptions) (EndpointsClientGetResponse, error)

Get - Gets a Traffic Manager endpoint. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-04-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. profileName - The name of the Traffic Manager profile. endpointType - The type of the Traffic Manager endpoint. endpointName - The name of the Traffic Manager endpoint. options - EndpointsClientGetOptions contains the optional parameters for the EndpointsClient.Get method.

Example (EndpointGetExternalWithGeoMapping)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Endpoint-GET-External-WithGeoMapping.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewEndpointsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx, "azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224", armtrafficmanager.EndpointTypeExternalEndpoints, "My%20external%20endpoint", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (EndpointGetExternalWithLocation)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Endpoint-GET-External-WithLocation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewEndpointsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (EndpointGetExternalWithSubnetMapping)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Endpoint-GET-External-WithSubnetMapping.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewEndpointsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx, "azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224", armtrafficmanager.EndpointTypeExternalEndpoints, "My%20external%20endpoint", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*EndpointsClient) Update

func (client *EndpointsClient) Update(ctx context.Context, resourceGroupName string, profileName string, endpointType EndpointType, endpointName string, parameters Endpoint, options *EndpointsClientUpdateOptions) (EndpointsClientUpdateResponse, error)

Update - Update a Traffic Manager endpoint. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-04-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. profileName - The name of the Traffic Manager profile. endpointType - The type of the Traffic Manager endpoint to be updated. endpointName - The name of the Traffic Manager endpoint to be updated. parameters - The Traffic Manager endpoint parameters supplied to the Update operation. options - EndpointsClientUpdateOptions contains the optional parameters for the EndpointsClient.Update method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Endpoint-PATCH-External-Target.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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewEndpointsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Update(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", armtrafficmanager.Endpoint{
		Name: to.Ptr("azsmnet7187"),
		Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"),
		ID:   to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficManagerProfiles/azsmnet6386/externalEndpoints/azsmnet7187"),
		Properties: &armtrafficmanager.EndpointProperties{
			Target: to.Ptr("another.foobar.contoso.com"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

type EndpointsClientCreateOrUpdateOptions added in v0.2.0

type EndpointsClientCreateOrUpdateOptions struct {
}

EndpointsClientCreateOrUpdateOptions contains the optional parameters for the EndpointsClient.CreateOrUpdate method.

type EndpointsClientCreateOrUpdateResponse added in v0.2.0

type EndpointsClientCreateOrUpdateResponse struct {
	Endpoint
}

EndpointsClientCreateOrUpdateResponse contains the response from method EndpointsClient.CreateOrUpdate.

type EndpointsClientDeleteOptions added in v0.2.0

type EndpointsClientDeleteOptions struct {
}

EndpointsClientDeleteOptions contains the optional parameters for the EndpointsClient.Delete method.

type EndpointsClientDeleteResponse added in v0.2.0

type EndpointsClientDeleteResponse struct {
	DeleteOperationResult
}

EndpointsClientDeleteResponse contains the response from method EndpointsClient.Delete.

type EndpointsClientGetOptions added in v0.2.0

type EndpointsClientGetOptions struct {
}

EndpointsClientGetOptions contains the optional parameters for the EndpointsClient.Get method.

type EndpointsClientGetResponse added in v0.2.0

type EndpointsClientGetResponse struct {
	Endpoint
}

EndpointsClientGetResponse contains the response from method EndpointsClient.Get.

type EndpointsClientUpdateOptions added in v0.2.0

type EndpointsClientUpdateOptions struct {
}

EndpointsClientUpdateOptions contains the optional parameters for the EndpointsClient.Update method.

type EndpointsClientUpdateResponse added in v0.2.0

type EndpointsClientUpdateResponse struct {
	Endpoint
}

EndpointsClientUpdateResponse contains the response from method EndpointsClient.Update.

type GeographicHierarchiesClient

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

GeographicHierarchiesClient contains the methods for the GeographicHierarchies group. Don't use this type directly, use NewGeographicHierarchiesClient() instead.

func NewGeographicHierarchiesClient

func NewGeographicHierarchiesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GeographicHierarchiesClient, error)

NewGeographicHierarchiesClient creates a new instance of GeographicHierarchiesClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*GeographicHierarchiesClient) GetDefault

GetDefault - Gets the default Geographic Hierarchy used by the Geographic traffic routing method. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-04-01-preview options - GeographicHierarchiesClientGetDefaultOptions contains the optional parameters for the GeographicHierarchiesClient.GetDefault method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/GeographicHierarchy-GET-default.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewGeographicHierarchiesClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.GetDefault(ctx, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

type GeographicHierarchiesClientGetDefaultOptions added in v0.2.0

type GeographicHierarchiesClientGetDefaultOptions struct {
}

GeographicHierarchiesClientGetDefaultOptions contains the optional parameters for the GeographicHierarchiesClient.GetDefault method.

type GeographicHierarchiesClientGetDefaultResponse added in v0.2.0

type GeographicHierarchiesClientGetDefaultResponse struct {
	GeographicHierarchy
}

GeographicHierarchiesClientGetDefaultResponse contains the response from method GeographicHierarchiesClient.GetDefault.

type GeographicHierarchy added in v0.2.0

type GeographicHierarchy struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// The properties of the Geographic Hierarchy resource.
	Properties *GeographicHierarchyProperties `json:"properties,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

GeographicHierarchy - Class representing the Geographic hierarchy used with the Geographic traffic routing method.

func (GeographicHierarchy) MarshalJSON added in v1.1.0

func (g GeographicHierarchy) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GeographicHierarchy.

func (*GeographicHierarchy) UnmarshalJSON added in v1.1.0

func (g *GeographicHierarchy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GeographicHierarchy.

type GeographicHierarchyProperties

type GeographicHierarchyProperties struct {
	// The region at the root of the hierarchy from all the regions in the hierarchy can be retrieved.
	GeographicHierarchy *Region `json:"geographicHierarchy,omitempty"`
}

GeographicHierarchyProperties - Class representing the properties of the Geographic hierarchy used with the Geographic traffic routing method.

func (GeographicHierarchyProperties) MarshalJSON added in v1.1.0

func (g GeographicHierarchyProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GeographicHierarchyProperties.

func (*GeographicHierarchyProperties) UnmarshalJSON added in v1.1.0

func (g *GeographicHierarchyProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GeographicHierarchyProperties.

type HeatMapClient

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

HeatMapClient contains the methods for the HeatMap group. Don't use this type directly, use NewHeatMapClient() instead.

func NewHeatMapClient

func NewHeatMapClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HeatMapClient, error)

NewHeatMapClient creates a new instance of HeatMapClient 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 (*HeatMapClient) Get

func (client *HeatMapClient) Get(ctx context.Context, resourceGroupName string, profileName string, options *HeatMapClientGetOptions) (HeatMapClientGetResponse, error)

Get - Gets latest heatmap for Traffic Manager profile. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-04-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. profileName - The name of the Traffic Manager profile. options - HeatMapClientGetOptions contains the optional parameters for the HeatMapClient.Get method.

Example (HeatMapGet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/HeatMap-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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewHeatMapClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", &armtrafficmanager.HeatMapClientGetOptions{TopLeft: []float64{},
		BotRight: []float64{},
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (HeatMapGetWithNullValues)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/HeatMap-GET-With-Null-Values.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewHeatMapClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", &armtrafficmanager.HeatMapClientGetOptions{TopLeft: []float64{},
		BotRight: []float64{},
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (HeatMapGetWithTopLeftBotRight)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/HeatMap-GET-With-TopLeft-BotRight.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewHeatMapClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", &armtrafficmanager.HeatMapClientGetOptions{TopLeft: []float64{
		10,
		50.001},
		BotRight: []float64{
			-50.001,
			80},
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

type HeatMapClientGetOptions added in v0.2.0

type HeatMapClientGetOptions struct {
	// The bottom right latitude,longitude pair of the rectangular viewport to query for.
	BotRight []float64
	// The top left latitude,longitude pair of the rectangular viewport to query for.
	TopLeft []float64
}

HeatMapClientGetOptions contains the optional parameters for the HeatMapClient.Get method.

type HeatMapClientGetResponse added in v0.2.0

type HeatMapClientGetResponse struct {
	HeatMapModel
}

HeatMapClientGetResponse contains the response from method HeatMapClient.Get.

type HeatMapEndpoint

type HeatMapEndpoint struct {
	// A number uniquely identifying this endpoint in query experiences.
	EndpointID *int32 `json:"endpointId,omitempty"`

	// The ARM Resource ID of this Traffic Manager endpoint.
	ResourceID *string `json:"resourceId,omitempty"`
}

HeatMapEndpoint - Class which is a sparse representation of a Traffic Manager endpoint.

func (HeatMapEndpoint) MarshalJSON added in v1.1.0

func (h HeatMapEndpoint) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type HeatMapEndpoint.

func (*HeatMapEndpoint) UnmarshalJSON added in v1.1.0

func (h *HeatMapEndpoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type HeatMapEndpoint.

type HeatMapModel

type HeatMapModel struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// The properties of the Traffic Manager HeatMap.
	Properties *HeatMapProperties `json:"properties,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

HeatMapModel - Class representing a Traffic Manager HeatMap.

func (HeatMapModel) MarshalJSON

func (h HeatMapModel) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type HeatMapModel.

func (*HeatMapModel) UnmarshalJSON added in v1.1.0

func (h *HeatMapModel) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type HeatMapModel.

type HeatMapProperties

type HeatMapProperties struct {
	// The ending of the time window for this HeatMap, exclusive.
	EndTime *time.Time `json:"endTime,omitempty"`

	// The endpoints used in this HeatMap calculation.
	Endpoints []*HeatMapEndpoint `json:"endpoints,omitempty"`

	// The beginning of the time window for this HeatMap, inclusive.
	StartTime *time.Time `json:"startTime,omitempty"`

	// The traffic flows produced in this HeatMap calculation.
	TrafficFlows []*TrafficFlow `json:"trafficFlows,omitempty"`
}

HeatMapProperties - Class representing a Traffic Manager HeatMap properties.

func (HeatMapProperties) MarshalJSON

func (h HeatMapProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type HeatMapProperties.

func (*HeatMapProperties) UnmarshalJSON

func (h *HeatMapProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type HeatMapProperties.

type MonitorConfig

type MonitorConfig struct {
	// List of custom headers.
	CustomHeaders []*MonitorConfigCustomHeadersItem `json:"customHeaders,omitempty"`

	// List of expected status code ranges.
	ExpectedStatusCodeRanges []*MonitorConfigExpectedStatusCodeRangesItem `json:"expectedStatusCodeRanges,omitempty"`

	// The monitor interval for endpoints in this profile. This is the interval at which Traffic Manager will check the health
	// of each endpoint in this profile.
	IntervalInSeconds *int64 `json:"intervalInSeconds,omitempty"`

	// The path relative to the endpoint domain name used to probe for endpoint health.
	Path *string `json:"path,omitempty"`

	// The TCP port used to probe for endpoint health.
	Port *int64 `json:"port,omitempty"`

	// The profile-level monitoring status of the Traffic Manager profile.
	ProfileMonitorStatus *ProfileMonitorStatus `json:"profileMonitorStatus,omitempty"`

	// The protocol (HTTP, HTTPS or TCP) used to probe for endpoint health.
	Protocol *MonitorProtocol `json:"protocol,omitempty"`

	// The monitor timeout for endpoints in this profile. This is the time that Traffic Manager allows endpoints in this profile
	// to response to the health check.
	TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"`

	// The number of consecutive failed health check that Traffic Manager tolerates before declaring an endpoint in this profile
	// Degraded after the next failed health check.
	ToleratedNumberOfFailures *int64 `json:"toleratedNumberOfFailures,omitempty"`
}

MonitorConfig - Class containing endpoint monitoring settings in a Traffic Manager profile.

func (MonitorConfig) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MonitorConfig.

func (*MonitorConfig) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type MonitorConfig.

type MonitorConfigCustomHeadersItem

type MonitorConfigCustomHeadersItem struct {
	// Header name.
	Name *string `json:"name,omitempty"`

	// Header value.
	Value *string `json:"value,omitempty"`
}

MonitorConfigCustomHeadersItem - Custom header name and value.

func (MonitorConfigCustomHeadersItem) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type MonitorConfigCustomHeadersItem.

func (*MonitorConfigCustomHeadersItem) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type MonitorConfigCustomHeadersItem.

type MonitorConfigExpectedStatusCodeRangesItem

type MonitorConfigExpectedStatusCodeRangesItem struct {
	// Max status code.
	Max *int32 `json:"max,omitempty"`

	// Min status code.
	Min *int32 `json:"min,omitempty"`
}

MonitorConfigExpectedStatusCodeRangesItem - Min and max value of a status code range.

func (MonitorConfigExpectedStatusCodeRangesItem) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type MonitorConfigExpectedStatusCodeRangesItem.

func (*MonitorConfigExpectedStatusCodeRangesItem) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type MonitorConfigExpectedStatusCodeRangesItem.

type MonitorProtocol

type MonitorProtocol string

MonitorProtocol - The protocol (HTTP, HTTPS or TCP) used to probe for endpoint health.

const (
	MonitorProtocolHTTP  MonitorProtocol = "HTTP"
	MonitorProtocolHTTPS MonitorProtocol = "HTTPS"
	MonitorProtocolTCP   MonitorProtocol = "TCP"
)

func PossibleMonitorProtocolValues

func PossibleMonitorProtocolValues() []MonitorProtocol

PossibleMonitorProtocolValues returns the possible values for the MonitorProtocol const type.

type NameAvailability added in v0.2.0

type NameAvailability struct {
	// Descriptive message that explains why the name is not available, when applicable.
	Message *string `json:"message,omitempty"`

	// The relative name.
	Name *string `json:"name,omitempty"`

	// Describes whether the relative name is available or not.
	NameAvailable *bool `json:"nameAvailable,omitempty"`

	// The reason why the name is not available, when applicable.
	Reason *string `json:"reason,omitempty"`

	// Traffic Manager profile resource type.
	Type *string `json:"type,omitempty"`
}

NameAvailability - Class representing a Traffic Manager Name Availability response.

func (NameAvailability) MarshalJSON added in v1.1.0

func (n NameAvailability) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NameAvailability.

func (*NameAvailability) UnmarshalJSON added in v1.1.0

func (n *NameAvailability) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailability.

type Profile

type Profile struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The Azure Region where the resource lives
	Location *string `json:"location,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// The properties of the Traffic Manager profile.
	Properties *ProfileProperties `json:"properties,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

Profile - Class representing a Traffic Manager profile.

func (Profile) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Profile.

func (*Profile) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Profile.

type ProfileListResult

type ProfileListResult struct {
	// Gets the list of Traffic manager profiles.
	Value []*Profile `json:"value,omitempty"`
}

ProfileListResult - The list Traffic Manager profiles operation response.

func (ProfileListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ProfileListResult.

func (*ProfileListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ProfileListResult.

type ProfileMonitorStatus

type ProfileMonitorStatus string

ProfileMonitorStatus - The profile-level monitoring status of the Traffic Manager profile.

const (
	ProfileMonitorStatusCheckingEndpoints ProfileMonitorStatus = "CheckingEndpoints"
	ProfileMonitorStatusDegraded          ProfileMonitorStatus = "Degraded"
	ProfileMonitorStatusDisabled          ProfileMonitorStatus = "Disabled"
	ProfileMonitorStatusInactive          ProfileMonitorStatus = "Inactive"
	ProfileMonitorStatusOnline            ProfileMonitorStatus = "Online"
)

func PossibleProfileMonitorStatusValues

func PossibleProfileMonitorStatusValues() []ProfileMonitorStatus

PossibleProfileMonitorStatusValues returns the possible values for the ProfileMonitorStatus const type.

type ProfileProperties

type ProfileProperties struct {
	// The list of allowed endpoint record types.
	AllowedEndpointRecordTypes []*AllowedEndpointRecordType `json:"allowedEndpointRecordTypes,omitempty"`

	// The DNS settings of the Traffic Manager profile.
	DNSConfig *DNSConfig `json:"dnsConfig,omitempty"`

	// The list of endpoints in the Traffic Manager profile.
	Endpoints []*Endpoint `json:"endpoints,omitempty"`

	// Maximum number of endpoints to be returned for MultiValue routing type.
	MaxReturn *int64 `json:"maxReturn,omitempty"`

	// The endpoint monitoring settings of the Traffic Manager profile.
	MonitorConfig *MonitorConfig `json:"monitorConfig,omitempty"`

	// The status of the Traffic Manager profile.
	ProfileStatus *ProfileStatus `json:"profileStatus,omitempty"`

	// The traffic routing method of the Traffic Manager profile.
	TrafficRoutingMethod *TrafficRoutingMethod `json:"trafficRoutingMethod,omitempty"`

	// Indicates whether Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. Null, indicates 'Disabled'.
	// Enabling this feature will increase the cost of the Traffic Manage profile.
	TrafficViewEnrollmentStatus *TrafficViewEnrollmentStatus `json:"trafficViewEnrollmentStatus,omitempty"`
}

ProfileProperties - Class representing the Traffic Manager profile properties.

func (ProfileProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ProfileProperties.

func (*ProfileProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ProfileProperties.

type ProfileStatus

type ProfileStatus string

ProfileStatus - The status of the Traffic Manager profile.

const (
	ProfileStatusDisabled ProfileStatus = "Disabled"
	ProfileStatusEnabled  ProfileStatus = "Enabled"
)

func PossibleProfileStatusValues

func PossibleProfileStatusValues() []ProfileStatus

PossibleProfileStatusValues returns the possible values for the ProfileStatus const type.

type ProfilesClient

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

ProfilesClient contains the methods for the Profiles group. Don't use this type directly, use NewProfilesClient() instead.

func NewProfilesClient

func NewProfilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProfilesClient, error)

NewProfilesClient creates a new instance of ProfilesClient 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 (*ProfilesClient) CheckTrafficManagerRelativeDNSNameAvailability

CheckTrafficManagerRelativeDNSNameAvailability - Checks the availability of a Traffic Manager Relative DNS name. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-04-01-preview parameters - The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. options - ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityOptions contains the optional parameters for the ProfilesClient.CheckTrafficManagerRelativeDNSNameAvailability method.

Example (NameAvailabilityTestNameAvailablePost21)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/NameAvailabilityTest_NameAvailable-POST-example-21.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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewProfilesClient("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CheckTrafficManagerRelativeDNSNameAvailability(ctx, armtrafficmanager.CheckTrafficManagerRelativeDNSNameAvailabilityParameters{
		Name: to.Ptr("azsmnet5403"),
		Type: to.Ptr("microsoft.network/trafficmanagerprofiles"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (NameAvailabilityTestNameNotAvailablePost23)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/NameAvailabilityTest_NameNotAvailable-POST-example-23.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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewProfilesClient("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CheckTrafficManagerRelativeDNSNameAvailability(ctx, armtrafficmanager.CheckTrafficManagerRelativeDNSNameAvailabilityParameters{
		Name: to.Ptr("azsmnet4696"),
		Type: to.Ptr("microsoft.network/trafficmanagerprofiles"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*ProfilesClient) CreateOrUpdate

func (client *ProfilesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, profileName string, parameters Profile, options *ProfilesClientCreateOrUpdateOptions) (ProfilesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or update a Traffic Manager profile. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-04-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. profileName - The name of the Traffic Manager profile. parameters - The Traffic Manager profile parameters supplied to the CreateOrUpdate operation. options - ProfilesClientCreateOrUpdateOptions contains the optional parameters for the ProfilesClient.CreateOrUpdate method.

Example (ProfilePutMultiValue)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Profile-PUT-MultiValue.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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewProfilesClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.Profile{
		Location: to.Ptr("global"),
		Properties: &armtrafficmanager.ProfileProperties{
			DNSConfig: &armtrafficmanager.DNSConfig{
				RelativeName: to.Ptr("azsmnet6386"),
				TTL:          to.Ptr[int64](35),
			},
			MaxReturn: to.Ptr[int64](2),
			MonitorConfig: &armtrafficmanager.MonitorConfig{
				Path:     to.Ptr("/testpath.aspx"),
				Port:     to.Ptr[int64](80),
				Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP),
			},
			ProfileStatus:               to.Ptr(armtrafficmanager.ProfileStatusEnabled),
			TrafficRoutingMethod:        to.Ptr(armtrafficmanager.TrafficRoutingMethodMultiValue),
			TrafficViewEnrollmentStatus: to.Ptr(armtrafficmanager.TrafficViewEnrollmentStatusDisabled),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (ProfilePutNoEndpoints)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Profile-PUT-NoEndpoints.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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewProfilesClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.Profile{
		Location: to.Ptr("global"),
		Properties: &armtrafficmanager.ProfileProperties{
			DNSConfig: &armtrafficmanager.DNSConfig{
				RelativeName: to.Ptr("azsmnet6386"),
				TTL:          to.Ptr[int64](35),
			},
			MonitorConfig: &armtrafficmanager.MonitorConfig{
				Path:     to.Ptr("/testpath.aspx"),
				Port:     to.Ptr[int64](80),
				Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP),
			},
			ProfileStatus:        to.Ptr(armtrafficmanager.ProfileStatusEnabled),
			TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (ProfilePutWithAliasing)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Profile-PUT-WithAliasing.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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewProfilesClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager2583", "azuresdkfornetautoresttrafficmanager6192", armtrafficmanager.Profile{
		Location: to.Ptr("global"),
		Properties: &armtrafficmanager.ProfileProperties{
			AllowedEndpointRecordTypes: []*armtrafficmanager.AllowedEndpointRecordType{
				to.Ptr(armtrafficmanager.AllowedEndpointRecordTypeDomainName)},
			DNSConfig: &armtrafficmanager.DNSConfig{
				RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager6192"),
				TTL:          to.Ptr[int64](35),
			},
			Endpoints: []*armtrafficmanager.Endpoint{
				{
					Name: to.Ptr("My external endpoint"),
					Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
					Properties: &armtrafficmanager.EndpointProperties{
						EndpointLocation: to.Ptr("North Europe"),
						EndpointStatus:   to.Ptr(armtrafficmanager.EndpointStatusEnabled),
						Target:           to.Ptr("foobar.contoso.com"),
					},
				}},
			MonitorConfig: &armtrafficmanager.MonitorConfig{
				Path:                      to.Ptr("/testpath.aspx"),
				IntervalInSeconds:         to.Ptr[int64](10),
				Port:                      to.Ptr[int64](80),
				TimeoutInSeconds:          to.Ptr[int64](5),
				ToleratedNumberOfFailures: to.Ptr[int64](2),
				Protocol:                  to.Ptr(armtrafficmanager.MonitorProtocolHTTP),
			},
			ProfileStatus:        to.Ptr(armtrafficmanager.ProfileStatusEnabled),
			TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (ProfilePutWithCustomHeaders)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Profile-PUT-WithCustomHeaders.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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewProfilesClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager2583", "azuresdkfornetautoresttrafficmanager6192", armtrafficmanager.Profile{
		Location: to.Ptr("global"),
		Properties: &armtrafficmanager.ProfileProperties{
			DNSConfig: &armtrafficmanager.DNSConfig{
				RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager6192"),
				TTL:          to.Ptr[int64](35),
			},
			Endpoints: []*armtrafficmanager.Endpoint{
				{
					Name: to.Ptr("My external endpoint"),
					Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
					Properties: &armtrafficmanager.EndpointProperties{
						CustomHeaders: []*armtrafficmanager.EndpointPropertiesCustomHeadersItem{
							{
								Name:  to.Ptr("header-2"),
								Value: to.Ptr("value-2-overridden"),
							}},
						EndpointLocation: to.Ptr("North Europe"),
						EndpointStatus:   to.Ptr(armtrafficmanager.EndpointStatusEnabled),
						Target:           to.Ptr("foobar.contoso.com"),
					},
				}},
			MonitorConfig: &armtrafficmanager.MonitorConfig{
				Path: to.Ptr("/testpath.aspx"),
				CustomHeaders: []*armtrafficmanager.MonitorConfigCustomHeadersItem{
					{
						Name:  to.Ptr("header-1"),
						Value: to.Ptr("value-1"),
					},
					{
						Name:  to.Ptr("header-2"),
						Value: to.Ptr("value-2"),
					}},
				ExpectedStatusCodeRanges: []*armtrafficmanager.MonitorConfigExpectedStatusCodeRangesItem{
					{
						Max: to.Ptr[int32](205),
						Min: to.Ptr[int32](200),
					},
					{
						Max: to.Ptr[int32](410),
						Min: to.Ptr[int32](400),
					}},
				IntervalInSeconds:         to.Ptr[int64](10),
				Port:                      to.Ptr[int64](80),
				TimeoutInSeconds:          to.Ptr[int64](5),
				ToleratedNumberOfFailures: to.Ptr[int64](2),
				Protocol:                  to.Ptr(armtrafficmanager.MonitorProtocolHTTP),
			},
			ProfileStatus:               to.Ptr(armtrafficmanager.ProfileStatusEnabled),
			TrafficRoutingMethod:        to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance),
			TrafficViewEnrollmentStatus: to.Ptr(armtrafficmanager.TrafficViewEnrollmentStatusDisabled),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (ProfilePutWithEndpoints)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Profile-PUT-WithEndpoints.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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewProfilesClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager2583", "azuresdkfornetautoresttrafficmanager6192", armtrafficmanager.Profile{
		Location: to.Ptr("global"),
		Properties: &armtrafficmanager.ProfileProperties{
			DNSConfig: &armtrafficmanager.DNSConfig{
				RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager6192"),
				TTL:          to.Ptr[int64](35),
			},
			Endpoints: []*armtrafficmanager.Endpoint{
				{
					Name: to.Ptr("My external endpoint"),
					Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"),
					Properties: &armtrafficmanager.EndpointProperties{
						EndpointLocation: to.Ptr("North Europe"),
						EndpointStatus:   to.Ptr(armtrafficmanager.EndpointStatusEnabled),
						Target:           to.Ptr("foobar.contoso.com"),
					},
				}},
			MonitorConfig: &armtrafficmanager.MonitorConfig{
				Path:                      to.Ptr("/testpath.aspx"),
				IntervalInSeconds:         to.Ptr[int64](10),
				Port:                      to.Ptr[int64](80),
				TimeoutInSeconds:          to.Ptr[int64](5),
				ToleratedNumberOfFailures: to.Ptr[int64](2),
				Protocol:                  to.Ptr(armtrafficmanager.MonitorProtocolHTTP),
			},
			ProfileStatus:        to.Ptr(armtrafficmanager.ProfileStatusEnabled),
			TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (ProfilePutWithNestedEndpoints)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Profile-PUT-WithNestedEndpoints.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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewProfilesClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "myresourcegroup", "parentprofile", armtrafficmanager.Profile{
		Location: to.Ptr("global"),
		Properties: &armtrafficmanager.ProfileProperties{
			DNSConfig: &armtrafficmanager.DNSConfig{
				RelativeName: to.Ptr("parentprofile"),
				TTL:          to.Ptr[int64](35),
			},
			Endpoints: []*armtrafficmanager.Endpoint{
				{
					Name: to.Ptr("MyFirstNestedEndpoint"),
					Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/nestedEndpoints"),
					Properties: &armtrafficmanager.EndpointProperties{
						EndpointStatus:        to.Ptr(armtrafficmanager.EndpointStatusEnabled),
						MinChildEndpoints:     to.Ptr[int64](2),
						MinChildEndpointsIPv4: to.Ptr[int64](1),
						MinChildEndpointsIPv6: to.Ptr[int64](2),
						Priority:              to.Ptr[int64](1),
						Target:                to.Ptr("firstnestedprofile.tmpreview.watmtest.azure-test.net"),
						Weight:                to.Ptr[int64](1),
					},
				},
				{
					Name: to.Ptr("MySecondNestedEndpoint"),
					Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/nestedEndpoints"),
					Properties: &armtrafficmanager.EndpointProperties{
						EndpointStatus:        to.Ptr(armtrafficmanager.EndpointStatusEnabled),
						MinChildEndpoints:     to.Ptr[int64](2),
						MinChildEndpointsIPv4: to.Ptr[int64](2),
						MinChildEndpointsIPv6: to.Ptr[int64](1),
						Priority:              to.Ptr[int64](2),
						Target:                to.Ptr("secondnestedprofile.tmpreview.watmtest.azure-test.net"),
						Weight:                to.Ptr[int64](1),
					},
				}},
			MonitorConfig: &armtrafficmanager.MonitorConfig{
				Path:                      to.Ptr("/testpath.aspx"),
				IntervalInSeconds:         to.Ptr[int64](10),
				Port:                      to.Ptr[int64](80),
				TimeoutInSeconds:          to.Ptr[int64](5),
				ToleratedNumberOfFailures: to.Ptr[int64](2),
				Protocol:                  to.Ptr(armtrafficmanager.MonitorProtocolHTTP),
			},
			ProfileStatus:        to.Ptr(armtrafficmanager.ProfileStatusEnabled),
			TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPriority),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*ProfilesClient) Delete

func (client *ProfilesClient) Delete(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientDeleteOptions) (ProfilesClientDeleteResponse, error)

Delete - Deletes a Traffic Manager profile. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-04-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. profileName - The name of the Traffic Manager profile to be deleted. options - ProfilesClientDeleteOptions contains the optional parameters for the ProfilesClient.Delete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Profile-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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewProfilesClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Delete(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*ProfilesClient) Get

func (client *ProfilesClient) Get(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientGetOptions) (ProfilesClientGetResponse, error)

Get - Gets a Traffic Manager profile. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-04-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. profileName - The name of the Traffic Manager profile. options - ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method.

Example (ProfileGetWithEndpoints)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Profile-GET-WithEndpoints.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewProfilesClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (ProfileGetWithTrafficViewDisabled)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Profile-GET-WithTrafficViewDisabled.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewProfilesClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (ProfileGetWithTrafficViewEnabled)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Profile-GET-WithTrafficViewEnabled.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewProfilesClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*ProfilesClient) NewListByResourceGroupPager added in v0.4.0

func (client *ProfilesClient) NewListByResourceGroupPager(resourceGroupName string, options *ProfilesClientListByResourceGroupOptions) *runtime.Pager[ProfilesClientListByResourceGroupResponse]

NewListByResourceGroupPager - Lists all Traffic Manager profiles within a resource group. Generated from API version 2022-04-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. options - ProfilesClientListByResourceGroupOptions contains the optional parameters for the ProfilesClient.ListByResourceGroup method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Profile-GET-ByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewProfilesClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByResourceGroupPager("azuresdkfornetautoresttrafficmanager3640", nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*ProfilesClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - Lists all Traffic Manager profiles within a subscription. Generated from API version 2022-04-01-preview options - ProfilesClientListBySubscriptionOptions contains the optional parameters for the ProfilesClient.ListBySubscription method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Profile-GET-BySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewProfilesClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListBySubscriptionPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*ProfilesClient) Update

func (client *ProfilesClient) Update(ctx context.Context, resourceGroupName string, profileName string, parameters Profile, options *ProfilesClientUpdateOptions) (ProfilesClientUpdateResponse, error)

Update - Update a Traffic Manager profile. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-04-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. profileName - The name of the Traffic Manager profile. parameters - The Traffic Manager profile parameters supplied to the Update operation. options - ProfilesClientUpdateOptions contains the optional parameters for the ProfilesClient.Update method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/Profile-PATCH-MonitorConfig.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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewProfilesClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Update(ctx, "azuresdkfornetautoresttrafficmanager2583", "azuresdkfornetautoresttrafficmanager6192", armtrafficmanager.Profile{
		Properties: &armtrafficmanager.ProfileProperties{
			MonitorConfig: &armtrafficmanager.MonitorConfig{
				Path: to.Ptr("/testpath.aspx"),
				CustomHeaders: []*armtrafficmanager.MonitorConfigCustomHeadersItem{
					{
						Name:  to.Ptr("header-1"),
						Value: to.Ptr("value-1"),
					},
					{
						Name:  to.Ptr("header-2"),
						Value: to.Ptr("value-2"),
					}},
				IntervalInSeconds:         to.Ptr[int64](30),
				Port:                      to.Ptr[int64](80),
				TimeoutInSeconds:          to.Ptr[int64](6),
				ToleratedNumberOfFailures: to.Ptr[int64](4),
				Protocol:                  to.Ptr(armtrafficmanager.MonitorProtocolHTTP),
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

type ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityOptions added in v0.2.0

type ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityOptions struct {
}

ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityOptions contains the optional parameters for the ProfilesClient.CheckTrafficManagerRelativeDNSNameAvailability method.

type ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityResponse added in v0.2.0

type ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityResponse struct {
	NameAvailability
}

ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityResponse contains the response from method ProfilesClient.CheckTrafficManagerRelativeDNSNameAvailability.

type ProfilesClientCreateOrUpdateOptions added in v0.2.0

type ProfilesClientCreateOrUpdateOptions struct {
}

ProfilesClientCreateOrUpdateOptions contains the optional parameters for the ProfilesClient.CreateOrUpdate method.

type ProfilesClientCreateOrUpdateResponse added in v0.2.0

type ProfilesClientCreateOrUpdateResponse struct {
	Profile
}

ProfilesClientCreateOrUpdateResponse contains the response from method ProfilesClient.CreateOrUpdate.

type ProfilesClientDeleteOptions added in v0.2.0

type ProfilesClientDeleteOptions struct {
}

ProfilesClientDeleteOptions contains the optional parameters for the ProfilesClient.Delete method.

type ProfilesClientDeleteResponse added in v0.2.0

type ProfilesClientDeleteResponse struct {
	DeleteOperationResult
}

ProfilesClientDeleteResponse contains the response from method ProfilesClient.Delete.

type ProfilesClientGetOptions added in v0.2.0

type ProfilesClientGetOptions struct {
}

ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method.

type ProfilesClientGetResponse added in v0.2.0

type ProfilesClientGetResponse struct {
	Profile
}

ProfilesClientGetResponse contains the response from method ProfilesClient.Get.

type ProfilesClientListByResourceGroupOptions added in v0.2.0

type ProfilesClientListByResourceGroupOptions struct {
}

ProfilesClientListByResourceGroupOptions contains the optional parameters for the ProfilesClient.ListByResourceGroup method.

type ProfilesClientListByResourceGroupResponse added in v0.2.0

type ProfilesClientListByResourceGroupResponse struct {
	ProfileListResult
}

ProfilesClientListByResourceGroupResponse contains the response from method ProfilesClient.ListByResourceGroup.

type ProfilesClientListBySubscriptionOptions added in v0.2.0

type ProfilesClientListBySubscriptionOptions struct {
}

ProfilesClientListBySubscriptionOptions contains the optional parameters for the ProfilesClient.ListBySubscription method.

type ProfilesClientListBySubscriptionResponse added in v0.2.0

type ProfilesClientListBySubscriptionResponse struct {
	ProfileListResult
}

ProfilesClientListBySubscriptionResponse contains the response from method ProfilesClient.ListBySubscription.

type ProfilesClientUpdateOptions added in v0.2.0

type ProfilesClientUpdateOptions struct {
}

ProfilesClientUpdateOptions contains the optional parameters for the ProfilesClient.Update method.

type ProfilesClientUpdateResponse added in v0.2.0

type ProfilesClientUpdateResponse struct {
	Profile
}

ProfilesClientUpdateResponse contains the response from method ProfilesClient.Update.

type ProxyResource

type ProxyResource struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

ProxyResource - The resource model definition for a ARM proxy resource. It will have everything other than required location and tags

func (ProxyResource) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ProxyResource.

func (*ProxyResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.

type QueryExperience

type QueryExperience struct {
	// REQUIRED; The id of the endpoint from the 'endpoints' array which these queries were routed to.
	EndpointID *int32 `json:"endpointId,omitempty"`

	// REQUIRED; The number of queries originating from this location.
	QueryCount *int32 `json:"queryCount,omitempty"`

	// The latency experienced by queries originating from this location.
	Latency *float64 `json:"latency,omitempty"`
}

QueryExperience - Class representing a Traffic Manager HeatMap query experience properties.

func (QueryExperience) MarshalJSON added in v1.1.0

func (q QueryExperience) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryExperience.

func (*QueryExperience) UnmarshalJSON added in v1.1.0

func (q *QueryExperience) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryExperience.

type Region

type Region struct {
	// The code of the region
	Code *string `json:"code,omitempty"`

	// The name of the region
	Name *string `json:"name,omitempty"`

	// The list of Regions grouped under this Region in the Geographic Hierarchy.
	Regions []*Region `json:"regions,omitempty"`
}

Region - Class representing a region in the Geographic hierarchy used with the Geographic traffic routing method.

func (Region) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Region.

func (*Region) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Region.

type Resource

type Resource struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

Resource - The core properties of ARM resources

func (Resource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type TrackedResource

type TrackedResource struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The Azure Region where the resource lives
	Location *string `json:"location,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

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

func (TrackedResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TrackedResource.

func (*TrackedResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.

type TrafficFlow

type TrafficFlow struct {
	// The approximate latitude that these queries originated from.
	Latitude *float64 `json:"latitude,omitempty"`

	// The approximate longitude that these queries originated from.
	Longitude *float64 `json:"longitude,omitempty"`

	// The query experiences produced in this HeatMap calculation.
	QueryExperiences []*QueryExperience `json:"queryExperiences,omitempty"`

	// The IP address that this query experience originated from.
	SourceIP *string `json:"sourceIp,omitempty"`
}

TrafficFlow - Class representing a Traffic Manager HeatMap traffic flow properties.

func (TrafficFlow) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TrafficFlow.

func (*TrafficFlow) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TrafficFlow.

type TrafficRoutingMethod

type TrafficRoutingMethod string

TrafficRoutingMethod - The traffic routing method of the Traffic Manager profile.

const (
	TrafficRoutingMethodGeographic  TrafficRoutingMethod = "Geographic"
	TrafficRoutingMethodMultiValue  TrafficRoutingMethod = "MultiValue"
	TrafficRoutingMethodPerformance TrafficRoutingMethod = "Performance"
	TrafficRoutingMethodPriority    TrafficRoutingMethod = "Priority"
	TrafficRoutingMethodSubnet      TrafficRoutingMethod = "Subnet"
	TrafficRoutingMethodWeighted    TrafficRoutingMethod = "Weighted"
)

func PossibleTrafficRoutingMethodValues

func PossibleTrafficRoutingMethodValues() []TrafficRoutingMethod

PossibleTrafficRoutingMethodValues returns the possible values for the TrafficRoutingMethod const type.

type TrafficViewEnrollmentStatus

type TrafficViewEnrollmentStatus string

TrafficViewEnrollmentStatus - Indicates whether Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. Null, indicates 'Disabled'. Enabling this feature will increase the cost of the Traffic Manage profile.

const (
	TrafficViewEnrollmentStatusDisabled TrafficViewEnrollmentStatus = "Disabled"
	TrafficViewEnrollmentStatusEnabled  TrafficViewEnrollmentStatus = "Enabled"
)

func PossibleTrafficViewEnrollmentStatusValues

func PossibleTrafficViewEnrollmentStatusValues() []TrafficViewEnrollmentStatus

PossibleTrafficViewEnrollmentStatusValues returns the possible values for the TrafficViewEnrollmentStatus const type.

type UserMetricsKeysClient added in v0.2.0

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

UserMetricsKeysClient contains the methods for the TrafficManagerUserMetricsKeys group. Don't use this type directly, use NewUserMetricsKeysClient() instead.

func NewUserMetricsKeysClient added in v0.2.0

func NewUserMetricsKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserMetricsKeysClient, error)

NewUserMetricsKeysClient creates a new instance of UserMetricsKeysClient 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 (*UserMetricsKeysClient) CreateOrUpdate added in v0.2.0

CreateOrUpdate - Create or update a subscription-level key used for Real User Metrics collection. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-04-01-preview options - UserMetricsKeysClientCreateOrUpdateOptions contains the optional parameters for the UserMetricsKeysClient.CreateOrUpdate method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/TrafficManagerUserMetricsKeys-PUT.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewUserMetricsKeysClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = client.CreateOrUpdate(ctx, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*UserMetricsKeysClient) Delete added in v0.2.0

Delete - Delete a subscription-level key used for Real User Metrics collection. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-04-01-preview options - UserMetricsKeysClientDeleteOptions contains the optional parameters for the UserMetricsKeysClient.Delete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/TrafficManagerUserMetricsKeys-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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewUserMetricsKeysClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Delete(ctx, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*UserMetricsKeysClient) Get added in v0.2.0

Get - Get the subscription-level key used for Real User Metrics collection. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-04-01-preview options - UserMetricsKeysClientGetOptions contains the optional parameters for the UserMetricsKeysClient.Get method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/trafficmanager/resource-manager/Microsoft.Network/preview/2022-04-01-preview/examples/TrafficManagerUserMetricsKeys-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/trafficmanager/armtrafficmanager"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armtrafficmanager.NewUserMetricsKeysClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

type UserMetricsKeysClientCreateOrUpdateOptions added in v0.2.0

type UserMetricsKeysClientCreateOrUpdateOptions struct {
}

UserMetricsKeysClientCreateOrUpdateOptions contains the optional parameters for the UserMetricsKeysClient.CreateOrUpdate method.

type UserMetricsKeysClientCreateOrUpdateResponse added in v0.2.0

type UserMetricsKeysClientCreateOrUpdateResponse struct {
	UserMetricsModel
}

UserMetricsKeysClientCreateOrUpdateResponse contains the response from method UserMetricsKeysClient.CreateOrUpdate.

type UserMetricsKeysClientDeleteOptions added in v0.2.0

type UserMetricsKeysClientDeleteOptions struct {
}

UserMetricsKeysClientDeleteOptions contains the optional parameters for the UserMetricsKeysClient.Delete method.

type UserMetricsKeysClientDeleteResponse added in v0.2.0

type UserMetricsKeysClientDeleteResponse struct {
	DeleteOperationResult
}

UserMetricsKeysClientDeleteResponse contains the response from method UserMetricsKeysClient.Delete.

type UserMetricsKeysClientGetOptions added in v0.2.0

type UserMetricsKeysClientGetOptions struct {
}

UserMetricsKeysClientGetOptions contains the optional parameters for the UserMetricsKeysClient.Get method.

type UserMetricsKeysClientGetResponse added in v0.2.0

type UserMetricsKeysClientGetResponse struct {
	UserMetricsModel
}

UserMetricsKeysClientGetResponse contains the response from method UserMetricsKeysClient.Get.

type UserMetricsModel

type UserMetricsModel struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// The properties of the Traffic Manager User Metrics.
	Properties *UserMetricsProperties `json:"properties,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

UserMetricsModel - Class representing Traffic Manager User Metrics.

func (UserMetricsModel) MarshalJSON

func (u UserMetricsModel) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UserMetricsModel.

func (*UserMetricsModel) UnmarshalJSON added in v1.1.0

func (u *UserMetricsModel) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UserMetricsModel.

type UserMetricsProperties

type UserMetricsProperties struct {
	// The key returned by the User Metrics operation.
	Key *string `json:"key,omitempty"`
}

UserMetricsProperties - Class representing a Traffic Manager Real User Metrics key response.

func (UserMetricsProperties) MarshalJSON added in v1.1.0

func (u UserMetricsProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UserMetricsProperties.

func (*UserMetricsProperties) UnmarshalJSON added in v1.1.0

func (u *UserMetricsProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UserMetricsProperties.

Jump to

Keyboard shortcuts

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