armpeering

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 15 Imported by: 4

README

Azure Peering Service Module for Go

PkgGoDev

The armpeering module provides operations for working with Azure Peering Service.

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 Peering Service module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering

Authorization

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

cred, err := azidentity.NewDefaultAzureCredential(nil)

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

Client Factory

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

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

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

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

Clients

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

client := clientFactory.NewPeeringsClient()

Fakes

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

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

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Peering Service 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 BandwidthOffer added in v0.2.0

type BandwidthOffer struct {
	// The name of the bandwidth offer.
	OfferName *string

	// The value of the bandwidth offer in Mbps.
	ValueInMbps *int32
}

BandwidthOffer - The properties that define a peering bandwidth offer.

func (BandwidthOffer) MarshalJSON added in v1.1.0

func (b BandwidthOffer) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BandwidthOffer.

func (*BandwidthOffer) UnmarshalJSON added in v1.1.0

func (b *BandwidthOffer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BandwidthOffer.

type BgpSession

type BgpSession struct {
	// The MD5 authentication key of the session.
	MD5AuthenticationKey *string

	// The maximum number of prefixes advertised over the IPv4 session.
	MaxPrefixesAdvertisedV4 *int32

	// The maximum number of prefixes advertised over the IPv6 session.
	MaxPrefixesAdvertisedV6 *int32

	// The IPv4 session address on Microsoft's end.
	MicrosoftSessionIPv4Address *string

	// The IPv6 session address on Microsoft's end.
	MicrosoftSessionIPv6Address *string

	// The IPv4 session address on peer's end.
	PeerSessionIPv4Address *string

	// The IPv6 session address on peer's end.
	PeerSessionIPv6Address *string

	// The IPv4 prefix that contains both ends' IPv4 addresses.
	SessionPrefixV4 *string

	// The IPv6 prefix that contains both ends' IPv6 addresses.
	SessionPrefixV6 *string

	// READ-ONLY; The state of the IPv4 session.
	SessionStateV4 *SessionStateV4

	// READ-ONLY; The state of the IPv6 session.
	SessionStateV6 *SessionStateV6
}

BgpSession - The properties that define a BGP session.

func (BgpSession) MarshalJSON added in v1.1.0

func (b BgpSession) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BgpSession.

func (*BgpSession) UnmarshalJSON added in v1.1.0

func (b *BgpSession) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BgpSession.

type CdnPeeringPrefix added in v0.3.0

type CdnPeeringPrefix struct {
	// The properties that define a cdn peering prefix.
	Properties *CdnPeeringPrefixProperties

	// READ-ONLY; The ID of the resource.
	ID *string

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

	// READ-ONLY; The type of the resource.
	Type *string
}

CdnPeeringPrefix - The CDN peering prefix

func (CdnPeeringPrefix) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type CdnPeeringPrefix.

func (*CdnPeeringPrefix) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CdnPeeringPrefix.

type CdnPeeringPrefixListResult added in v0.3.0

type CdnPeeringPrefixListResult struct {
	// The link to fetch the next page of CDN peering prefixes.
	NextLink *string

	// The list of CDN peering prefixes.
	Value []*CdnPeeringPrefix
}

CdnPeeringPrefixListResult - The paginated list of CDN peering prefixes.

func (CdnPeeringPrefixListResult) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type CdnPeeringPrefixListResult.

func (*CdnPeeringPrefixListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CdnPeeringPrefixListResult.

type CdnPeeringPrefixProperties added in v0.3.0

type CdnPeeringPrefixProperties struct {
	// READ-ONLY; The Azure region.
	AzureRegion *string

	// READ-ONLY; The Azure service.
	AzureService *string

	// READ-ONLY; The BGP Community
	BgpCommunity *string

	// READ-ONLY; The flag that indicates whether or not this is the primary region.
	IsPrimaryRegion *bool

	// READ-ONLY; The prefix.
	Prefix *string
}

CdnPeeringPrefixProperties - The properties that define a CDN peering prefix

func (CdnPeeringPrefixProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type CdnPeeringPrefixProperties.

func (*CdnPeeringPrefixProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CdnPeeringPrefixProperties.

type CdnPeeringPrefixesClient added in v0.3.0

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

CdnPeeringPrefixesClient contains the methods for the CdnPeeringPrefixes group. Don't use this type directly, use NewCdnPeeringPrefixesClient() instead.

func NewCdnPeeringPrefixesClient added in v0.3.0

func NewCdnPeeringPrefixesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CdnPeeringPrefixesClient, error)

NewCdnPeeringPrefixesClient creates a new instance of CdnPeeringPrefixesClient with the specified values.

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

func (*CdnPeeringPrefixesClient) NewListPager added in v0.5.0

NewListPager - Lists all of the advertised prefixes for the specified peering location

Generated from API version 2022-01-01

  • peeringLocation - The peering location.
  • options - CdnPeeringPrefixesClientListOptions contains the optional parameters for the CdnPeeringPrefixesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListCdnPeeringPrefixes.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewCdnPeeringPrefixesClient().NewListPager("peeringLocation0", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.CdnPeeringPrefixListResult = armpeering.CdnPeeringPrefixListResult{
		// 	Value: []*armpeering.CdnPeeringPrefix{
		// 		{
		// 			Name: to.Ptr("CdnPrefix_192_168_1_0_24"),
		// 			Type: to.Ptr("Microsoft.Peering/cdnPeeringPrefixes"),
		// 			ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/cdnPeeringPrefixes/CdnPrefix_192_168_1_0_24"),
		// 			Properties: &armpeering.CdnPeeringPrefixProperties{
		// 				AzureRegion: to.Ptr("West Central US"),
		// 				AzureService: to.Ptr("AzureCompute"),
		// 				BgpCommunity: to.Ptr("0000:0000"),
		// 				IsPrimaryRegion: to.Ptr(false),
		// 				Prefix: to.Ptr("192.168.1.0/24"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type CdnPeeringPrefixesClientListOptions added in v0.3.0

type CdnPeeringPrefixesClientListOptions struct {
}

CdnPeeringPrefixesClientListOptions contains the optional parameters for the CdnPeeringPrefixesClient.NewListPager method.

type CdnPeeringPrefixesClientListResponse added in v0.3.0

type CdnPeeringPrefixesClientListResponse struct {
	// The paginated list of CDN peering prefixes.
	CdnPeeringPrefixListResult
}

CdnPeeringPrefixesClientListResponse contains the response from method CdnPeeringPrefixesClient.NewListPager.

type CheckServiceProviderAvailabilityInput

type CheckServiceProviderAvailabilityInput struct {
	// Gets or sets the peering service location.
	PeeringServiceLocation *string

	// Gets or sets the peering service provider.
	PeeringServiceProvider *string
}

CheckServiceProviderAvailabilityInput - Class for CheckServiceProviderAvailabilityInput

func (CheckServiceProviderAvailabilityInput) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type CheckServiceProviderAvailabilityInput.

func (*CheckServiceProviderAvailabilityInput) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CheckServiceProviderAvailabilityInput.

type ClientFactory added in v1.1.0

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

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory added in v1.1.0

func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

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

func (*ClientFactory) NewCdnPeeringPrefixesClient added in v1.1.0

func (c *ClientFactory) NewCdnPeeringPrefixesClient() *CdnPeeringPrefixesClient

NewCdnPeeringPrefixesClient creates a new instance of CdnPeeringPrefixesClient.

func (*ClientFactory) NewConnectionMonitorTestsClient added in v1.1.0

func (c *ClientFactory) NewConnectionMonitorTestsClient() *ConnectionMonitorTestsClient

NewConnectionMonitorTestsClient creates a new instance of ConnectionMonitorTestsClient.

func (*ClientFactory) NewLegacyPeeringsClient added in v1.1.0

func (c *ClientFactory) NewLegacyPeeringsClient() *LegacyPeeringsClient

NewLegacyPeeringsClient creates a new instance of LegacyPeeringsClient.

func (*ClientFactory) NewLocationsClient added in v1.1.0

func (c *ClientFactory) NewLocationsClient() *LocationsClient

NewLocationsClient creates a new instance of LocationsClient.

func (*ClientFactory) NewLookingGlassClient added in v1.1.0

func (c *ClientFactory) NewLookingGlassClient() *LookingGlassClient

NewLookingGlassClient creates a new instance of LookingGlassClient.

func (*ClientFactory) NewManagementClient added in v1.1.0

func (c *ClientFactory) NewManagementClient() *ManagementClient

NewManagementClient creates a new instance of ManagementClient.

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewPeerAsnsClient added in v1.1.0

func (c *ClientFactory) NewPeerAsnsClient() *PeerAsnsClient

NewPeerAsnsClient creates a new instance of PeerAsnsClient.

func (*ClientFactory) NewPeeringsClient added in v1.1.0

func (c *ClientFactory) NewPeeringsClient() *PeeringsClient

NewPeeringsClient creates a new instance of PeeringsClient.

func (*ClientFactory) NewPrefixesClient added in v1.1.0

func (c *ClientFactory) NewPrefixesClient() *PrefixesClient

NewPrefixesClient creates a new instance of PrefixesClient.

func (*ClientFactory) NewReceivedRoutesClient added in v1.1.0

func (c *ClientFactory) NewReceivedRoutesClient() *ReceivedRoutesClient

NewReceivedRoutesClient creates a new instance of ReceivedRoutesClient.

func (*ClientFactory) NewRegisteredAsnsClient added in v1.1.0

func (c *ClientFactory) NewRegisteredAsnsClient() *RegisteredAsnsClient

NewRegisteredAsnsClient creates a new instance of RegisteredAsnsClient.

func (*ClientFactory) NewRegisteredPrefixesClient added in v1.1.0

func (c *ClientFactory) NewRegisteredPrefixesClient() *RegisteredPrefixesClient

NewRegisteredPrefixesClient creates a new instance of RegisteredPrefixesClient.

func (*ClientFactory) NewServiceCountriesClient added in v1.1.0

func (c *ClientFactory) NewServiceCountriesClient() *ServiceCountriesClient

NewServiceCountriesClient creates a new instance of ServiceCountriesClient.

func (*ClientFactory) NewServiceLocationsClient added in v1.1.0

func (c *ClientFactory) NewServiceLocationsClient() *ServiceLocationsClient

NewServiceLocationsClient creates a new instance of ServiceLocationsClient.

func (*ClientFactory) NewServiceProvidersClient added in v1.1.0

func (c *ClientFactory) NewServiceProvidersClient() *ServiceProvidersClient

NewServiceProvidersClient creates a new instance of ServiceProvidersClient.

func (*ClientFactory) NewServicesClient added in v1.1.0

func (c *ClientFactory) NewServicesClient() *ServicesClient

NewServicesClient creates a new instance of ServicesClient.

type Command added in v0.3.0

type Command string

Command - Invoked command

const (
	CommandBgpRoute   Command = "BgpRoute"
	CommandPing       Command = "Ping"
	CommandTraceroute Command = "Traceroute"
)

func PossibleCommandValues added in v0.3.0

func PossibleCommandValues() []Command

PossibleCommandValues returns the possible values for the Command const type.

type ConnectionMonitorTest added in v0.3.0

type ConnectionMonitorTest struct {
	// The properties that define a Connection Monitor Test.
	Properties *ConnectionMonitorTestProperties

	// READ-ONLY; The ID of the resource.
	ID *string

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

	// READ-ONLY; The type of the resource.
	Type *string
}

ConnectionMonitorTest - The Connection Monitor Test class.

func (ConnectionMonitorTest) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorTest.

func (*ConnectionMonitorTest) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorTest.

type ConnectionMonitorTestListResult added in v0.3.0

type ConnectionMonitorTestListResult struct {
	// The link to fetch the next page of [T].
	NextLink *string

	// The list of [T].
	Value []*ConnectionMonitorTest
}

ConnectionMonitorTestListResult - The paginated list of [T].

func (ConnectionMonitorTestListResult) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorTestListResult.

func (*ConnectionMonitorTestListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorTestListResult.

type ConnectionMonitorTestProperties added in v0.3.0

type ConnectionMonitorTestProperties struct {
	// The Connection Monitor test destination
	Destination *string

	// The Connection Monitor test destination port
	DestinationPort *int32

	// The Connection Monitor test source agent
	SourceAgent *string

	// The Connection Monitor test frequency in seconds
	TestFrequencyInSec *int32

	// READ-ONLY; The flag that indicates if the Connection Monitor test is successful or not.
	IsTestSuccessful *bool

	// READ-ONLY; The path representing the Connection Monitor test.
	Path []*string

	// READ-ONLY; The provisioning state of the resource.
	ProvisioningState *ProvisioningState
}

ConnectionMonitorTestProperties - The properties that define a Connection Monitor Test.

func (ConnectionMonitorTestProperties) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ConnectionMonitorTestProperties.

func (*ConnectionMonitorTestProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorTestProperties.

type ConnectionMonitorTestsClient added in v0.3.0

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

ConnectionMonitorTestsClient contains the methods for the ConnectionMonitorTests group. Don't use this type directly, use NewConnectionMonitorTestsClient() instead.

func NewConnectionMonitorTestsClient added in v0.3.0

func NewConnectionMonitorTestsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectionMonitorTestsClient, error)

NewConnectionMonitorTestsClient creates a new instance of ConnectionMonitorTestsClient with the specified values.

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

func (*ConnectionMonitorTestsClient) CreateOrUpdate added in v0.3.0

func (client *ConnectionMonitorTestsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringServiceName string, connectionMonitorTestName string, connectionMonitorTest ConnectionMonitorTest, options *ConnectionMonitorTestsClientCreateOrUpdateOptions) (ConnectionMonitorTestsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates a connection monitor test with the specified name under the given subscription, resource group and peering service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringServiceName - The name of the peering service.
  • connectionMonitorTestName - The name of the connection monitor test
  • connectionMonitorTest - The properties needed to create a connection monitor test
  • options - ConnectionMonitorTestsClientCreateOrUpdateOptions contains the optional parameters for the ConnectionMonitorTestsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreateOrUpdateConnectionMonitorTest.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/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConnectionMonitorTestsClient().CreateOrUpdate(ctx, "rgName", "peeringServiceName", "connectionMonitorTestName", armpeering.ConnectionMonitorTest{
		Properties: &armpeering.ConnectionMonitorTestProperties{
			Destination:        to.Ptr("Example Destination"),
			DestinationPort:    to.Ptr[int32](443),
			SourceAgent:        to.Ptr("Example Source Agent"),
			TestFrequencyInSec: to.Ptr[int32](30),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ConnectionMonitorTest = armpeering.ConnectionMonitorTest{
	// 	Name: to.Ptr("connectionMonitorTestName"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peeringServices/peeringServiceName/connectionMonitorTests/connectionMonitorTestName"),
	// 	Properties: &armpeering.ConnectionMonitorTestProperties{
	// 		Path: []*string{
	// 		},
	// 		Destination: to.Ptr("Example Destination"),
	// 		DestinationPort: to.Ptr[int32](443),
	// 		IsTestSuccessful: to.Ptr(false),
	// 		ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 		SourceAgent: to.Ptr("Example Source Agent"),
	// 		TestFrequencyInSec: to.Ptr[int32](30),
	// 	},
	// }
}
Output:

func (*ConnectionMonitorTestsClient) Delete added in v0.3.0

func (client *ConnectionMonitorTestsClient) Delete(ctx context.Context, resourceGroupName string, peeringServiceName string, connectionMonitorTestName string, options *ConnectionMonitorTestsClientDeleteOptions) (ConnectionMonitorTestsClientDeleteResponse, error)

Delete - Deletes an existing connection monitor test with the specified name under the given subscription, resource group and peering service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringServiceName - The name of the peering service.
  • connectionMonitorTestName - The name of the connection monitor test
  • options - ConnectionMonitorTestsClientDeleteOptions contains the optional parameters for the ConnectionMonitorTestsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/DeleteConnectionMonitorTest.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewConnectionMonitorTestsClient().Delete(ctx, "rgName", "peeringServiceName", "connectionMonitorTestName", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ConnectionMonitorTestsClient) Get added in v0.3.0

func (client *ConnectionMonitorTestsClient) Get(ctx context.Context, resourceGroupName string, peeringServiceName string, connectionMonitorTestName string, options *ConnectionMonitorTestsClientGetOptions) (ConnectionMonitorTestsClientGetResponse, error)

Get - Gets an existing connection monitor test with the specified name under the given subscription, resource group and peering service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringServiceName - The name of the peering service.
  • connectionMonitorTestName - The name of the connection monitor test
  • options - ConnectionMonitorTestsClientGetOptions contains the optional parameters for the ConnectionMonitorTestsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetConnectionMonitorTest.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConnectionMonitorTestsClient().Get(ctx, "rgName", "peeringServiceName", "connectionMonitorTestName", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ConnectionMonitorTest = armpeering.ConnectionMonitorTest{
	// 	Name: to.Ptr("connectionMonitorTestName"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peeringServices/peeringServiceName/connectionMonitorTests/connectionMonitorTestName"),
	// 	Properties: &armpeering.ConnectionMonitorTestProperties{
	// 		Path: []*string{
	// 			to.Ptr("source"),
	// 			to.Ptr("hop1"),
	// 			to.Ptr("hop2"),
	// 			to.Ptr("destination")},
	// 			Destination: to.Ptr("Example Destination"),
	// 			DestinationPort: to.Ptr[int32](443),
	// 			IsTestSuccessful: to.Ptr(true),
	// 			ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 			SourceAgent: to.Ptr("Example Source Agent"),
	// 			TestFrequencyInSec: to.Ptr[int32](30),
	// 		},
	// 	}
}
Output:

func (*ConnectionMonitorTestsClient) NewListByPeeringServicePager added in v0.5.0

NewListByPeeringServicePager - Lists all connection monitor tests under the given subscription, resource group and peering service.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringServiceName - The name of the peering service.
  • options - ConnectionMonitorTestsClientListByPeeringServiceOptions contains the optional parameters for the ConnectionMonitorTestsClient.NewListByPeeringServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListConnectionMonitorTestsByPeeringService.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConnectionMonitorTestsClient().NewListByPeeringServicePager("rgName", "peeringServiceName", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ConnectionMonitorTestListResult = armpeering.ConnectionMonitorTestListResult{
		// 	Value: []*armpeering.ConnectionMonitorTest{
		// 		{
		// 			Name: to.Ptr("connectionMonitorTestName1"),
		// 			ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peeringServices/peeringServiceName/connectionMonitorTests/connectionMonitorTestName1"),
		// 			Properties: &armpeering.ConnectionMonitorTestProperties{
		// 				Path: []*string{
		// 					to.Ptr("source"),
		// 					to.Ptr("hop1"),
		// 					to.Ptr("hop2"),
		// 					to.Ptr("destination")},
		// 					Destination: to.Ptr("Example Destination"),
		// 					DestinationPort: to.Ptr[int32](443),
		// 					IsTestSuccessful: to.Ptr(true),
		// 					ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
		// 					SourceAgent: to.Ptr("Example Source Agent"),
		// 					TestFrequencyInSec: to.Ptr[int32](30),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("connectionMonitorTestName2"),
		// 				ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peeringServices/peeringServiceName/connectionMonitorTests/connectionMonitorTestName2"),
		// 				Properties: &armpeering.ConnectionMonitorTestProperties{
		// 					Path: []*string{
		// 						to.Ptr("source"),
		// 						to.Ptr("hop1"),
		// 						to.Ptr("hop2"),
		// 						to.Ptr("destination")},
		// 						Destination: to.Ptr("Example Destination 2"),
		// 						DestinationPort: to.Ptr[int32](443),
		// 						IsTestSuccessful: to.Ptr(false),
		// 						ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
		// 						SourceAgent: to.Ptr("Example Source Agent"),
		// 						TestFrequencyInSec: to.Ptr[int32](30),
		// 					},
		// 			}},
		// 		}
	}
}
Output:

type ConnectionMonitorTestsClientCreateOrUpdateOptions added in v0.3.0

type ConnectionMonitorTestsClientCreateOrUpdateOptions struct {
}

ConnectionMonitorTestsClientCreateOrUpdateOptions contains the optional parameters for the ConnectionMonitorTestsClient.CreateOrUpdate method.

type ConnectionMonitorTestsClientCreateOrUpdateResponse added in v0.3.0

type ConnectionMonitorTestsClientCreateOrUpdateResponse struct {
	// The Connection Monitor Test class.
	ConnectionMonitorTest
}

ConnectionMonitorTestsClientCreateOrUpdateResponse contains the response from method ConnectionMonitorTestsClient.CreateOrUpdate.

type ConnectionMonitorTestsClientDeleteOptions added in v0.3.0

type ConnectionMonitorTestsClientDeleteOptions struct {
}

ConnectionMonitorTestsClientDeleteOptions contains the optional parameters for the ConnectionMonitorTestsClient.Delete method.

type ConnectionMonitorTestsClientDeleteResponse added in v0.3.0

type ConnectionMonitorTestsClientDeleteResponse struct {
}

ConnectionMonitorTestsClientDeleteResponse contains the response from method ConnectionMonitorTestsClient.Delete.

type ConnectionMonitorTestsClientGetOptions added in v0.3.0

type ConnectionMonitorTestsClientGetOptions struct {
}

ConnectionMonitorTestsClientGetOptions contains the optional parameters for the ConnectionMonitorTestsClient.Get method.

type ConnectionMonitorTestsClientGetResponse added in v0.3.0

type ConnectionMonitorTestsClientGetResponse struct {
	// The Connection Monitor Test class.
	ConnectionMonitorTest
}

ConnectionMonitorTestsClientGetResponse contains the response from method ConnectionMonitorTestsClient.Get.

type ConnectionMonitorTestsClientListByPeeringServiceOptions added in v0.3.0

type ConnectionMonitorTestsClientListByPeeringServiceOptions struct {
}

ConnectionMonitorTestsClientListByPeeringServiceOptions contains the optional parameters for the ConnectionMonitorTestsClient.NewListByPeeringServicePager method.

type ConnectionMonitorTestsClientListByPeeringServiceResponse added in v0.3.0

type ConnectionMonitorTestsClientListByPeeringServiceResponse struct {
	// The paginated list of [T].
	ConnectionMonitorTestListResult
}

ConnectionMonitorTestsClientListByPeeringServiceResponse contains the response from method ConnectionMonitorTestsClient.NewListByPeeringServicePager.

type ConnectionState

type ConnectionState string

ConnectionState - The state of the connection.

const (
	ConnectionStateActive                ConnectionState = "Active"
	ConnectionStateApproved              ConnectionState = "Approved"
	ConnectionStateNone                  ConnectionState = "None"
	ConnectionStatePendingApproval       ConnectionState = "PendingApproval"
	ConnectionStateProvisioningCompleted ConnectionState = "ProvisioningCompleted"
	ConnectionStateProvisioningFailed    ConnectionState = "ProvisioningFailed"
	ConnectionStateProvisioningStarted   ConnectionState = "ProvisioningStarted"
	ConnectionStateValidating            ConnectionState = "Validating"
)

func PossibleConnectionStateValues

func PossibleConnectionStateValues() []ConnectionState

PossibleConnectionStateValues returns the possible values for the ConnectionState const type.

type ContactDetail added in v0.3.0

type ContactDetail struct {
	// The e-mail address of the contact.
	Email *string

	// The phone number of the contact.
	Phone *string

	// The role of the contact.
	Role *Role
}

ContactDetail - The contact detail class.

func (ContactDetail) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ContactDetail.

func (*ContactDetail) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ContactDetail.

type DirectConnection

type DirectConnection struct {
	// The bandwidth of the connection.
	BandwidthInMbps *int32

	// The BGP session associated with the connection.
	BgpSession *BgpSession

	// The unique identifier (GUID) for the connection.
	ConnectionIdentifier *string

	// The PeeringDB.com ID of the facility at which the connection has to be set up.
	PeeringDBFacilityID *int32

	// The field indicating if Microsoft provides session ip addresses.
	SessionAddressProvider *SessionAddressProvider

	// The flag that indicates whether or not the connection is used for peering service.
	UseForPeeringService *bool

	// READ-ONLY; The state of the connection.
	ConnectionState *ConnectionState

	// READ-ONLY; The error message related to the connection state, if any.
	ErrorMessage *string

	// READ-ONLY; The ID used within Microsoft's peering provisioning system to track the connection
	MicrosoftTrackingID *string

	// READ-ONLY; The bandwidth that is actually provisioned.
	ProvisionedBandwidthInMbps *int32
}

DirectConnection - The properties that define a direct connection.

func (DirectConnection) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type DirectConnection.

func (*DirectConnection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DirectConnection.

type DirectPeeringFacility

type DirectPeeringFacility struct {
	// The address of the direct peering facility.
	Address *string

	// The type of the direct peering.
	DirectPeeringType *DirectPeeringType

	// The PeeringDB.com ID of the facility.
	PeeringDBFacilityID *int32

	// The PeeringDB.com URL of the facility.
	PeeringDBFacilityLink *string
}

DirectPeeringFacility - The properties that define a direct peering facility.

func (DirectPeeringFacility) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type DirectPeeringFacility.

func (*DirectPeeringFacility) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DirectPeeringFacility.

type DirectPeeringType

type DirectPeeringType string

DirectPeeringType - The type of direct peering.

const (
	DirectPeeringTypeCdn                  DirectPeeringType = "Cdn"
	DirectPeeringTypeEdge                 DirectPeeringType = "Edge"
	DirectPeeringTypeEdgeZoneForOperators DirectPeeringType = "EdgeZoneForOperators"
	DirectPeeringTypeInternal             DirectPeeringType = "Internal"
	DirectPeeringTypeIx                   DirectPeeringType = "Ix"
	DirectPeeringTypeIxRs                 DirectPeeringType = "IxRs"
	DirectPeeringTypeTransit              DirectPeeringType = "Transit"
	DirectPeeringTypeVoice                DirectPeeringType = "Voice"
)

func PossibleDirectPeeringTypeValues

func PossibleDirectPeeringTypeValues() []DirectPeeringType

PossibleDirectPeeringTypeValues returns the possible values for the DirectPeeringType const type.

type Enum0

type Enum0 string
const (
	Enum0Available   Enum0 = "Available"
	Enum0Unavailable Enum0 = "Unavailable"
)

func PossibleEnum0Values

func PossibleEnum0Values() []Enum0

PossibleEnum0Values returns the possible values for the Enum0 const type.

type ErrorDetail added in v0.4.0

type ErrorDetail struct {
	// READ-ONLY; The error code.
	Code *string

	// READ-ONLY; The error message.
	Message *string
}

ErrorDetail - The error detail that describes why an operation has failed.

func (ErrorDetail) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorDetail.

func (*ErrorDetail) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.

type ErrorResponse

type ErrorResponse struct {
	// The error detail that describes why an operation has failed.
	Error *ErrorDetail
}

ErrorResponse - The error response that indicates why an operation has failed.

func (ErrorResponse) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type ExchangeConnection

type ExchangeConnection struct {
	// The BGP session associated with the connection.
	BgpSession *BgpSession

	// The unique identifier (GUID) for the connection.
	ConnectionIdentifier *string

	// The PeeringDB.com ID of the facility at which the connection has to be set up.
	PeeringDBFacilityID *int32

	// READ-ONLY; The state of the connection.
	ConnectionState *ConnectionState

	// READ-ONLY; The error message related to the connection state, if any.
	ErrorMessage *string
}

ExchangeConnection - The properties that define an exchange connection.

func (ExchangeConnection) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ExchangeConnection.

func (*ExchangeConnection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExchangeConnection.

type ExchangePeeringFacility

type ExchangePeeringFacility struct {
	// The bandwidth of the connection between Microsoft and the exchange peering facility.
	BandwidthInMbps *int32

	// The name of the exchange peering facility.
	ExchangeName *string

	// The IPv4 prefixes associated with the exchange peering facility.
	FacilityIPv4Prefix *string

	// The IPv6 prefixes associated with the exchange peering facility.
	FacilityIPv6Prefix *string

	// The IPv4 address of Microsoft at the exchange peering facility.
	MicrosoftIPv4Address *string

	// The IPv6 address of Microsoft at the exchange peering facility.
	MicrosoftIPv6Address *string

	// The PeeringDB.com ID of the facility.
	PeeringDBFacilityID *int32

	// The PeeringDB.com URL of the facility.
	PeeringDBFacilityLink *string
}

ExchangePeeringFacility - The properties that define an exchange peering facility.

func (ExchangePeeringFacility) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ExchangePeeringFacility.

func (*ExchangePeeringFacility) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExchangePeeringFacility.

type Family

type Family string

Family - The family of the peering SKU.

const (
	FamilyDirect   Family = "Direct"
	FamilyExchange Family = "Exchange"
)

func PossibleFamilyValues

func PossibleFamilyValues() []Family

PossibleFamilyValues returns the possible values for the Family const type.

type Kind

type Kind string

Kind - The kind of the peering.

const (
	KindDirect   Kind = "Direct"
	KindExchange Kind = "Exchange"
)

func PossibleKindValues

func PossibleKindValues() []Kind

PossibleKindValues returns the possible values for the Kind const type.

type LearnedType

type LearnedType string

LearnedType - The prefix learned type

const (
	LearnedTypeNone               LearnedType = "None"
	LearnedTypeViaServiceProvider LearnedType = "ViaServiceProvider"
	LearnedTypeViaSession         LearnedType = "ViaSession"
)

func PossibleLearnedTypeValues

func PossibleLearnedTypeValues() []LearnedType

PossibleLearnedTypeValues returns the possible values for the LearnedType const type.

type LegacyPeeringsClient

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

LegacyPeeringsClient contains the methods for the LegacyPeerings group. Don't use this type directly, use NewLegacyPeeringsClient() instead.

func NewLegacyPeeringsClient

func NewLegacyPeeringsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LegacyPeeringsClient, error)

NewLegacyPeeringsClient creates a new instance of LegacyPeeringsClient with the specified values.

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

func (*LegacyPeeringsClient) NewListPager added in v0.5.0

NewListPager - Lists all of the legacy peerings under the given subscription matching the specified kind and location.

Generated from API version 2022-01-01

  • peeringLocation - The location of the peering.
  • kind - The kind of the peering.
  • options - LegacyPeeringsClientListOptions contains the optional parameters for the LegacyPeeringsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListLegacyPeerings.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLegacyPeeringsClient().NewListPager("peeringLocation0", armpeering.LegacyPeeringsKindExchange, &armpeering.LegacyPeeringsClientListOptions{Asn: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ListResult = armpeering.ListResult{
		// 	Value: []*armpeering.Peering{
		// 		{
		// 			Name: to.Ptr("peeringName"),
		// 			Type: to.Ptr("Microsoft.Peering/peerings"),
		// 			ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peerings/peeringName"),
		// 			Kind: to.Ptr(armpeering.KindExchange),
		// 			Location: to.Ptr("centralus"),
		// 			Properties: &armpeering.Properties{
		// 				Exchange: &armpeering.PropertiesExchange{
		// 					Connections: []*armpeering.ExchangeConnection{
		// 						{
		// 							BgpSession: &armpeering.BgpSession{
		// 								MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
		// 								MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
		// 								MD5AuthenticationKey: to.Ptr("test-md5-auth-key"),
		// 								MicrosoftSessionIPv4Address: to.Ptr("192.168.3.1"),
		// 								MicrosoftSessionIPv6Address: to.Ptr("fd00::1:1"),
		// 								PeerSessionIPv4Address: to.Ptr("192.168.2.1"),
		// 								PeerSessionIPv6Address: to.Ptr("fd00::1"),
		// 								SessionStateV4: to.Ptr(armpeering.SessionStateV4Established),
		// 								SessionStateV6: to.Ptr(armpeering.SessionStateV6Established),
		// 							},
		// 							ConnectionIdentifier: to.Ptr("CE495334-0E94-4E51-8164-8116D6CD284D"),
		// 							ConnectionState: to.Ptr(armpeering.ConnectionStateActive),
		// 							PeeringDBFacilityID: to.Ptr[int32](99999),
		// 						},
		// 						{
		// 							BgpSession: &armpeering.BgpSession{
		// 								MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
		// 								MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
		// 								MD5AuthenticationKey: to.Ptr("test-md5-auth-key"),
		// 								MicrosoftSessionIPv4Address: to.Ptr("192.168.3.2"),
		// 								MicrosoftSessionIPv6Address: to.Ptr("fd00::1:2"),
		// 								PeerSessionIPv4Address: to.Ptr("192.168.2.2"),
		// 								PeerSessionIPv6Address: to.Ptr("fd00::2"),
		// 								SessionStateV4: to.Ptr(armpeering.SessionStateV4Established),
		// 								SessionStateV6: to.Ptr(armpeering.SessionStateV6Established),
		// 							},
		// 							ConnectionIdentifier: to.Ptr("CDD8E673-CB07-47E6-84DE-3739F778762B"),
		// 							ConnectionState: to.Ptr(armpeering.ConnectionStateActive),
		// 							PeeringDBFacilityID: to.Ptr[int32](99999),
		// 					}},
		// 					PeerAsn: &armpeering.SubResource{
		// 						ID: to.Ptr("65000"),
		// 					},
		// 				},
		// 				PeeringLocation: to.Ptr("peeringLocation0"),
		// 				ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
		// 			},
		// 			SKU: &armpeering.SKU{
		// 				Name: to.Ptr("Basic_Exchange_Free"),
		// 				Family: to.Ptr(armpeering.FamilyExchange),
		// 				Size: to.Ptr(armpeering.SizeFree),
		// 				Tier: to.Ptr(armpeering.TierBasic),
		// 			},
		// 	}},
		// }
	}
}
Output:

type LegacyPeeringsClientListOptions added in v0.2.0

type LegacyPeeringsClientListOptions struct {
	// The ASN number associated with a legacy peering.
	Asn *int32
}

LegacyPeeringsClientListOptions contains the optional parameters for the LegacyPeeringsClient.NewListPager method.

type LegacyPeeringsClientListResponse added in v0.2.0

type LegacyPeeringsClientListResponse struct {
	// The paginated list of peerings.
	ListResult
}

LegacyPeeringsClientListResponse contains the response from method LegacyPeeringsClient.NewListPager.

type LegacyPeeringsKind added in v0.3.0

type LegacyPeeringsKind string
const (
	LegacyPeeringsKindDirect   LegacyPeeringsKind = "Direct"
	LegacyPeeringsKindExchange LegacyPeeringsKind = "Exchange"
)

func PossibleLegacyPeeringsKindValues added in v0.3.0

func PossibleLegacyPeeringsKindValues() []LegacyPeeringsKind

PossibleLegacyPeeringsKindValues returns the possible values for the LegacyPeeringsKind const type.

type ListResult added in v0.2.0

type ListResult struct {
	// The link to fetch the next page of peerings.
	NextLink *string

	// The list of peerings.
	Value []*Peering
}

ListResult - The paginated list of peerings.

func (ListResult) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ListResult.

func (*ListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ListResult.

type Location added in v0.2.0

type Location struct {
	// The kind of peering that the peering location supports.
	Kind *Kind

	// The properties that define a peering location.
	Properties *LocationProperties

	// READ-ONLY; The ID of the resource.
	ID *string

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

	// READ-ONLY; The type of the resource.
	Type *string
}

Location - Peering location is where connectivity could be established to the Microsoft Cloud Edge.

func (Location) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type Location.

func (*Location) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Location.

type LocationListResult added in v0.2.0

type LocationListResult struct {
	// The link to fetch the next page of peering locations.
	NextLink *string

	// The list of peering locations.
	Value []*Location
}

LocationListResult - The paginated list of peering locations.

func (LocationListResult) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type LocationListResult.

func (*LocationListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LocationListResult.

type LocationProperties added in v0.2.0

type LocationProperties struct {
	// The Azure region associated with the peering location.
	AzureRegion *string

	// The country in which the peering location exists.
	Country *string

	// The properties that define a direct peering location.
	Direct *LocationPropertiesDirect

	// The properties that define an exchange peering location.
	Exchange *LocationPropertiesExchange

	// The name of the peering location.
	PeeringLocation *string
}

LocationProperties - The properties that define a peering location.

func (LocationProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type LocationProperties.

func (*LocationProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LocationProperties.

type LocationPropertiesDirect added in v0.2.0

type LocationPropertiesDirect struct {
	// The list of bandwidth offers available at the peering location.
	BandwidthOffers []*BandwidthOffer

	// The list of direct peering facilities at the peering location.
	PeeringFacilities []*DirectPeeringFacility
}

LocationPropertiesDirect - The properties that define a direct peering location.

func (LocationPropertiesDirect) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type LocationPropertiesDirect.

func (*LocationPropertiesDirect) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LocationPropertiesDirect.

type LocationPropertiesExchange added in v0.2.0

type LocationPropertiesExchange struct {
	// The list of exchange peering facilities at the peering location.
	PeeringFacilities []*ExchangePeeringFacility
}

LocationPropertiesExchange - The properties that define an exchange peering location.

func (LocationPropertiesExchange) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type LocationPropertiesExchange.

func (*LocationPropertiesExchange) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LocationPropertiesExchange.

type LocationsClient added in v0.2.0

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

LocationsClient contains the methods for the PeeringLocations group. Don't use this type directly, use NewLocationsClient() instead.

func NewLocationsClient added in v0.2.0

func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationsClient, error)

NewLocationsClient creates a new instance of LocationsClient with the specified values.

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

func (*LocationsClient) NewListPager added in v0.5.0

NewListPager - Lists all of the available peering locations for the specified kind of peering.

Generated from API version 2022-01-01

  • kind - The kind of the peering.
  • options - LocationsClientListOptions contains the optional parameters for the LocationsClient.NewListPager method.
Example (ListDirectPeeringLocations)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListDirectPeeringLocations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLocationsClient().NewListPager(armpeering.PeeringLocationsKindDirect, &armpeering.LocationsClientListOptions{DirectPeeringType: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.LocationListResult = armpeering.LocationListResult{
		// 	Value: []*armpeering.Location{
		// 		{
		// 			Name: to.Ptr("peeringLocation1"),
		// 			Type: to.Ptr("Microsoft.Peering/peeringLocations"),
		// 			ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peeringLocations/peeringLocation1"),
		// 			Kind: to.Ptr(armpeering.KindDirect),
		// 			Properties: &armpeering.LocationProperties{
		// 				Country: to.Ptr("country1"),
		// 				Direct: &armpeering.LocationPropertiesDirect{
		// 					BandwidthOffers: []*armpeering.BandwidthOffer{
		// 						{
		// 							OfferName: to.Ptr("10Gbps"),
		// 							ValueInMbps: to.Ptr[int32](10000),
		// 						},
		// 						{
		// 							OfferName: to.Ptr("100Gbps"),
		// 							ValueInMbps: to.Ptr[int32](100000),
		// 					}},
		// 					PeeringFacilities: []*armpeering.DirectPeeringFacility{
		// 						{
		// 							Address: to.Ptr("address1"),
		// 							DirectPeeringType: to.Ptr(armpeering.DirectPeeringTypeEdge),
		// 							PeeringDBFacilityID: to.Ptr[int32](99999),
		// 							PeeringDBFacilityLink: to.Ptr("https://www.peeringdb.com/fac/99999"),
		// 						},
		// 						{
		// 							Address: to.Ptr("address3"),
		// 							DirectPeeringType: to.Ptr(armpeering.DirectPeeringTypeCdn),
		// 							PeeringDBFacilityID: to.Ptr[int32](99999),
		// 							PeeringDBFacilityLink: to.Ptr("https://www.peeringdb.com/fac/99999"),
		// 					}},
		// 				},
		// 				PeeringLocation: to.Ptr("peeringLocation1"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("peeringLocation2"),
		// 			Type: to.Ptr("Microsoft.Peering/peeringLocations"),
		// 			ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peeringLocations/peeringLocation2"),
		// 			Kind: to.Ptr(armpeering.KindDirect),
		// 			Properties: &armpeering.LocationProperties{
		// 				Country: to.Ptr("country2"),
		// 				Direct: &armpeering.LocationPropertiesDirect{
		// 					BandwidthOffers: []*armpeering.BandwidthOffer{
		// 						{
		// 							OfferName: to.Ptr("10Gbps"),
		// 							ValueInMbps: to.Ptr[int32](10000),
		// 						},
		// 						{
		// 							OfferName: to.Ptr("100Gbps"),
		// 							ValueInMbps: to.Ptr[int32](100000),
		// 					}},
		// 					PeeringFacilities: []*armpeering.DirectPeeringFacility{
		// 						{
		// 							Address: to.Ptr("address2"),
		// 							DirectPeeringType: to.Ptr(armpeering.DirectPeeringTypeEdge),
		// 							PeeringDBFacilityID: to.Ptr[int32](99999),
		// 							PeeringDBFacilityLink: to.Ptr("https://www.peeringdb.com/fac/99999"),
		// 					}},
		// 				},
		// 				PeeringLocation: to.Ptr("peeringLocation2"),
		// 			},
		// 	}},
		// }
	}
}
Output:

Example (ListExchangePeeringLocations)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListExchangePeeringLocations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLocationsClient().NewListPager(armpeering.PeeringLocationsKindExchange, &armpeering.LocationsClientListOptions{DirectPeeringType: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.LocationListResult = armpeering.LocationListResult{
		// 	Value: []*armpeering.Location{
		// 		{
		// 			Name: to.Ptr("peeringLocation1"),
		// 			Type: to.Ptr("Microsoft.Peering/peeringLocations"),
		// 			ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peeringLocations/peeringLocation1"),
		// 			Kind: to.Ptr(armpeering.KindExchange),
		// 			Properties: &armpeering.LocationProperties{
		// 				Country: to.Ptr("country1"),
		// 				Exchange: &armpeering.LocationPropertiesExchange{
		// 					PeeringFacilities: []*armpeering.ExchangePeeringFacility{
		// 						{
		// 							BandwidthInMbps: to.Ptr[int32](10000),
		// 							ExchangeName: to.Ptr("name1"),
		// 							FacilityIPv4Prefix: to.Ptr("192.168.128.0/17"),
		// 							FacilityIPv6Prefix: to.Ptr("fd00::1000:0/98"),
		// 							MicrosoftIPv4Address: to.Ptr("192.168.131.1"),
		// 							MicrosoftIPv6Address: to.Ptr("fd00::1:1"),
		// 							PeeringDBFacilityID: to.Ptr[int32](99999),
		// 							PeeringDBFacilityLink: to.Ptr("https://www.peeringdb.com/ix/99999"),
		// 						},
		// 						{
		// 							BandwidthInMbps: to.Ptr[int32](10000),
		// 							ExchangeName: to.Ptr("name3"),
		// 							FacilityIPv4Prefix: to.Ptr("192.168.0.0/17"),
		// 							FacilityIPv6Prefix: to.Ptr("fd00::0/98"),
		// 							MicrosoftIPv4Address: to.Ptr("192.168.2.2"),
		// 							MicrosoftIPv6Address: to.Ptr("fd00::2"),
		// 							PeeringDBFacilityID: to.Ptr[int32](99999),
		// 							PeeringDBFacilityLink: to.Ptr("https://www.peeringdb.com/ix/99999"),
		// 					}},
		// 				},
		// 				PeeringLocation: to.Ptr("peeringLocation1"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("peeringLocation2"),
		// 			Type: to.Ptr("Microsoft.Peering/peeringLocations"),
		// 			ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peeringLocations/peeringLocation2"),
		// 			Kind: to.Ptr(armpeering.KindExchange),
		// 			Properties: &armpeering.LocationProperties{
		// 				Country: to.Ptr("country2"),
		// 				Exchange: &armpeering.LocationPropertiesExchange{
		// 					PeeringFacilities: []*armpeering.ExchangePeeringFacility{
		// 						{
		// 							BandwidthInMbps: to.Ptr[int32](10000),
		// 							ExchangeName: to.Ptr("name2"),
		// 							FacilityIPv4Prefix: to.Ptr("192.168.0.0/16"),
		// 							FacilityIPv6Prefix: to.Ptr("fd00::0/98"),
		// 							MicrosoftIPv4Address: to.Ptr("192.168.2.1"),
		// 							MicrosoftIPv6Address: to.Ptr("fd00::2"),
		// 							PeeringDBFacilityID: to.Ptr[int32](99999),
		// 							PeeringDBFacilityLink: to.Ptr("https://www.peeringdb.com/ix/99999"),
		// 					}},
		// 				},
		// 				PeeringLocation: to.Ptr("peeringLocation2"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type LocationsClientListOptions added in v0.2.0

type LocationsClientListOptions struct {
	// The type of direct peering.
	DirectPeeringType *PeeringLocationsDirectPeeringType
}

LocationsClientListOptions contains the optional parameters for the LocationsClient.NewListPager method.

type LocationsClientListResponse added in v0.2.0

type LocationsClientListResponse struct {
	// The paginated list of peering locations.
	LocationListResult
}

LocationsClientListResponse contains the response from method LocationsClient.NewListPager.

type LogAnalyticsWorkspaceProperties added in v0.3.0

type LogAnalyticsWorkspaceProperties struct {
	// READ-ONLY; The list of connected agents.
	ConnectedAgents []*string

	// READ-ONLY; The Workspace Key.
	Key *string

	// READ-ONLY; The Workspace ID.
	WorkspaceID *string
}

LogAnalyticsWorkspaceProperties - The properties that define a Log Analytics Workspace.

func (LogAnalyticsWorkspaceProperties) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type LogAnalyticsWorkspaceProperties.

func (*LogAnalyticsWorkspaceProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsWorkspaceProperties.

type LookingGlassClient added in v0.3.0

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

LookingGlassClient contains the methods for the LookingGlass group. Don't use this type directly, use NewLookingGlassClient() instead.

func NewLookingGlassClient added in v0.3.0

func NewLookingGlassClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LookingGlassClient, error)

NewLookingGlassClient creates a new instance of LookingGlassClient with the specified values.

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

func (*LookingGlassClient) Invoke added in v0.3.0

func (client *LookingGlassClient) Invoke(ctx context.Context, command LookingGlassCommand, sourceType LookingGlassSourceType, sourceLocation string, destinationIP string, options *LookingGlassClientInvokeOptions) (LookingGlassClientInvokeResponse, error)

Invoke - Run looking glass functionality If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • command - The command to be executed: ping, traceroute, bgpRoute.
  • sourceType - The type of the source: Edge site or Azure Region.
  • sourceLocation - The location of the source.
  • destinationIP - The IP address of the destination.
  • options - LookingGlassClientInvokeOptions contains the optional parameters for the LookingGlassClient.Invoke method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/LookingGlassInvokeCommand.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLookingGlassClient().Invoke(ctx, armpeering.LookingGlassCommandTraceroute, armpeering.LookingGlassSourceTypeAzureRegion, "West US", "0.0.0.0", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.LookingGlassOutput = armpeering.LookingGlassOutput{
	// 	Command: to.Ptr(armpeering.CommandTraceroute),
	
Output:

type LookingGlassClientInvokeOptions added in v0.3.0

type LookingGlassClientInvokeOptions struct {
}

LookingGlassClientInvokeOptions contains the optional parameters for the LookingGlassClient.Invoke method.

type LookingGlassClientInvokeResponse added in v0.3.0

type LookingGlassClientInvokeResponse struct {
	// Looking glass output model
	LookingGlassOutput
}

LookingGlassClientInvokeResponse contains the response from method LookingGlassClient.Invoke.

type LookingGlassCommand added in v0.3.0

type LookingGlassCommand string
const (
	LookingGlassCommandBgpRoute   LookingGlassCommand = "BgpRoute"
	LookingGlassCommandPing       LookingGlassCommand = "Ping"
	LookingGlassCommandTraceroute LookingGlassCommand = "Traceroute"
)

func PossibleLookingGlassCommandValues added in v0.3.0

func PossibleLookingGlassCommandValues() []LookingGlassCommand

PossibleLookingGlassCommandValues returns the possible values for the LookingGlassCommand const type.

type LookingGlassOutput added in v0.3.0

type LookingGlassOutput struct {
	// Invoked command
	Command *Command

	// Output of the command
	Output *string
}

LookingGlassOutput - Looking glass output model

func (LookingGlassOutput) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type LookingGlassOutput.

func (*LookingGlassOutput) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LookingGlassOutput.

type LookingGlassSourceType added in v0.3.0

type LookingGlassSourceType string
const (
	LookingGlassSourceTypeAzureRegion LookingGlassSourceType = "AzureRegion"
	LookingGlassSourceTypeEdgeSite    LookingGlassSourceType = "EdgeSite"
)

func PossibleLookingGlassSourceTypeValues added in v0.3.0

func PossibleLookingGlassSourceTypeValues() []LookingGlassSourceType

PossibleLookingGlassSourceTypeValues returns the possible values for the LookingGlassSourceType const type.

type ManagementClient added in v0.2.0

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

ManagementClient contains the methods for the PeeringManagementClient group. Don't use this type directly, use NewManagementClient() instead.

func NewManagementClient added in v0.2.0

func NewManagementClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementClient, error)

NewManagementClient creates a new instance of ManagementClient with the specified values.

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

func (*ManagementClient) CheckServiceProviderAvailability added in v0.2.0

CheckServiceProviderAvailability - Checks if the peering service provider is present within 1000 miles of customer's location If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • checkServiceProviderAvailabilityInput - The CheckServiceProviderAvailabilityInput indicating customer location and service provider.
  • options - ManagementClientCheckServiceProviderAvailabilityOptions contains the optional parameters for the ManagementClient.CheckServiceProviderAvailability method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CheckServiceProviderAvailability.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/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagementClient().CheckServiceProviderAvailability(ctx, armpeering.CheckServiceProviderAvailabilityInput{
		PeeringServiceLocation: to.Ptr("peeringServiceLocation1"),
		PeeringServiceProvider: to.Ptr("peeringServiceProvider1"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Value = armpeering.Enum0Available
}
Output:

type ManagementClientCheckServiceProviderAvailabilityOptions added in v0.2.0

type ManagementClientCheckServiceProviderAvailabilityOptions struct {
}

ManagementClientCheckServiceProviderAvailabilityOptions contains the optional parameters for the ManagementClient.CheckServiceProviderAvailability method.

type ManagementClientCheckServiceProviderAvailabilityResponse added in v0.2.0

type ManagementClientCheckServiceProviderAvailabilityResponse struct {
	Value *Enum0
}

ManagementClientCheckServiceProviderAvailabilityResponse contains the response from method ManagementClient.CheckServiceProviderAvailability.

type MetricDimension added in v0.3.0

type MetricDimension struct {
	// READ-ONLY; Localized friendly display name of the dimension.
	DisplayName *string

	// READ-ONLY; Name of the dimension.
	Name *string
}

MetricDimension - Dimensions of the metric.

func (MetricDimension) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type MetricDimension.

func (*MetricDimension) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type MetricDimension.

type MetricSpecification added in v0.3.0

type MetricSpecification struct {
	// READ-ONLY; Aggregation type will be set to one of the values: Average, Minimum, Maximum, Total, Count.
	AggregationType *string

	// READ-ONLY; Dimensions of the metric.
	Dimensions []*MetricDimension

	// READ-ONLY; Localized friendly description of the metric.
	DisplayDescription *string

	// READ-ONLY; Localized friendly display name of the metric.
	DisplayName *string

	// READ-ONLY; Name of the metric.
	Name *string

	// READ-ONLY; Supported time grain types for the metric.
	SupportedTimeGrainTypes []*string

	// READ-ONLY; Unit that makes sense for the metric.
	Unit *string
}

MetricSpecification - Specifications of the Metrics for Azure Monitoring.

func (MetricSpecification) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type MetricSpecification.

func (*MetricSpecification) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type MetricSpecification.

type Operation

type Operation struct {
	// READ-ONLY; The information related to the operation.
	Display *OperationDisplayInfo

	// READ-ONLY; The flag that indicates whether the operation applies to data plane.
	IsDataAction *bool

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

	// READ-ONLY; The properties of the operation.
	Properties *OperationProperties
}

Operation - The peering API operation.

func (Operation) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplayInfo

type OperationDisplayInfo struct {
	// READ-ONLY; The description of the operation.
	Description *string

	// READ-ONLY; The name of the operation.
	Operation *string

	// READ-ONLY; The name of the resource provider.
	Provider *string

	// READ-ONLY; The type of the resource.
	Resource *string
}

OperationDisplayInfo - The information related to the operation.

func (OperationDisplayInfo) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplayInfo.

func (*OperationDisplayInfo) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplayInfo.

type OperationListResult

type OperationListResult struct {
	// The link to fetch the next page of peering API operations.
	NextLink *string

	// The list of peering API operations.
	Value []*Operation
}

OperationListResult - The paginated list of peering API operations.

func (OperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationProperties added in v0.3.0

type OperationProperties struct {
	// READ-ONLY; Service specification payload.
	ServiceSpecification *ServiceSpecification
}

OperationProperties - The properties of the operation.

func (OperationProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type OperationProperties.

func (*OperationProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties.

type OperationsClient

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

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) NewListPager added in v0.5.0

NewListPager - Lists all of the available API operations for peering resources.

Generated from API version 2022-01-01

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.OperationListResult = armpeering.OperationListResult{
		// 	Value: []*armpeering.Operation{
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/register/action"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Registers the subscription for the Peering Resource Provider and enables the creation of peerings"),
		// 				Operation: to.Ptr("Registers the Peering Resource Provider"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("Peering Resource Provider"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peerAsns/write"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Write any peerAsns"),
		// 				Operation: to.Ptr("Write PeerAsn"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("peerAsns"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peerAsns/read"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Read any peerAsns"),
		// 				Operation: to.Ptr("Read PeerAsn"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("peerAsns"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peerAsns/delete"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Delete any peerAsns"),
		// 				Operation: to.Ptr("Delete PeerAsn"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("peerAsns"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peeringLocations/read"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Read any peeringLocations"),
		// 				Operation: to.Ptr("Read PeeringLocation"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("peeringLocations"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/legacyPeerings/read"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Read any legacyPeerings"),
		// 				Operation: to.Ptr("Read LegacyPeering"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("legacyPeerings"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peerings/write"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Write any peerings"),
		// 				Operation: to.Ptr("Write Peering"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("peerings"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peerings/read"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Read any peerings"),
		// 				Operation: to.Ptr("Read Peering"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("peerings"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peerings/delete"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Delete any peerings"),
		// 				Operation: to.Ptr("Delete Peering"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("peerings"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peeringServiceLocations/read"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Read any peeringServiceLocations"),
		// 				Operation: to.Ptr("Read PeeringServiceLocations"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("peeringServiceLocations"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peeringServiceProviders/read"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Read any peeringServiceProviders"),
		// 				Operation: to.Ptr("Read PeeringServiceProviders"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("peeringServiceProviders"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peeringServices/read"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Read any peeringServices"),
		// 				Operation: to.Ptr("Read PeeringServices"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("peeringServices"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peeringServices/write"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Write any peeringServices"),
		// 				Operation: to.Ptr("Write PeeringService"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("peeringServices"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peeringServices/delete"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Delete any peeringServices"),
		// 				Operation: to.Ptr("Delete PeeringServices"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("peeringServices"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peeringServices/prefixes/read"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Read any prefixes"),
		// 				Operation: to.Ptr("Read PeeringServicePrefixes"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("prefixes"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peeringServices/prefixes/write"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Write any prefixes"),
		// 				Operation: to.Ptr("Write PeeringServicePrefixes"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("prefixes"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peeringServices/prefixes/delete"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Delete any prefixes"),
		// 				Operation: to.Ptr("Delete PeeringServicePrefixes"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("prefixes"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peerings/registeredPrefixes/read"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Read any registeredPrefixes"),
		// 				Operation: to.Ptr("Read RegisteredPrefixes"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("registeredPrefixes"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peerings/registeredPrefixes/write"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Write any registeredPrefixes"),
		// 				Operation: to.Ptr("Write RegisteredPrefixes"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("registeredPrefixes"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peerings/registeredPrefixes/delete"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Delete any registeredPrefixes"),
		// 				Operation: to.Ptr("Delete RegisteredPrefixes"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("registeredPrefixes"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peerings/registeredAsns/read"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Read any registeredAsns"),
		// 				Operation: to.Ptr("Read RegisteredAsns"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("registeredAsns"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peerings/registeredAsns/write"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Write any registeredAsns"),
		// 				Operation: to.Ptr("Write RegisteredAsns"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("registeredAsns"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peerings/registeredAsns/delete"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Delete any registeredAsns"),
		// 				Operation: to.Ptr("Delete RegisteredAsns"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("registeredAsns"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peerings/receivedRoutes/read"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Read any receivedRoutes"),
		// 				Operation: to.Ptr("Read PeeringReceivedRoutes"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("receivedRoutes"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peeringServices/connectionMonitorTests/read"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Read any Peering Service Connection Monitor Tests"),
		// 				Operation: to.Ptr("Read Peering Service Connection Monitor Tests"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("connectionMonitorTests"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peeringServices/connectionMonitorTests/write"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Write any connectionMonitorTests"),
		// 				Operation: to.Ptr("Write Peering Service Connection Monitor Tests"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("connectionMonitorTests"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Peering/peeringServices/connectionMonitorTests/delete"),
		// 			Display: &armpeering.OperationDisplayInfo{
		// 				Description: to.Ptr("Delete any Peering Service Connection Monitor Tests"),
		// 				Operation: to.Ptr("Delete Peering Service Connection Monitor Tests"),
		// 				Provider: to.Ptr("Microsoft.Peering"),
		// 				Resource: to.Ptr("connectionMonitorTests"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	// The paginated list of peering API operations.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type PeerAsn

type PeerAsn struct {
	// The properties that define a peer's ASN.
	Properties *PeerAsnProperties

	// READ-ONLY; The ID of the resource.
	ID *string

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

	// READ-ONLY; The type of the resource.
	Type *string
}

PeerAsn - The essential information related to the peer's ASN.

func (PeerAsn) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PeerAsn.

func (*PeerAsn) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PeerAsn.

type PeerAsnListResult

type PeerAsnListResult struct {
	// The link to fetch the next page of peer ASNs.
	NextLink *string

	// The list of peer ASNs.
	Value []*PeerAsn
}

PeerAsnListResult - The paginated list of peer ASNs.

func (PeerAsnListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PeerAsnListResult.

func (*PeerAsnListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PeerAsnListResult.

type PeerAsnProperties

type PeerAsnProperties struct {
	// The Autonomous System Number (ASN) of the peer.
	PeerAsn *int32

	// The contact details of the peer.
	PeerContactDetail []*ContactDetail

	// The name of the peer.
	PeerName *string

	// READ-ONLY; The error message for the validation state
	ErrorMessage *string

	// READ-ONLY; The validation state of the ASN associated with the peer.
	ValidationState *ValidationState
}

PeerAsnProperties - The properties that define a peer's ASN.

func (PeerAsnProperties) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type PeerAsnProperties.

func (*PeerAsnProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PeerAsnProperties.

type PeerAsnsClient

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

PeerAsnsClient contains the methods for the PeerAsns group. Don't use this type directly, use NewPeerAsnsClient() instead.

func NewPeerAsnsClient

func NewPeerAsnsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PeerAsnsClient, error)

NewPeerAsnsClient creates a new instance of PeerAsnsClient with the specified values.

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

func (*PeerAsnsClient) CreateOrUpdate

func (client *PeerAsnsClient) CreateOrUpdate(ctx context.Context, peerAsnName string, peerAsn PeerAsn, options *PeerAsnsClientCreateOrUpdateOptions) (PeerAsnsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates a new peer ASN or updates an existing peer ASN with the specified name under the given subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • peerAsnName - The peer ASN name.
  • peerAsn - The peer ASN.
  • options - PeerAsnsClientCreateOrUpdateOptions contains the optional parameters for the PeerAsnsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreatePeerAsn.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/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPeerAsnsClient().CreateOrUpdate(ctx, "peerAsnName", armpeering.PeerAsn{
		Properties: &armpeering.PeerAsnProperties{
			PeerAsn: to.Ptr[int32](65000),
			PeerContactDetail: []*armpeering.ContactDetail{
				{
					Email: to.Ptr("noc@contoso.com"),
					Phone: to.Ptr("+1 (234) 567-8999"),
					Role:  to.Ptr(armpeering.RoleNoc),
				},
				{
					Email: to.Ptr("abc@contoso.com"),
					Phone: to.Ptr("+1 (234) 567-8900"),
					Role:  to.Ptr(armpeering.RolePolicy),
				},
				{
					Email: to.Ptr("xyz@contoso.com"),
					Phone: to.Ptr("+1 (234) 567-8900"),
					Role:  to.Ptr(armpeering.RoleTechnical),
				}},
			PeerName: to.Ptr("Contoso"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.PeerAsn = armpeering.PeerAsn{
	// 	Name: to.Ptr("peerAsnName"),
	// 	Type: to.Ptr("Microsoft.Peering/peerAsns"),
	// 	ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/peerAsnName"),
	// 	Properties: &armpeering.PeerAsnProperties{
	// 		PeerAsn: to.Ptr[int32](65000),
	// 		PeerContactDetail: []*armpeering.ContactDetail{
	// 			{
	// 				Email: to.Ptr("noc@contoso.com"),
	// 				Phone: to.Ptr("+1 (234) 567-8999"),
	// 				Role: to.Ptr(armpeering.RoleNoc),
	// 			},
	// 			{
	// 				Email: to.Ptr("abc@contoso.com"),
	// 				Phone: to.Ptr("+1 (234) 567-8900"),
	// 				Role: to.Ptr(armpeering.RolePolicy),
	// 			},
	// 			{
	// 				Email: to.Ptr("xyz@contoso.com"),
	// 				Phone: to.Ptr("+1 (234) 567-8900"),
	// 				Role: to.Ptr(armpeering.RoleTechnical),
	// 		}},
	// 		PeerName: to.Ptr("Contoso"),
	// 		ValidationState: to.Ptr(armpeering.ValidationStatePending),
	// 	},
	// }
}
Output:

func (*PeerAsnsClient) Delete

Delete - Deletes an existing peer ASN with the specified name under the given subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • peerAsnName - The peer ASN name.
  • options - PeerAsnsClientDeleteOptions contains the optional parameters for the PeerAsnsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/DeletePeerAsn.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

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

func (*PeerAsnsClient) Get

Get - Gets the peer ASN with the specified name under the given subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • peerAsnName - The peer ASN name.
  • options - PeerAsnsClientGetOptions contains the optional parameters for the PeerAsnsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetPeerAsn.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPeerAsnsClient().Get(ctx, "peerAsnName", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.PeerAsn = armpeering.PeerAsn{
	// 	Name: to.Ptr("peerAsnName"),
	// 	Type: to.Ptr("Microsoft.Peering/peerAsns"),
	// 	ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/peerAsnName"),
	// 	Properties: &armpeering.PeerAsnProperties{
	// 		PeerAsn: to.Ptr[int32](65000),
	// 		PeerContactDetail: []*armpeering.ContactDetail{
	// 			{
	// 				Email: to.Ptr("noc@contoso.com"),
	// 				Phone: to.Ptr("+1 (234) 567-8999"),
	// 				Role: to.Ptr(armpeering.RoleNoc),
	// 			},
	// 			{
	// 				Email: to.Ptr("abc@contoso.com"),
	// 				Phone: to.Ptr("+1 (234) 567-8900"),
	// 				Role: to.Ptr(armpeering.RolePolicy),
	// 			},
	// 			{
	// 				Email: to.Ptr("xyz@contoso.com"),
	// 				Phone: to.Ptr("+1 (234) 567-8900"),
	// 				Role: to.Ptr(armpeering.RoleTechnical),
	// 		}},
	// 		PeerName: to.Ptr("Contoso"),
	// 		ValidationState: to.Ptr(armpeering.ValidationStateApproved),
	// 	},
	// }
}
Output:

func (*PeerAsnsClient) NewListBySubscriptionPager added in v0.5.0

NewListBySubscriptionPager - Lists all of the peer ASNs under the given subscription.

Generated from API version 2022-01-01

  • options - PeerAsnsClientListBySubscriptionOptions contains the optional parameters for the PeerAsnsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeerAsnsBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPeerAsnsClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.PeerAsnListResult = armpeering.PeerAsnListResult{
		// 	Value: []*armpeering.PeerAsn{
		// 		{
		// 			Name: to.Ptr("peerAsnName"),
		// 			Type: to.Ptr("Microsoft.Peering/peerAsns"),
		// 			ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/peerAsnName"),
		// 			Properties: &armpeering.PeerAsnProperties{
		// 				PeerAsn: to.Ptr[int32](65000),
		// 				PeerContactDetail: []*armpeering.ContactDetail{
		// 					{
		// 						Email: to.Ptr("noc@contoso.com"),
		// 						Phone: to.Ptr("+1 (234) 567-8999"),
		// 						Role: to.Ptr(armpeering.RoleNoc),
		// 					},
		// 					{
		// 						Email: to.Ptr("abc@contoso.com"),
		// 						Phone: to.Ptr("+1 (234) 567-8900"),
		// 						Role: to.Ptr(armpeering.RolePolicy),
		// 					},
		// 					{
		// 						Email: to.Ptr("xyz@contoso.com"),
		// 						Phone: to.Ptr("+1 (234) 567-8900"),
		// 						Role: to.Ptr(armpeering.RoleTechnical),
		// 				}},
		// 				PeerName: to.Ptr("Contoso"),
		// 				ValidationState: to.Ptr(armpeering.ValidationStateApproved),
		// 			},
		// 	}},
		// }
	}
}
Output:

type PeerAsnsClientCreateOrUpdateOptions added in v0.2.0

type PeerAsnsClientCreateOrUpdateOptions struct {
}

PeerAsnsClientCreateOrUpdateOptions contains the optional parameters for the PeerAsnsClient.CreateOrUpdate method.

type PeerAsnsClientCreateOrUpdateResponse added in v0.2.0

type PeerAsnsClientCreateOrUpdateResponse struct {
	// The essential information related to the peer's ASN.
	PeerAsn
}

PeerAsnsClientCreateOrUpdateResponse contains the response from method PeerAsnsClient.CreateOrUpdate.

type PeerAsnsClientDeleteOptions added in v0.2.0

type PeerAsnsClientDeleteOptions struct {
}

PeerAsnsClientDeleteOptions contains the optional parameters for the PeerAsnsClient.Delete method.

type PeerAsnsClientDeleteResponse added in v0.2.0

type PeerAsnsClientDeleteResponse struct {
}

PeerAsnsClientDeleteResponse contains the response from method PeerAsnsClient.Delete.

type PeerAsnsClientGetOptions added in v0.2.0

type PeerAsnsClientGetOptions struct {
}

PeerAsnsClientGetOptions contains the optional parameters for the PeerAsnsClient.Get method.

type PeerAsnsClientGetResponse added in v0.2.0

type PeerAsnsClientGetResponse struct {
	// The essential information related to the peer's ASN.
	PeerAsn
}

PeerAsnsClientGetResponse contains the response from method PeerAsnsClient.Get.

type PeerAsnsClientListBySubscriptionOptions added in v0.2.0

type PeerAsnsClientListBySubscriptionOptions struct {
}

PeerAsnsClientListBySubscriptionOptions contains the optional parameters for the PeerAsnsClient.NewListBySubscriptionPager method.

type PeerAsnsClientListBySubscriptionResponse added in v0.2.0

type PeerAsnsClientListBySubscriptionResponse struct {
	// The paginated list of peer ASNs.
	PeerAsnListResult
}

PeerAsnsClientListBySubscriptionResponse contains the response from method PeerAsnsClient.NewListBySubscriptionPager.

type Peering

type Peering struct {
	// REQUIRED; The kind of the peering.
	Kind *Kind

	// REQUIRED; The location of the resource.
	Location *string

	// REQUIRED; The SKU that defines the tier and kind of the peering.
	SKU *SKU

	// The properties that define a peering.
	Properties *Properties

	// The resource tags.
	Tags map[string]*string

	// READ-ONLY; The ID of the resource.
	ID *string

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

	// READ-ONLY; The type of the resource.
	Type *string
}

Peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location.

func (Peering) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Peering.

func (*Peering) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Peering.

type PeeringLocationsDirectPeeringType added in v0.3.0

type PeeringLocationsDirectPeeringType string
const (
	PeeringLocationsDirectPeeringTypeCdn                  PeeringLocationsDirectPeeringType = "Cdn"
	PeeringLocationsDirectPeeringTypeEdge                 PeeringLocationsDirectPeeringType = "Edge"
	PeeringLocationsDirectPeeringTypeEdgeZoneForOperators PeeringLocationsDirectPeeringType = "EdgeZoneForOperators"
	PeeringLocationsDirectPeeringTypeInternal             PeeringLocationsDirectPeeringType = "Internal"
	PeeringLocationsDirectPeeringTypeIx                   PeeringLocationsDirectPeeringType = "Ix"
	PeeringLocationsDirectPeeringTypeIxRs                 PeeringLocationsDirectPeeringType = "IxRs"
	PeeringLocationsDirectPeeringTypeTransit              PeeringLocationsDirectPeeringType = "Transit"
	PeeringLocationsDirectPeeringTypeVoice                PeeringLocationsDirectPeeringType = "Voice"
)

func PossiblePeeringLocationsDirectPeeringTypeValues added in v0.3.0

func PossiblePeeringLocationsDirectPeeringTypeValues() []PeeringLocationsDirectPeeringType

PossiblePeeringLocationsDirectPeeringTypeValues returns the possible values for the PeeringLocationsDirectPeeringType const type.

type PeeringLocationsKind added in v0.3.0

type PeeringLocationsKind string
const (
	PeeringLocationsKindDirect   PeeringLocationsKind = "Direct"
	PeeringLocationsKindExchange PeeringLocationsKind = "Exchange"
)

func PossiblePeeringLocationsKindValues added in v0.3.0

func PossiblePeeringLocationsKindValues() []PeeringLocationsKind

PossiblePeeringLocationsKindValues returns the possible values for the PeeringLocationsKind const type.

type PeeringsClient

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

PeeringsClient contains the methods for the Peerings group. Don't use this type directly, use NewPeeringsClient() instead.

func NewPeeringsClient

func NewPeeringsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PeeringsClient, error)

NewPeeringsClient creates a new instance of PeeringsClient with the specified values.

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

func (*PeeringsClient) CreateOrUpdate

func (client *PeeringsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringName string, peering Peering, options *PeeringsClientCreateOrUpdateOptions) (PeeringsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates a new peering or updates an existing peering with the specified name under the given subscription and resource group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringName - The name of the peering.
  • peering - The properties needed to create or update a peering.
  • options - PeeringsClientCreateOrUpdateOptions contains the optional parameters for the PeeringsClient.CreateOrUpdate method.
Example (CreateADirectPeering)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreateDirectPeering.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/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPeeringsClient().CreateOrUpdate(ctx, "rgName", "peeringName", armpeering.Peering{
		Kind:     to.Ptr(armpeering.KindDirect),
		Location: to.Ptr("eastus"),
		Properties: &armpeering.Properties{
			Direct: &armpeering.PropertiesDirect{
				Connections: []*armpeering.DirectConnection{
					{
						BandwidthInMbps: to.Ptr[int32](10000),
						BgpSession: &armpeering.BgpSession{
							MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
							MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
							MD5AuthenticationKey:    to.Ptr("test-md5-auth-key"),
							SessionPrefixV4:         to.Ptr("192.168.0.0/31"),
							SessionPrefixV6:         to.Ptr("fd00::0/127"),
						},
						ConnectionIdentifier:   to.Ptr("5F4CB5C7-6B43-4444-9338-9ABC72606C16"),
						PeeringDBFacilityID:    to.Ptr[int32](99999),
						SessionAddressProvider: to.Ptr(armpeering.SessionAddressProviderPeer),
						UseForPeeringService:   to.Ptr(false),
					},
					{
						BandwidthInMbps:        to.Ptr[int32](10000),
						ConnectionIdentifier:   to.Ptr("8AB00818-D533-4504-A25A-03A17F61201C"),
						PeeringDBFacilityID:    to.Ptr[int32](99999),
						SessionAddressProvider: to.Ptr(armpeering.SessionAddressProviderMicrosoft),
						UseForPeeringService:   to.Ptr(true),
					}},
				DirectPeeringType: to.Ptr(armpeering.DirectPeeringTypeEdge),
				PeerAsn: &armpeering.SubResource{
					ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1"),
				},
			},
			PeeringLocation: to.Ptr("peeringLocation0"),
		},
		SKU: &armpeering.SKU{
			Name: to.Ptr("Basic_Direct_Free"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Peering = armpeering.Peering{
	// 	Name: to.Ptr("peeringName"),
	// 	Type: to.Ptr("Microsoft.Peering/peerings"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName"),
	// 	Kind: to.Ptr(armpeering.KindDirect),
	// 	Location: to.Ptr("eastus"),
	// 	Properties: &armpeering.Properties{
	// 		Direct: &armpeering.PropertiesDirect{
	// 			Connections: []*armpeering.DirectConnection{
	// 				{
	// 					BandwidthInMbps: to.Ptr[int32](10000),
	// 					BgpSession: &armpeering.BgpSession{
	// 						MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
	// 						MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
	// 						MD5AuthenticationKey: to.Ptr("test-md5-auth-key"),
	// 						SessionPrefixV4: to.Ptr("192.168.0.0/31"),
	// 						SessionPrefixV6: to.Ptr("fd00::0/127"),
	// 						SessionStateV4: to.Ptr(armpeering.SessionStateV4Established),
	// 						SessionStateV6: to.Ptr(armpeering.SessionStateV6Established),
	// 					},
	// 					ConnectionIdentifier: to.Ptr("5F4CB5C7-6B43-4444-9338-9ABC72606C16"),
	// 					ConnectionState: to.Ptr(armpeering.ConnectionStateProvisioningFailed),
	// 					ErrorMessage: to.Ptr("IPv4 address is already configured with a different ASN"),
	// 					MicrosoftTrackingID: to.Ptr("test-microsoft-reference-id-1"),
	// 					PeeringDBFacilityID: to.Ptr[int32](99999),
	// 					ProvisionedBandwidthInMbps: to.Ptr[int32](10000),
	// 					SessionAddressProvider: to.Ptr(armpeering.SessionAddressProviderPeer),
	// 					UseForPeeringService: to.Ptr(false),
	// 				},
	// 				{
	// 					BandwidthInMbps: to.Ptr[int32](10000),
	// 					BgpSession: &armpeering.BgpSession{
	// 						MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
	// 						MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
	// 						MD5AuthenticationKey: to.Ptr("test-md5-auth-key"),
	// 						SessionPrefixV4: to.Ptr("192.168.1.0/31"),
	// 						SessionPrefixV6: to.Ptr("fd00::2/127"),
	// 						SessionStateV4: to.Ptr(armpeering.SessionStateV4Established),
	// 						SessionStateV6: to.Ptr(armpeering.SessionStateV6Established),
	// 					},
	// 					ConnectionIdentifier: to.Ptr("8AB00818-D533-4504-A25A-03A17F61201C"),
	// 					ConnectionState: to.Ptr(armpeering.ConnectionStateActive),
	// 					MicrosoftTrackingID: to.Ptr("test-microsoft-reference-id-2"),
	// 					PeeringDBFacilityID: to.Ptr[int32](99999),
	// 					ProvisionedBandwidthInMbps: to.Ptr[int32](10000),
	// 					SessionAddressProvider: to.Ptr(armpeering.SessionAddressProviderMicrosoft),
	// 					UseForPeeringService: to.Ptr(true),
	// 			}},
	// 			DirectPeeringType: to.Ptr(armpeering.DirectPeeringTypeEdge),
	// 			PeerAsn: &armpeering.SubResource{
	// 				ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1"),
	// 			},
	// 			UseForPeeringService: to.Ptr(true),
	// 		},
	// 		PeeringLocation: to.Ptr("peeringLocation0"),
	// 		ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 	},
	// 	SKU: &armpeering.SKU{
	// 		Name: to.Ptr("Basic_Direct_Free"),
	// 		Family: to.Ptr(armpeering.FamilyDirect),
	// 		Size: to.Ptr(armpeering.SizeFree),
	// 		Tier: to.Ptr(armpeering.TierBasic),
	// 	},
	// }
}
Output:

Example (CreateAPeeringWithExchangeRouteServer)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreatePeeringWithExchangeRouteServer.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/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPeeringsClient().CreateOrUpdate(ctx, "rgName", "peeringName", armpeering.Peering{
		Kind:     to.Ptr(armpeering.KindDirect),
		Location: to.Ptr("eastus"),
		Properties: &armpeering.Properties{
			Direct: &armpeering.PropertiesDirect{
				Connections: []*armpeering.DirectConnection{
					{
						BandwidthInMbps: to.Ptr[int32](10000),
						BgpSession: &armpeering.BgpSession{
							MaxPrefixesAdvertisedV4:     to.Ptr[int32](1000),
							MaxPrefixesAdvertisedV6:     to.Ptr[int32](100),
							MicrosoftSessionIPv4Address: to.Ptr("192.168.0.123"),
							PeerSessionIPv4Address:      to.Ptr("192.168.0.234"),
							SessionPrefixV4:             to.Ptr("192.168.0.0/24"),
						},
						ConnectionIdentifier:   to.Ptr("5F4CB5C7-6B43-4444-9338-9ABC72606C16"),
						PeeringDBFacilityID:    to.Ptr[int32](99999),
						SessionAddressProvider: to.Ptr(armpeering.SessionAddressProviderPeer),
						UseForPeeringService:   to.Ptr(true),
					}},
				DirectPeeringType: to.Ptr(armpeering.DirectPeeringTypeIxRs),
				PeerAsn: &armpeering.SubResource{
					ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1"),
				},
			},
			PeeringLocation: to.Ptr("peeringLocation0"),
		},
		SKU: &armpeering.SKU{
			Name: to.Ptr("Premium_Direct_Free"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Peering = armpeering.Peering{
	// 	Name: to.Ptr("peeringName"),
	// 	Type: to.Ptr("Microsoft.Peering/peerings"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName"),
	// 	Kind: to.Ptr(armpeering.KindDirect),
	// 	Location: to.Ptr("eastus"),
	// 	Properties: &armpeering.Properties{
	// 		Direct: &armpeering.PropertiesDirect{
	// 			Connections: []*armpeering.DirectConnection{
	// 				{
	// 					BandwidthInMbps: to.Ptr[int32](10000),
	// 					BgpSession: &armpeering.BgpSession{
	// 						MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
	// 						MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
	// 						MicrosoftSessionIPv4Address: to.Ptr("192.168.0.123"),
	// 						PeerSessionIPv4Address: to.Ptr("192.168.0.234"),
	// 						SessionPrefixV4: to.Ptr("192.168.0.0/24"),
	// 						SessionStateV4: to.Ptr(armpeering.SessionStateV4Established),
	// 						SessionStateV6: to.Ptr(armpeering.SessionStateV6Established),
	// 					},
	// 					ConnectionIdentifier: to.Ptr("5F4CB5C7-6B43-4444-9338-9ABC72606C16"),
	// 					ConnectionState: to.Ptr(armpeering.ConnectionStateActive),
	// 					PeeringDBFacilityID: to.Ptr[int32](99999),
	// 					ProvisionedBandwidthInMbps: to.Ptr[int32](10000),
	// 					SessionAddressProvider: to.Ptr(armpeering.SessionAddressProviderPeer),
	// 					UseForPeeringService: to.Ptr(true),
	// 			}},
	// 			DirectPeeringType: to.Ptr(armpeering.DirectPeeringTypeIxRs),
	// 			PeerAsn: &armpeering.SubResource{
	// 				ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1"),
	// 			},
	// 			UseForPeeringService: to.Ptr(true),
	// 		},
	// 		PeeringLocation: to.Ptr("peeringLocation0"),
	// 		ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 	},
	// 	SKU: &armpeering.SKU{
	// 		Name: to.Ptr("Premium_Direct_Free"),
	// 		Family: to.Ptr(armpeering.FamilyDirect),
	// 		Size: to.Ptr(armpeering.SizeFree),
	// 		Tier: to.Ptr(armpeering.TierPremium),
	// 	},
	// }
}
Output:

Example (CreateAnExchangePeering)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreateExchangePeering.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/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPeeringsClient().CreateOrUpdate(ctx, "rgName", "peeringName", armpeering.Peering{
		Kind:     to.Ptr(armpeering.KindExchange),
		Location: to.Ptr("eastus"),
		Properties: &armpeering.Properties{
			Exchange: &armpeering.PropertiesExchange{
				Connections: []*armpeering.ExchangeConnection{
					{
						BgpSession: &armpeering.BgpSession{
							MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
							MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
							MD5AuthenticationKey:    to.Ptr("test-md5-auth-key"),
							PeerSessionIPv4Address:  to.Ptr("192.168.2.1"),
							PeerSessionIPv6Address:  to.Ptr("fd00::1"),
						},
						ConnectionIdentifier: to.Ptr("CE495334-0E94-4E51-8164-8116D6CD284D"),
						PeeringDBFacilityID:  to.Ptr[int32](99999),
					},
					{
						BgpSession: &armpeering.BgpSession{
							MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
							MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
							MD5AuthenticationKey:    to.Ptr("test-md5-auth-key"),
							PeerSessionIPv4Address:  to.Ptr("192.168.2.2"),
							PeerSessionIPv6Address:  to.Ptr("fd00::2"),
						},
						ConnectionIdentifier: to.Ptr("CDD8E673-CB07-47E6-84DE-3739F778762B"),
						PeeringDBFacilityID:  to.Ptr[int32](99999),
					}},
				PeerAsn: &armpeering.SubResource{
					ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1"),
				},
			},
			PeeringLocation: to.Ptr("peeringLocation0"),
		},
		SKU: &armpeering.SKU{
			Name: to.Ptr("Basic_Exchange_Free"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Peering = armpeering.Peering{
	// 	Name: to.Ptr("peeringName"),
	// 	Type: to.Ptr("Microsoft.Peering/peerings"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName"),
	// 	Kind: to.Ptr(armpeering.KindExchange),
	// 	Location: to.Ptr("eastus"),
	// 	Properties: &armpeering.Properties{
	// 		Exchange: &armpeering.PropertiesExchange{
	// 			Connections: []*armpeering.ExchangeConnection{
	// 				{
	// 					BgpSession: &armpeering.BgpSession{
	// 						MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
	// 						MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
	// 						MD5AuthenticationKey: to.Ptr("test-md5-auth-key"),
	// 						MicrosoftSessionIPv4Address: to.Ptr("192.168.3.1"),
	// 						MicrosoftSessionIPv6Address: to.Ptr("fd00::1:1"),
	// 						PeerSessionIPv4Address: to.Ptr("192.168.2.1"),
	// 						PeerSessionIPv6Address: to.Ptr("fd00::1"),
	// 						SessionStateV4: to.Ptr(armpeering.SessionStateV4Established),
	// 						SessionStateV6: to.Ptr(armpeering.SessionStateV6Established),
	// 					},
	// 					ConnectionIdentifier: to.Ptr("CE495334-0E94-4E51-8164-8116D6CD284D"),
	// 					ConnectionState: to.Ptr(armpeering.ConnectionStateProvisioningFailed),
	// 					ErrorMessage: to.Ptr("IPv4 address is already configured with a different ASN"),
	// 					PeeringDBFacilityID: to.Ptr[int32](99999),
	// 				},
	// 				{
	// 					BgpSession: &armpeering.BgpSession{
	// 						MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
	// 						MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
	// 						MD5AuthenticationKey: to.Ptr("test-md5-auth-key"),
	// 						MicrosoftSessionIPv4Address: to.Ptr("192.168.3.2"),
	// 						MicrosoftSessionIPv6Address: to.Ptr("fd00::1:2"),
	// 						PeerSessionIPv4Address: to.Ptr("192.168.2.2"),
	// 						PeerSessionIPv6Address: to.Ptr("fd00::2"),
	// 						SessionStateV4: to.Ptr(armpeering.SessionStateV4Established),
	// 						SessionStateV6: to.Ptr(armpeering.SessionStateV6Established),
	// 					},
	// 					ConnectionIdentifier: to.Ptr("CDD8E673-CB07-47E6-84DE-3739F778762B"),
	// 					ConnectionState: to.Ptr(armpeering.ConnectionStateActive),
	// 					PeeringDBFacilityID: to.Ptr[int32](99999),
	// 			}},
	// 			PeerAsn: &armpeering.SubResource{
	// 				ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1"),
	// 			},
	// 		},
	// 		PeeringLocation: to.Ptr("peeringLocation0"),
	// 		ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 	},
	// 	SKU: &armpeering.SKU{
	// 		Name: to.Ptr("Basic_Exchange_Free"),
	// 		Family: to.Ptr(armpeering.FamilyExchange),
	// 		Size: to.Ptr(armpeering.SizeFree),
	// 		Tier: to.Ptr(armpeering.TierBasic),
	// 	},
	// }
}
Output:

func (*PeeringsClient) Delete

func (client *PeeringsClient) Delete(ctx context.Context, resourceGroupName string, peeringName string, options *PeeringsClientDeleteOptions) (PeeringsClientDeleteResponse, error)

Delete - Deletes an existing peering with the specified name under the given subscription and resource group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringName - The name of the peering.
  • options - PeeringsClientDeleteOptions contains the optional parameters for the PeeringsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/DeletePeering.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewPeeringsClient().Delete(ctx, "rgName", "peeringName", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*PeeringsClient) Get

func (client *PeeringsClient) Get(ctx context.Context, resourceGroupName string, peeringName string, options *PeeringsClientGetOptions) (PeeringsClientGetResponse, error)

Get - Gets an existing peering with the specified name under the given subscription and resource group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringName - The name of the peering.
  • options - PeeringsClientGetOptions contains the optional parameters for the PeeringsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetPeering.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPeeringsClient().Get(ctx, "rgName", "peeringName", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Peering = armpeering.Peering{
	// 	Name: to.Ptr("peeringName"),
	// 	Type: to.Ptr("Microsoft.Peering/peerings"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName"),
	// 	Kind: to.Ptr(armpeering.KindExchange),
	// 	Location: to.Ptr("eastus"),
	// 	Properties: &armpeering.Properties{
	// 		Exchange: &armpeering.PropertiesExchange{
	// 			Connections: []*armpeering.ExchangeConnection{
	// 				{
	// 					BgpSession: &armpeering.BgpSession{
	// 						MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
	// 						MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
	// 						MD5AuthenticationKey: to.Ptr("test-md5-auth-key"),
	// 						MicrosoftSessionIPv4Address: to.Ptr("192.168.3.1"),
	// 						MicrosoftSessionIPv6Address: to.Ptr("fd00::1:1"),
	// 						PeerSessionIPv4Address: to.Ptr("192.168.2.1"),
	// 						PeerSessionIPv6Address: to.Ptr("fd00::1"),
	// 						SessionStateV4: to.Ptr(armpeering.SessionStateV4Established),
	// 						SessionStateV6: to.Ptr(armpeering.SessionStateV6Established),
	// 					},
	// 					ConnectionIdentifier: to.Ptr("CE495334-0E94-4E51-8164-8116D6CD284D"),
	// 					ConnectionState: to.Ptr(armpeering.ConnectionStateActive),
	// 					PeeringDBFacilityID: to.Ptr[int32](99999),
	// 				},
	// 				{
	// 					BgpSession: &armpeering.BgpSession{
	// 						MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
	// 						MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
	// 						MD5AuthenticationKey: to.Ptr("test-md5-auth-key"),
	// 						MicrosoftSessionIPv4Address: to.Ptr("192.168.3.2"),
	// 						MicrosoftSessionIPv6Address: to.Ptr("fd00::1:2"),
	// 						PeerSessionIPv4Address: to.Ptr("192.168.2.2"),
	// 						PeerSessionIPv6Address: to.Ptr("fd00::2"),
	// 						SessionStateV4: to.Ptr(armpeering.SessionStateV4Established),
	// 						SessionStateV6: to.Ptr(armpeering.SessionStateV6Established),
	// 					},
	// 					ConnectionIdentifier: to.Ptr("CDD8E673-CB07-47E6-84DE-3739F778762B"),
	// 					ConnectionState: to.Ptr(armpeering.ConnectionStateActive),
	// 					PeeringDBFacilityID: to.Ptr[int32](99999),
	// 			}},
	// 			PeerAsn: &armpeering.SubResource{
	// 				ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1"),
	// 			},
	// 		},
	// 		PeeringLocation: to.Ptr("peeringLocation0"),
	// 		ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 	},
	// 	SKU: &armpeering.SKU{
	// 		Name: to.Ptr("Basic_Exchange_Free"),
	// 		Family: to.Ptr(armpeering.FamilyExchange),
	// 		Size: to.Ptr(armpeering.SizeFree),
	// 		Tier: to.Ptr(armpeering.TierBasic),
	// 	},
	// }
}
Output:

func (*PeeringsClient) NewListByResourceGroupPager added in v0.5.0

func (client *PeeringsClient) NewListByResourceGroupPager(resourceGroupName string, options *PeeringsClientListByResourceGroupOptions) *runtime.Pager[PeeringsClientListByResourceGroupResponse]

NewListByResourceGroupPager - Lists all of the peerings under the given subscription and resource group.

Generated from API version 2022-01-01

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringsByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPeeringsClient().NewListByResourceGroupPager("rgName", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ListResult = armpeering.ListResult{
		// 	Value: []*armpeering.Peering{
		// 		{
		// 			Name: to.Ptr("peeringName"),
		// 			Type: to.Ptr("Microsoft.Peering/peerings"),
		// 			ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName"),
		// 			Kind: to.Ptr(armpeering.KindExchange),
		// 			Location: to.Ptr("eastus"),
		// 			Properties: &armpeering.Properties{
		// 				Exchange: &armpeering.PropertiesExchange{
		// 					Connections: []*armpeering.ExchangeConnection{
		// 						{
		// 							BgpSession: &armpeering.BgpSession{
		// 								MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
		// 								MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
		// 								MD5AuthenticationKey: to.Ptr("test-md5-auth-key"),
		// 								MicrosoftSessionIPv4Address: to.Ptr("192.168.3.1"),
		// 								MicrosoftSessionIPv6Address: to.Ptr("fd00::1:1"),
		// 								PeerSessionIPv4Address: to.Ptr("192.168.2.1"),
		// 								PeerSessionIPv6Address: to.Ptr("fd00::1"),
		// 								SessionStateV4: to.Ptr(armpeering.SessionStateV4Established),
		// 								SessionStateV6: to.Ptr(armpeering.SessionStateV6Established),
		// 							},
		// 							ConnectionIdentifier: to.Ptr("CE495334-0E94-4E51-8164-8116D6CD284D"),
		// 							ConnectionState: to.Ptr(armpeering.ConnectionStateActive),
		// 							PeeringDBFacilityID: to.Ptr[int32](99999),
		// 						},
		// 						{
		// 							BgpSession: &armpeering.BgpSession{
		// 								MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
		// 								MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
		// 								MD5AuthenticationKey: to.Ptr("test-md5-auth-key"),
		// 								MicrosoftSessionIPv4Address: to.Ptr("192.168.3.2"),
		// 								MicrosoftSessionIPv6Address: to.Ptr("fd00::1:2"),
		// 								PeerSessionIPv4Address: to.Ptr("192.168.2.2"),
		// 								PeerSessionIPv6Address: to.Ptr("fd00::2"),
		// 								SessionStateV4: to.Ptr(armpeering.SessionStateV4Established),
		// 								SessionStateV6: to.Ptr(armpeering.SessionStateV6Established),
		// 							},
		// 							ConnectionIdentifier: to.Ptr("CDD8E673-CB07-47E6-84DE-3739F778762B"),
		// 							ConnectionState: to.Ptr(armpeering.ConnectionStateActive),
		// 							PeeringDBFacilityID: to.Ptr[int32](99999),
		// 					}},
		// 					PeerAsn: &armpeering.SubResource{
		// 						ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1"),
		// 					},
		// 				},
		// 				PeeringLocation: to.Ptr("peeringLocation0"),
		// 				ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
		// 			},
		// 			SKU: &armpeering.SKU{
		// 				Name: to.Ptr("Basic_Exchange_Free"),
		// 				Family: to.Ptr(armpeering.FamilyExchange),
		// 				Size: to.Ptr(armpeering.SizeFree),
		// 				Tier: to.Ptr(armpeering.TierBasic),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*PeeringsClient) NewListBySubscriptionPager added in v0.5.0

NewListBySubscriptionPager - Lists all of the peerings under the given subscription.

Generated from API version 2022-01-01

  • options - PeeringsClientListBySubscriptionOptions contains the optional parameters for the PeeringsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringsBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPeeringsClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ListResult = armpeering.ListResult{
		// 	Value: []*armpeering.Peering{
		// 		{
		// 			Name: to.Ptr("peeringName"),
		// 			Type: to.Ptr("Microsoft.Peering/peerings"),
		// 			ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName"),
		// 			Kind: to.Ptr(armpeering.KindExchange),
		// 			Location: to.Ptr("eastus"),
		// 			Properties: &armpeering.Properties{
		// 				Exchange: &armpeering.PropertiesExchange{
		// 					Connections: []*armpeering.ExchangeConnection{
		// 						{
		// 							BgpSession: &armpeering.BgpSession{
		// 								MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
		// 								MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
		// 								MD5AuthenticationKey: to.Ptr("test-md5-auth-key"),
		// 								MicrosoftSessionIPv4Address: to.Ptr("192.168.3.1"),
		// 								MicrosoftSessionIPv6Address: to.Ptr("fd00::1:1"),
		// 								PeerSessionIPv4Address: to.Ptr("192.168.2.1"),
		// 								PeerSessionIPv6Address: to.Ptr("fd00::1"),
		// 								SessionStateV4: to.Ptr(armpeering.SessionStateV4Established),
		// 								SessionStateV6: to.Ptr(armpeering.SessionStateV6Established),
		// 							},
		// 							ConnectionIdentifier: to.Ptr("CE495334-0E94-4E51-8164-8116D6CD284D"),
		// 							ConnectionState: to.Ptr(armpeering.ConnectionStateActive),
		// 							PeeringDBFacilityID: to.Ptr[int32](99999),
		// 						},
		// 						{
		// 							BgpSession: &armpeering.BgpSession{
		// 								MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
		// 								MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
		// 								MD5AuthenticationKey: to.Ptr("test-md5-auth-key"),
		// 								MicrosoftSessionIPv4Address: to.Ptr("192.168.3.2"),
		// 								MicrosoftSessionIPv6Address: to.Ptr("fd00::1:2"),
		// 								PeerSessionIPv4Address: to.Ptr("192.168.2.2"),
		// 								PeerSessionIPv6Address: to.Ptr("fd00::2"),
		// 								SessionStateV4: to.Ptr(armpeering.SessionStateV4Established),
		// 								SessionStateV6: to.Ptr(armpeering.SessionStateV6Established),
		// 							},
		// 							ConnectionIdentifier: to.Ptr("CDD8E673-CB07-47E6-84DE-3739F778762B"),
		// 							ConnectionState: to.Ptr(armpeering.ConnectionStateActive),
		// 							PeeringDBFacilityID: to.Ptr[int32](99999),
		// 					}},
		// 					PeerAsn: &armpeering.SubResource{
		// 						ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1"),
		// 					},
		// 				},
		// 				PeeringLocation: to.Ptr("peeringLocation0"),
		// 				ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
		// 			},
		// 			SKU: &armpeering.SKU{
		// 				Name: to.Ptr("Basic_Exchange_Free"),
		// 				Family: to.Ptr(armpeering.FamilyExchange),
		// 				Size: to.Ptr(armpeering.SizeFree),
		// 				Tier: to.Ptr(armpeering.TierBasic),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*PeeringsClient) Update

func (client *PeeringsClient) Update(ctx context.Context, resourceGroupName string, peeringName string, tags ResourceTags, options *PeeringsClientUpdateOptions) (PeeringsClientUpdateResponse, error)

Update - Updates tags for a peering with the specified name under the given subscription and resource group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringName - The name of the peering.
  • tags - The resource tags.
  • options - PeeringsClientUpdateOptions contains the optional parameters for the PeeringsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/UpdatePeeringTags.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/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPeeringsClient().Update(ctx, "rgName", "peeringName", armpeering.ResourceTags{
		Tags: map[string]*string{
			"tag0": to.Ptr("value0"),
			"tag1": to.Ptr("value1"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Peering = armpeering.Peering{
	// 	Name: to.Ptr("peeringName"),
	// 	Type: to.Ptr("Microsoft.Peering/peerings"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName"),
	// 	Kind: to.Ptr(armpeering.KindExchange),
	// 	Location: to.Ptr("eastus"),
	// 	Properties: &armpeering.Properties{
	// 		Exchange: &armpeering.PropertiesExchange{
	// 			Connections: []*armpeering.ExchangeConnection{
	// 				{
	// 					BgpSession: &armpeering.BgpSession{
	// 						MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
	// 						MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
	// 						MD5AuthenticationKey: to.Ptr("test-md5-auth-key"),
	// 						MicrosoftSessionIPv4Address: to.Ptr("192.168.3.1"),
	// 						MicrosoftSessionIPv6Address: to.Ptr("fd00::1:1"),
	// 						PeerSessionIPv4Address: to.Ptr("192.168.2.1"),
	// 						PeerSessionIPv6Address: to.Ptr("fd00::1"),
	// 						SessionStateV4: to.Ptr(armpeering.SessionStateV4Established),
	// 						SessionStateV6: to.Ptr(armpeering.SessionStateV6Established),
	// 					},
	// 					ConnectionIdentifier: to.Ptr("CE495334-0E94-4E51-8164-8116D6CD284D"),
	// 					ConnectionState: to.Ptr(armpeering.ConnectionStateActive),
	// 					PeeringDBFacilityID: to.Ptr[int32](99999),
	// 				},
	// 				{
	// 					BgpSession: &armpeering.BgpSession{
	// 						MaxPrefixesAdvertisedV4: to.Ptr[int32](1000),
	// 						MaxPrefixesAdvertisedV6: to.Ptr[int32](100),
	// 						MD5AuthenticationKey: to.Ptr("test-md5-auth-key"),
	// 						MicrosoftSessionIPv4Address: to.Ptr("192.168.3.2"),
	// 						MicrosoftSessionIPv6Address: to.Ptr("fd00::1:2"),
	// 						PeerSessionIPv4Address: to.Ptr("192.168.2.2"),
	// 						PeerSessionIPv6Address: to.Ptr("fd00::2"),
	// 						SessionStateV4: to.Ptr(armpeering.SessionStateV4Established),
	// 						SessionStateV6: to.Ptr(armpeering.SessionStateV6Established),
	// 					},
	// 					ConnectionIdentifier: to.Ptr("CDD8E673-CB07-47E6-84DE-3739F778762B"),
	// 					ConnectionState: to.Ptr(armpeering.ConnectionStateActive),
	// 					PeeringDBFacilityID: to.Ptr[int32](99999),
	// 			}},
	// 			PeerAsn: &armpeering.SubResource{
	// 				ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1"),
	// 			},
	// 		},
	// 		PeeringLocation: to.Ptr("peeringLocation0"),
	// 		ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 	},
	// 	SKU: &armpeering.SKU{
	// 		Name: to.Ptr("Basic_Exchange_Free"),
	// 		Family: to.Ptr(armpeering.FamilyExchange),
	// 		Size: to.Ptr(armpeering.SizeFree),
	// 		Tier: to.Ptr(armpeering.TierBasic),
	// 	},
	// 	Tags: map[string]*string{
	// 		"tag0": to.Ptr("value0"),
	// 		"tag1": to.Ptr("value1"),
	// 	},
	// }
}
Output:

type PeeringsClientCreateOrUpdateOptions added in v0.2.0

type PeeringsClientCreateOrUpdateOptions struct {
}

PeeringsClientCreateOrUpdateOptions contains the optional parameters for the PeeringsClient.CreateOrUpdate method.

type PeeringsClientCreateOrUpdateResponse added in v0.2.0

type PeeringsClientCreateOrUpdateResponse struct {
	// Peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location.
	Peering
}

PeeringsClientCreateOrUpdateResponse contains the response from method PeeringsClient.CreateOrUpdate.

type PeeringsClientDeleteOptions added in v0.2.0

type PeeringsClientDeleteOptions struct {
}

PeeringsClientDeleteOptions contains the optional parameters for the PeeringsClient.Delete method.

type PeeringsClientDeleteResponse added in v0.2.0

type PeeringsClientDeleteResponse struct {
}

PeeringsClientDeleteResponse contains the response from method PeeringsClient.Delete.

type PeeringsClientGetOptions added in v0.2.0

type PeeringsClientGetOptions struct {
}

PeeringsClientGetOptions contains the optional parameters for the PeeringsClient.Get method.

type PeeringsClientGetResponse added in v0.2.0

type PeeringsClientGetResponse struct {
	// Peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location.
	Peering
}

PeeringsClientGetResponse contains the response from method PeeringsClient.Get.

type PeeringsClientListByResourceGroupOptions added in v0.2.0

type PeeringsClientListByResourceGroupOptions struct {
}

PeeringsClientListByResourceGroupOptions contains the optional parameters for the PeeringsClient.NewListByResourceGroupPager method.

type PeeringsClientListByResourceGroupResponse added in v0.2.0

type PeeringsClientListByResourceGroupResponse struct {
	// The paginated list of peerings.
	ListResult
}

PeeringsClientListByResourceGroupResponse contains the response from method PeeringsClient.NewListByResourceGroupPager.

type PeeringsClientListBySubscriptionOptions added in v0.2.0

type PeeringsClientListBySubscriptionOptions struct {
}

PeeringsClientListBySubscriptionOptions contains the optional parameters for the PeeringsClient.NewListBySubscriptionPager method.

type PeeringsClientListBySubscriptionResponse added in v0.2.0

type PeeringsClientListBySubscriptionResponse struct {
	// The paginated list of peerings.
	ListResult
}

PeeringsClientListBySubscriptionResponse contains the response from method PeeringsClient.NewListBySubscriptionPager.

type PeeringsClientUpdateOptions added in v0.2.0

type PeeringsClientUpdateOptions struct {
}

PeeringsClientUpdateOptions contains the optional parameters for the PeeringsClient.Update method.

type PeeringsClientUpdateResponse added in v0.2.0

type PeeringsClientUpdateResponse struct {
	// Peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location.
	Peering
}

PeeringsClientUpdateResponse contains the response from method PeeringsClient.Update.

type PrefixValidationState

type PrefixValidationState string

PrefixValidationState - The prefix validation state.

const (
	PrefixValidationStateFailed   PrefixValidationState = "Failed"
	PrefixValidationStateInvalid  PrefixValidationState = "Invalid"
	PrefixValidationStateNone     PrefixValidationState = "None"
	PrefixValidationStatePending  PrefixValidationState = "Pending"
	PrefixValidationStateUnknown  PrefixValidationState = "Unknown"
	PrefixValidationStateVerified PrefixValidationState = "Verified"
	PrefixValidationStateWarning  PrefixValidationState = "Warning"
)

func PossiblePrefixValidationStateValues

func PossiblePrefixValidationStateValues() []PrefixValidationState

PossiblePrefixValidationStateValues returns the possible values for the PrefixValidationState const type.

type PrefixesClient

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

PrefixesClient contains the methods for the Prefixes group. Don't use this type directly, use NewPrefixesClient() instead.

func NewPrefixesClient

func NewPrefixesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrefixesClient, error)

NewPrefixesClient creates a new instance of PrefixesClient with the specified values.

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

func (*PrefixesClient) CreateOrUpdate added in v0.3.0

func (client *PrefixesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, peeringServicePrefix ServicePrefix, options *PrefixesClientCreateOrUpdateOptions) (PrefixesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates a new prefix with the specified name under the given subscription, resource group and peering service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringServiceName - The name of the peering service.
  • prefixName - The name of the prefix.
  • peeringServicePrefix - The properties needed to create a prefix.
  • options - PrefixesClientCreateOrUpdateOptions contains the optional parameters for the PrefixesClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreatePeeringServicePrefix.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/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrefixesClient().CreateOrUpdate(ctx, "rgName", "peeringServiceName", "peeringServicePrefixName", armpeering.ServicePrefix{
		Properties: &armpeering.ServicePrefixProperties{
			PeeringServicePrefixKey: to.Ptr("00000000-0000-0000-0000-000000000000"),
			Prefix:                  to.Ptr("192.168.1.0/24"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ServicePrefix = armpeering.ServicePrefix{
	// 	Name: to.Ptr("peeringServicePrefixName"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peeringServices/peeringServiceName/prefixes/peeringServicePrefixName"),
	// 	Properties: &armpeering.ServicePrefixProperties{
	// 		ErrorMessage: to.Ptr("Prefix is not announced by the service provider to Microsoft."),
	// 		LearnedType: to.Ptr(armpeering.LearnedTypeNone),
	// 		PeeringServicePrefixKey: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		Prefix: to.Ptr("192.168.1.0/24"),
	// 		PrefixValidationState: to.Ptr(armpeering.PrefixValidationStateFailed),
	// 		ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*PrefixesClient) Delete added in v0.3.0

func (client *PrefixesClient) Delete(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, options *PrefixesClientDeleteOptions) (PrefixesClientDeleteResponse, error)

Delete - Deletes an existing prefix with the specified name under the given subscription, resource group and peering service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringServiceName - The name of the peering service.
  • prefixName - The name of the prefix.
  • options - PrefixesClientDeleteOptions contains the optional parameters for the PrefixesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/DeletePeeringServicePrefix.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewPrefixesClient().Delete(ctx, "rgName", "peeringServiceName", "peeringServicePrefixName", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*PrefixesClient) Get added in v0.3.0

func (client *PrefixesClient) Get(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, options *PrefixesClientGetOptions) (PrefixesClientGetResponse, error)

Get - Gets an existing prefix with the specified name under the given subscription, resource group and peering service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringServiceName - The name of the peering service.
  • prefixName - The name of the prefix.
  • options - PrefixesClientGetOptions contains the optional parameters for the PrefixesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetPeeringServicePrefix.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrefixesClient().Get(ctx, "rgName", "peeringServiceName", "peeringServicePrefixName", &armpeering.PrefixesClientGetOptions{Expand: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ServicePrefix = armpeering.ServicePrefix{
	// 	Name: to.Ptr("peeringServicePrefixName"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peeringServices/peeringServiceName/prefixes/peeringServicePrefixName"),
	// 	Properties: &armpeering.ServicePrefixProperties{
	// 		LearnedType: to.Ptr(armpeering.LearnedTypeViaServiceProvider),
	// 		PeeringServicePrefixKey: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		Prefix: to.Ptr("192.168.1.0/24"),
	// 		PrefixValidationState: to.Ptr(armpeering.PrefixValidationStateVerified),
	// 		ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*PrefixesClient) NewListByPeeringServicePager added in v0.5.0

func (client *PrefixesClient) NewListByPeeringServicePager(resourceGroupName string, peeringServiceName string, options *PrefixesClientListByPeeringServiceOptions) *runtime.Pager[PrefixesClientListByPeeringServiceResponse]

NewListByPeeringServicePager - Lists all prefixes under the given subscription, resource group and peering service.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringServiceName - The name of the peering service.
  • options - PrefixesClientListByPeeringServiceOptions contains the optional parameters for the PrefixesClient.NewListByPeeringServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPrefixesByPeeringService.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPrefixesClient().NewListByPeeringServicePager("rgName", "peeringServiceName", &armpeering.PrefixesClientListByPeeringServiceOptions{Expand: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ServicePrefixListResult = armpeering.ServicePrefixListResult{
		// 	Value: []*armpeering.ServicePrefix{
		// 		{
		// 			Name: to.Ptr("peeringServicePrefixName1"),
		// 			ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peeringServices/peeringServiceName/prefixes/peeringServicePrefixName1"),
		// 			Properties: &armpeering.ServicePrefixProperties{
		// 				LearnedType: to.Ptr(armpeering.LearnedTypeViaServiceProvider),
		// 				PeeringServicePrefixKey: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 				Prefix: to.Ptr("192.168.1.0/24"),
		// 				PrefixValidationState: to.Ptr(armpeering.PrefixValidationStateVerified),
		// 				ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("peeringServicePrefixName2"),
		// 			ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peeringServices/peeringServiceName/prefixes/peeringServicePrefixName2"),
		// 			Properties: &armpeering.ServicePrefixProperties{
		// 				LearnedType: to.Ptr(armpeering.LearnedTypeViaServiceProvider),
		// 				PeeringServicePrefixKey: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 				Prefix: to.Ptr("192.168.2.0/24"),
		// 				PrefixValidationState: to.Ptr(armpeering.PrefixValidationStateVerified),
		// 				ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

type PrefixesClientCreateOrUpdateOptions added in v0.3.0

type PrefixesClientCreateOrUpdateOptions struct {
}

PrefixesClientCreateOrUpdateOptions contains the optional parameters for the PrefixesClient.CreateOrUpdate method.

type PrefixesClientCreateOrUpdateResponse added in v0.3.0

type PrefixesClientCreateOrUpdateResponse struct {
	// The peering service prefix class.
	ServicePrefix
}

PrefixesClientCreateOrUpdateResponse contains the response from method PrefixesClient.CreateOrUpdate.

type PrefixesClientDeleteOptions added in v0.3.0

type PrefixesClientDeleteOptions struct {
}

PrefixesClientDeleteOptions contains the optional parameters for the PrefixesClient.Delete method.

type PrefixesClientDeleteResponse added in v0.3.0

type PrefixesClientDeleteResponse struct {
}

PrefixesClientDeleteResponse contains the response from method PrefixesClient.Delete.

type PrefixesClientGetOptions added in v0.3.0

type PrefixesClientGetOptions struct {
	// The properties to be expanded.
	Expand *string
}

PrefixesClientGetOptions contains the optional parameters for the PrefixesClient.Get method.

type PrefixesClientGetResponse added in v0.3.0

type PrefixesClientGetResponse struct {
	// The peering service prefix class.
	ServicePrefix
}

PrefixesClientGetResponse contains the response from method PrefixesClient.Get.

type PrefixesClientListByPeeringServiceOptions added in v0.2.0

type PrefixesClientListByPeeringServiceOptions struct {
	// The properties to be expanded.
	Expand *string
}

PrefixesClientListByPeeringServiceOptions contains the optional parameters for the PrefixesClient.NewListByPeeringServicePager method.

type PrefixesClientListByPeeringServiceResponse added in v0.2.0

type PrefixesClientListByPeeringServiceResponse struct {
	// The paginated list of peering service prefixes.
	ServicePrefixListResult
}

PrefixesClientListByPeeringServiceResponse contains the response from method PrefixesClient.NewListByPeeringServicePager.

type Properties added in v0.2.0

type Properties struct {
	// The properties that define a direct peering.
	Direct *PropertiesDirect

	// The properties that define an exchange peering.
	Exchange *PropertiesExchange

	// The location of the peering.
	PeeringLocation *string

	// READ-ONLY; The provisioning state of the resource.
	ProvisioningState *ProvisioningState
}

Properties - The properties that define connectivity to the Microsoft Cloud Edge.

func (Properties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type Properties.

func (*Properties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Properties.

type PropertiesDirect added in v0.2.0

type PropertiesDirect struct {
	// The set of connections that constitute a direct peering.
	Connections []*DirectConnection

	// The type of direct peering.
	DirectPeeringType *DirectPeeringType

	// The reference of the peer ASN.
	PeerAsn *SubResource

	// READ-ONLY; The flag that indicates whether or not the peering is used for peering service.
	UseForPeeringService *bool
}

PropertiesDirect - The properties that define a direct peering.

func (PropertiesDirect) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type PropertiesDirect.

func (*PropertiesDirect) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PropertiesDirect.

type PropertiesExchange added in v0.2.0

type PropertiesExchange struct {
	// The set of connections that constitute an exchange peering.
	Connections []*ExchangeConnection

	// The reference of the peer ASN.
	PeerAsn *SubResource
}

PropertiesExchange - The properties that define an exchange peering.

func (PropertiesExchange) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type PropertiesExchange.

func (*PropertiesExchange) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PropertiesExchange.

type ProvisioningState

type ProvisioningState string

ProvisioningState - The provisioning state of the resource.

const (
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type ReceivedRoute added in v0.3.0

type ReceivedRoute struct {
	// READ-ONLY; The AS path for the prefix.
	AsPath *string

	// READ-ONLY; The next hop for the prefix.
	NextHop *string

	// READ-ONLY; The origin AS change information for the prefix.
	OriginAsValidationState *string

	// READ-ONLY; The prefix.
	Prefix *string

	// READ-ONLY; The received timestamp associated with the prefix.
	ReceivedTimestamp *string

	// READ-ONLY; The RPKI validation state for the prefix and origin AS that's listed in the AS path.
	RpkiValidationState *string

	// READ-ONLY; The authority which holds the Route Origin Authorization record for the prefix, if any.
	TrustAnchor *string
}

ReceivedRoute - The properties that define a received route.

func (ReceivedRoute) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ReceivedRoute.

func (*ReceivedRoute) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReceivedRoute.

type ReceivedRouteListResult added in v0.3.0

type ReceivedRouteListResult struct {
	// The link to fetch the next page of received routes for the peering.
	NextLink *string

	// The list of received routes for the peering.
	Value []*ReceivedRoute
}

ReceivedRouteListResult - The paginated list of received routes for the peering.

func (ReceivedRouteListResult) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ReceivedRouteListResult.

func (*ReceivedRouteListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReceivedRouteListResult.

type ReceivedRoutesClient added in v0.3.0

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

ReceivedRoutesClient contains the methods for the ReceivedRoutes group. Don't use this type directly, use NewReceivedRoutesClient() instead.

func NewReceivedRoutesClient added in v0.3.0

func NewReceivedRoutesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReceivedRoutesClient, error)

NewReceivedRoutesClient creates a new instance of ReceivedRoutesClient with the specified values.

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

func (*ReceivedRoutesClient) NewListByPeeringPager added in v0.5.0

func (client *ReceivedRoutesClient) NewListByPeeringPager(resourceGroupName string, peeringName string, options *ReceivedRoutesClientListByPeeringOptions) *runtime.Pager[ReceivedRoutesClientListByPeeringResponse]

NewListByPeeringPager - Lists the prefixes received over the specified peering under the given subscription and resource group.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringName - The name of the peering.
  • options - ReceivedRoutesClientListByPeeringOptions contains the optional parameters for the ReceivedRoutesClient.NewListByPeeringPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetPeeringReceivedRoutes.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/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewReceivedRoutesClient().NewListByPeeringPager("rgName", "peeringName", &armpeering.ReceivedRoutesClientListByPeeringOptions{Prefix: to.Ptr("1.1.1.0/24"),
		AsPath:                  to.Ptr("123 456"),
		OriginAsValidationState: to.Ptr("Valid"),
		RpkiValidationState:     to.Ptr("Valid"),
		SkipToken:               nil,
	})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ReceivedRouteListResult = armpeering.ReceivedRouteListResult{
		// 	Value: []*armpeering.ReceivedRoute{
		// 		{
		// 			AsPath: to.Ptr("123 456"),
		// 			NextHop: to.Ptr("127.0.0.1"),
		// 			OriginAsValidationState: to.Ptr("Valid"),
		// 			Prefix: to.Ptr("1.1.1.0/24"),
		// 			ReceivedTimestamp: to.Ptr("2020-04-05 03:39:20"),
		// 			RpkiValidationState: to.Ptr("Valid"),
		// 			TrustAnchor: to.Ptr("Arin"),
		// 	}},
		// }
	}
}
Output:

type ReceivedRoutesClientListByPeeringOptions added in v0.3.0

type ReceivedRoutesClientListByPeeringOptions struct {
	// The optional AS path that can be used to filter the routes.
	AsPath *string

	// The optional origin AS validation state that can be used to filter the routes.
	OriginAsValidationState *string

	// The optional prefix that can be used to filter the routes.
	Prefix *string

	// The optional RPKI validation state that can be used to filter the routes.
	RpkiValidationState *string

	// The optional page continuation token that is used in the event of paginated result.
	SkipToken *string
}

ReceivedRoutesClientListByPeeringOptions contains the optional parameters for the ReceivedRoutesClient.NewListByPeeringPager method.

type ReceivedRoutesClientListByPeeringResponse added in v0.3.0

type ReceivedRoutesClientListByPeeringResponse struct {
	// The paginated list of received routes for the peering.
	ReceivedRouteListResult
}

ReceivedRoutesClientListByPeeringResponse contains the response from method ReceivedRoutesClient.NewListByPeeringPager.

type RegisteredAsn added in v0.3.0

type RegisteredAsn struct {
	// The properties that define a registered ASN.
	Properties *RegisteredAsnProperties

	// READ-ONLY; The ID of the resource.
	ID *string

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

	// READ-ONLY; The type of the resource.
	Type *string
}

RegisteredAsn - The customer's ASN that is registered by the peering service provider.

func (RegisteredAsn) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type RegisteredAsn.

func (*RegisteredAsn) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredAsn.

type RegisteredAsnListResult added in v0.3.0

type RegisteredAsnListResult struct {
	// The link to fetch the next page of peering registered ASNs.
	NextLink *string

	// The list of peering registered ASNs.
	Value []*RegisteredAsn
}

RegisteredAsnListResult - The paginated list of peering registered ASNs.

func (RegisteredAsnListResult) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type RegisteredAsnListResult.

func (*RegisteredAsnListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredAsnListResult.

type RegisteredAsnProperties added in v0.3.0

type RegisteredAsnProperties struct {
	// The customer's ASN from which traffic originates.
	Asn *int32

	// READ-ONLY; The peering service prefix key that is to be shared with the customer.
	PeeringServicePrefixKey *string

	// READ-ONLY; The provisioning state of the resource.
	ProvisioningState *ProvisioningState
}

RegisteredAsnProperties - The properties that define a registered ASN.

func (RegisteredAsnProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type RegisteredAsnProperties.

func (*RegisteredAsnProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredAsnProperties.

type RegisteredAsnsClient added in v0.3.0

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

RegisteredAsnsClient contains the methods for the RegisteredAsns group. Don't use this type directly, use NewRegisteredAsnsClient() instead.

func NewRegisteredAsnsClient added in v0.3.0

func NewRegisteredAsnsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegisteredAsnsClient, error)

NewRegisteredAsnsClient creates a new instance of RegisteredAsnsClient with the specified values.

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

func (*RegisteredAsnsClient) CreateOrUpdate added in v0.3.0

func (client *RegisteredAsnsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringName string, registeredAsnName string, registeredAsn RegisteredAsn, options *RegisteredAsnsClientCreateOrUpdateOptions) (RegisteredAsnsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates a new registered ASN with the specified name under the given subscription, resource group and peering. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringName - The name of the peering.
  • registeredAsnName - The name of the ASN.
  • registeredAsn - The properties needed to create a registered ASN.
  • options - RegisteredAsnsClientCreateOrUpdateOptions contains the optional parameters for the RegisteredAsnsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreateRegisteredAsn.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/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRegisteredAsnsClient().CreateOrUpdate(ctx, "rgName", "peeringName", "registeredAsnName", armpeering.RegisteredAsn{
		Properties: &armpeering.RegisteredAsnProperties{
			Asn: to.Ptr[int32](65000),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.RegisteredAsn = armpeering.RegisteredAsn{
	// 	Name: to.Ptr("registeredAsnName"),
	// 	Type: to.Ptr("Microsoft.Peering/registeredAsns"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName/registeredAsns/registeredAsnName"),
	// 	Properties: &armpeering.RegisteredAsnProperties{
	// 		Asn: to.Ptr[int32](65000),
	// 		PeeringServicePrefixKey: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*RegisteredAsnsClient) Delete added in v0.3.0

func (client *RegisteredAsnsClient) Delete(ctx context.Context, resourceGroupName string, peeringName string, registeredAsnName string, options *RegisteredAsnsClientDeleteOptions) (RegisteredAsnsClientDeleteResponse, error)

Delete - Deletes an existing registered ASN with the specified name under the given subscription, resource group and peering. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringName - The name of the peering.
  • registeredAsnName - The name of the registered ASN.
  • options - RegisteredAsnsClientDeleteOptions contains the optional parameters for the RegisteredAsnsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/DeleteRegisteredAsn.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewRegisteredAsnsClient().Delete(ctx, "rgName", "peeringName", "registeredAsnName", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*RegisteredAsnsClient) Get added in v0.3.0

func (client *RegisteredAsnsClient) Get(ctx context.Context, resourceGroupName string, peeringName string, registeredAsnName string, options *RegisteredAsnsClientGetOptions) (RegisteredAsnsClientGetResponse, error)

Get - Gets an existing registered ASN with the specified name under the given subscription, resource group and peering. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringName - The name of the peering.
  • registeredAsnName - The name of the registered ASN.
  • options - RegisteredAsnsClientGetOptions contains the optional parameters for the RegisteredAsnsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetRegisteredAsn.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRegisteredAsnsClient().Get(ctx, "rgName", "peeringName", "registeredAsnName0", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.RegisteredAsn = armpeering.RegisteredAsn{
	// 	Name: to.Ptr("registeredAsnName0"),
	// 	Type: to.Ptr("Microsoft.Peering/registeredAsns"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName/registeredAsns/registeredAsnName0"),
	// 	Properties: &armpeering.RegisteredAsnProperties{
	// 		Asn: to.Ptr[int32](65000),
	// 		PeeringServicePrefixKey: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*RegisteredAsnsClient) NewListByPeeringPager added in v0.5.0

func (client *RegisteredAsnsClient) NewListByPeeringPager(resourceGroupName string, peeringName string, options *RegisteredAsnsClientListByPeeringOptions) *runtime.Pager[RegisteredAsnsClientListByPeeringResponse]

NewListByPeeringPager - Lists all registered ASNs under the given subscription, resource group and peering.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringName - The name of the peering.
  • options - RegisteredAsnsClientListByPeeringOptions contains the optional parameters for the RegisteredAsnsClient.NewListByPeeringPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListRegisteredAsnsByPeering.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRegisteredAsnsClient().NewListByPeeringPager("rgName", "peeringName", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.RegisteredAsnListResult = armpeering.RegisteredAsnListResult{
		// 	Value: []*armpeering.RegisteredAsn{
		// 		{
		// 			Name: to.Ptr("registeredAsnName0"),
		// 			Type: to.Ptr("Microsoft.Peering/registeredAsns"),
		// 			ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName/registeredAsns/registeredAsnName0"),
		// 			Properties: &armpeering.RegisteredAsnProperties{
		// 				Asn: to.Ptr[int32](65000),
		// 				PeeringServicePrefixKey: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 				ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("registeredAsnName1"),
		// 			Type: to.Ptr("Microsoft.Peering/registeredAsns"),
		// 			ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName/registeredAsns/registeredAsnName1"),
		// 			Properties: &armpeering.RegisteredAsnProperties{
		// 				Asn: to.Ptr[int32](65001),
		// 				ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("registeredAsnName2"),
		// 			Type: to.Ptr("Microsoft.Peering/registeredAsns"),
		// 			ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName/registeredAsns/registeredAsnName2"),
		// 			Properties: &armpeering.RegisteredAsnProperties{
		// 				Asn: to.Ptr[int32](65002),
		// 				PeeringServicePrefixKey: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 				ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

type RegisteredAsnsClientCreateOrUpdateOptions added in v0.3.0

type RegisteredAsnsClientCreateOrUpdateOptions struct {
}

RegisteredAsnsClientCreateOrUpdateOptions contains the optional parameters for the RegisteredAsnsClient.CreateOrUpdate method.

type RegisteredAsnsClientCreateOrUpdateResponse added in v0.3.0

type RegisteredAsnsClientCreateOrUpdateResponse struct {
	// The customer's ASN that is registered by the peering service provider.
	RegisteredAsn
}

RegisteredAsnsClientCreateOrUpdateResponse contains the response from method RegisteredAsnsClient.CreateOrUpdate.

type RegisteredAsnsClientDeleteOptions added in v0.3.0

type RegisteredAsnsClientDeleteOptions struct {
}

RegisteredAsnsClientDeleteOptions contains the optional parameters for the RegisteredAsnsClient.Delete method.

type RegisteredAsnsClientDeleteResponse added in v0.3.0

type RegisteredAsnsClientDeleteResponse struct {
}

RegisteredAsnsClientDeleteResponse contains the response from method RegisteredAsnsClient.Delete.

type RegisteredAsnsClientGetOptions added in v0.3.0

type RegisteredAsnsClientGetOptions struct {
}

RegisteredAsnsClientGetOptions contains the optional parameters for the RegisteredAsnsClient.Get method.

type RegisteredAsnsClientGetResponse added in v0.3.0

type RegisteredAsnsClientGetResponse struct {
	// The customer's ASN that is registered by the peering service provider.
	RegisteredAsn
}

RegisteredAsnsClientGetResponse contains the response from method RegisteredAsnsClient.Get.

type RegisteredAsnsClientListByPeeringOptions added in v0.3.0

type RegisteredAsnsClientListByPeeringOptions struct {
}

RegisteredAsnsClientListByPeeringOptions contains the optional parameters for the RegisteredAsnsClient.NewListByPeeringPager method.

type RegisteredAsnsClientListByPeeringResponse added in v0.3.0

type RegisteredAsnsClientListByPeeringResponse struct {
	// The paginated list of peering registered ASNs.
	RegisteredAsnListResult
}

RegisteredAsnsClientListByPeeringResponse contains the response from method RegisteredAsnsClient.NewListByPeeringPager.

type RegisteredPrefix added in v0.3.0

type RegisteredPrefix struct {
	// The properties that define a registered prefix.
	Properties *RegisteredPrefixProperties

	// READ-ONLY; The ID of the resource.
	ID *string

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

	// READ-ONLY; The type of the resource.
	Type *string
}

RegisteredPrefix - The customer's prefix that is registered by the peering service provider.

func (RegisteredPrefix) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type RegisteredPrefix.

func (*RegisteredPrefix) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredPrefix.

type RegisteredPrefixListResult added in v0.3.0

type RegisteredPrefixListResult struct {
	// The link to fetch the next page of peering registered prefixes.
	NextLink *string

	// The list of peering registered prefixes.
	Value []*RegisteredPrefix
}

RegisteredPrefixListResult - The paginated list of peering registered prefixes.

func (RegisteredPrefixListResult) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type RegisteredPrefixListResult.

func (*RegisteredPrefixListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredPrefixListResult.

type RegisteredPrefixProperties added in v0.3.0

type RegisteredPrefixProperties struct {
	// The customer's prefix from which traffic originates.
	Prefix *string

	// READ-ONLY; The error message associated with the validation state, if any.
	ErrorMessage *string

	// READ-ONLY; The peering service prefix key that is to be shared with the customer.
	PeeringServicePrefixKey *string

	// READ-ONLY; The prefix validation state.
	PrefixValidationState *PrefixValidationState

	// READ-ONLY; The provisioning state of the resource.
	ProvisioningState *ProvisioningState
}

RegisteredPrefixProperties - The properties that define a registered prefix.

func (RegisteredPrefixProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type RegisteredPrefixProperties.

func (*RegisteredPrefixProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredPrefixProperties.

type RegisteredPrefixesClient added in v0.3.0

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

RegisteredPrefixesClient contains the methods for the RegisteredPrefixes group. Don't use this type directly, use NewRegisteredPrefixesClient() instead.

func NewRegisteredPrefixesClient added in v0.3.0

func NewRegisteredPrefixesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegisteredPrefixesClient, error)

NewRegisteredPrefixesClient creates a new instance of RegisteredPrefixesClient with the specified values.

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

func (*RegisteredPrefixesClient) CreateOrUpdate added in v0.3.0

func (client *RegisteredPrefixesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringName string, registeredPrefixName string, registeredPrefix RegisteredPrefix, options *RegisteredPrefixesClientCreateOrUpdateOptions) (RegisteredPrefixesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates a new registered prefix with the specified name under the given subscription, resource group and peering. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringName - The name of the peering.
  • registeredPrefixName - The name of the registered prefix.
  • registeredPrefix - The properties needed to create a registered prefix.
  • options - RegisteredPrefixesClientCreateOrUpdateOptions contains the optional parameters for the RegisteredPrefixesClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreateRegisteredPrefix.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/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRegisteredPrefixesClient().CreateOrUpdate(ctx, "rgName", "peeringName", "registeredPrefixName", armpeering.RegisteredPrefix{
		Properties: &armpeering.RegisteredPrefixProperties{
			Prefix: to.Ptr("10.22.20.0/24"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.RegisteredPrefix = armpeering.RegisteredPrefix{
	// 	Name: to.Ptr("registeredPrefixName"),
	// 	Type: to.Ptr("Microsoft.Peering/registeredPrefixes"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName/registeredPrefixes/registeredPrefixName"),
	// 	Properties: &armpeering.RegisteredPrefixProperties{
	// 		PeeringServicePrefixKey: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		Prefix: to.Ptr("10.22.20.0/24"),
	// 		PrefixValidationState: to.Ptr(armpeering.PrefixValidationStateVerified),
	// 		ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*RegisteredPrefixesClient) Delete added in v0.3.0

func (client *RegisteredPrefixesClient) Delete(ctx context.Context, resourceGroupName string, peeringName string, registeredPrefixName string, options *RegisteredPrefixesClientDeleteOptions) (RegisteredPrefixesClientDeleteResponse, error)

Delete - Deletes an existing registered prefix with the specified name under the given subscription, resource group and peering. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringName - The name of the peering.
  • registeredPrefixName - The name of the registered prefix.
  • options - RegisteredPrefixesClientDeleteOptions contains the optional parameters for the RegisteredPrefixesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/DeleteRegisteredPrefix.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewRegisteredPrefixesClient().Delete(ctx, "rgName", "peeringName", "registeredPrefixName", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*RegisteredPrefixesClient) Get added in v0.3.0

func (client *RegisteredPrefixesClient) Get(ctx context.Context, resourceGroupName string, peeringName string, registeredPrefixName string, options *RegisteredPrefixesClientGetOptions) (RegisteredPrefixesClientGetResponse, error)

Get - Gets an existing registered prefix with the specified name under the given subscription, resource group and peering. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringName - The name of the peering.
  • registeredPrefixName - The name of the registered prefix.
  • options - RegisteredPrefixesClientGetOptions contains the optional parameters for the RegisteredPrefixesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetRegisteredPrefix.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRegisteredPrefixesClient().Get(ctx, "rgName", "peeringName", "registeredPrefixName", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.RegisteredPrefix = armpeering.RegisteredPrefix{
	// 	Name: to.Ptr("registeredPrefixName"),
	// 	Type: to.Ptr("Microsoft.Peering/registeredPrefixes"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName/registeredPrefixes/registeredPrefixName"),
	// 	Properties: &armpeering.RegisteredPrefixProperties{
	// 		PeeringServicePrefixKey: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		Prefix: to.Ptr("10.22.20.0/24"),
	// 		PrefixValidationState: to.Ptr(armpeering.PrefixValidationStateVerified),
	// 		ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*RegisteredPrefixesClient) NewListByPeeringPager added in v0.5.0

NewListByPeeringPager - Lists all registered prefixes under the given subscription, resource group and peering.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringName - The name of the peering.
  • options - RegisteredPrefixesClientListByPeeringOptions contains the optional parameters for the RegisteredPrefixesClient.NewListByPeeringPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListRegisteredPrefixesByPeering.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRegisteredPrefixesClient().NewListByPeeringPager("rgName", "peeringName", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.RegisteredPrefixListResult = armpeering.RegisteredPrefixListResult{
		// 	Value: []*armpeering.RegisteredPrefix{
		// 		{
		// 			Name: to.Ptr("registeredPrefixName0"),
		// 			Type: to.Ptr("Microsoft.Peering/registeredPrefixes"),
		// 			ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName/registeredPrefixes/registeredPrefixName0"),
		// 			Properties: &armpeering.RegisteredPrefixProperties{
		// 				PeeringServicePrefixKey: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 				Prefix: to.Ptr("10.22.20.0/24"),
		// 				PrefixValidationState: to.Ptr(armpeering.PrefixValidationStateVerified),
		// 				ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("registeredPrefixName1"),
		// 			Type: to.Ptr("Microsoft.Peering/registeredPrefixes"),
		// 			ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName/registeredPrefixes/registeredPrefixName1"),
		// 			Properties: &armpeering.RegisteredPrefixProperties{
		// 				PeeringServicePrefixKey: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 				Prefix: to.Ptr("10.22.21.0/24"),
		// 				PrefixValidationState: to.Ptr(armpeering.PrefixValidationStateVerified),
		// 				ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("registeredPrefixName2"),
		// 			Type: to.Ptr("Microsoft.Peering/registeredPrefixes"),
		// 			ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peerings/peeringName/registeredPrefixes/registeredPrefixName2"),
		// 			Properties: &armpeering.RegisteredPrefixProperties{
		// 				Prefix: to.Ptr("10.22.22.0/24"),
		// 				PrefixValidationState: to.Ptr(armpeering.PrefixValidationStatePending),
		// 				ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

type RegisteredPrefixesClientCreateOrUpdateOptions added in v0.3.0

type RegisteredPrefixesClientCreateOrUpdateOptions struct {
}

RegisteredPrefixesClientCreateOrUpdateOptions contains the optional parameters for the RegisteredPrefixesClient.CreateOrUpdate method.

type RegisteredPrefixesClientCreateOrUpdateResponse added in v0.3.0

type RegisteredPrefixesClientCreateOrUpdateResponse struct {
	// The customer's prefix that is registered by the peering service provider.
	RegisteredPrefix
}

RegisteredPrefixesClientCreateOrUpdateResponse contains the response from method RegisteredPrefixesClient.CreateOrUpdate.

type RegisteredPrefixesClientDeleteOptions added in v0.3.0

type RegisteredPrefixesClientDeleteOptions struct {
}

RegisteredPrefixesClientDeleteOptions contains the optional parameters for the RegisteredPrefixesClient.Delete method.

type RegisteredPrefixesClientDeleteResponse added in v0.3.0

type RegisteredPrefixesClientDeleteResponse struct {
}

RegisteredPrefixesClientDeleteResponse contains the response from method RegisteredPrefixesClient.Delete.

type RegisteredPrefixesClientGetOptions added in v0.3.0

type RegisteredPrefixesClientGetOptions struct {
}

RegisteredPrefixesClientGetOptions contains the optional parameters for the RegisteredPrefixesClient.Get method.

type RegisteredPrefixesClientGetResponse added in v0.3.0

type RegisteredPrefixesClientGetResponse struct {
	// The customer's prefix that is registered by the peering service provider.
	RegisteredPrefix
}

RegisteredPrefixesClientGetResponse contains the response from method RegisteredPrefixesClient.Get.

type RegisteredPrefixesClientListByPeeringOptions added in v0.3.0

type RegisteredPrefixesClientListByPeeringOptions struct {
}

RegisteredPrefixesClientListByPeeringOptions contains the optional parameters for the RegisteredPrefixesClient.NewListByPeeringPager method.

type RegisteredPrefixesClientListByPeeringResponse added in v0.3.0

type RegisteredPrefixesClientListByPeeringResponse struct {
	// The paginated list of peering registered prefixes.
	RegisteredPrefixListResult
}

RegisteredPrefixesClientListByPeeringResponse contains the response from method RegisteredPrefixesClient.NewListByPeeringPager.

type Resource

type Resource struct {
	// READ-ONLY; The ID of the resource.
	ID *string

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

	// READ-ONLY; The type of the resource.
	Type *string
}

Resource - The ARM resource class.

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 ResourceTags

type ResourceTags struct {
	// Gets or sets the tags, a dictionary of descriptors arm object
	Tags map[string]*string
}

ResourceTags - The resource tags.

func (ResourceTags) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ResourceTags.

func (*ResourceTags) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTags.

type Role added in v0.3.0

type Role string

Role - The role of the contact.

const (
	RoleEscalation Role = "Escalation"
	RoleNoc        Role = "Noc"
	RoleOther      Role = "Other"
	RolePolicy     Role = "Policy"
	RoleService    Role = "Service"
	RoleTechnical  Role = "Technical"
)

func PossibleRoleValues added in v0.3.0

func PossibleRoleValues() []Role

PossibleRoleValues returns the possible values for the Role const type.

type SKU added in v0.2.0

type SKU struct {
	// The name of the peering SKU.
	Name *string

	// READ-ONLY; The family of the peering SKU.
	Family *Family

	// READ-ONLY; The size of the peering SKU.
	Size *Size

	// READ-ONLY; The tier of the peering SKU.
	Tier *Tier
}

SKU - The SKU that defines the tier and kind of the peering.

func (SKU) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SKU.

func (*SKU) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKU.

type Service added in v0.2.0

type Service struct {
	// REQUIRED; The location of the resource.
	Location *string

	// The properties that define a peering service.
	Properties *ServiceProperties

	// The SKU that defines the type of the peering service.
	SKU *ServiceSKU

	// The resource tags.
	Tags map[string]*string

	// READ-ONLY; The ID of the resource.
	ID *string

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

	// READ-ONLY; The type of the resource.
	Type *string
}

Service - Peering Service

func (Service) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type Service.

func (*Service) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Service.

type ServiceCountriesClient added in v0.3.0

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

ServiceCountriesClient contains the methods for the PeeringServiceCountries group. Don't use this type directly, use NewServiceCountriesClient() instead.

func NewServiceCountriesClient added in v0.3.0

func NewServiceCountriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceCountriesClient, error)

NewServiceCountriesClient creates a new instance of ServiceCountriesClient with the specified values.

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

func (*ServiceCountriesClient) NewListPager added in v0.5.0

NewListPager - Lists all of the available countries for peering service.

Generated from API version 2022-01-01

  • options - ServiceCountriesClientListOptions contains the optional parameters for the ServiceCountriesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringServiceCountriesBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServiceCountriesClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ServiceCountryListResult = armpeering.ServiceCountryListResult{
		// 	Value: []*armpeering.ServiceCountry{
		// 		{
		// 			Name: to.Ptr("country1"),
		// 			Type: to.Ptr("Microsoft.Peering/peeringServiceCountries"),
		// 			ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peeringServiceCountries/country1"),
		// 		},
		// 		{
		// 			Name: to.Ptr("country2"),
		// 			Type: to.Ptr("Microsoft.Peering/peeringServiceCountries"),
		// 			ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peeringServiceCountries/country2"),
		// 	}},
		// }
	}
}
Output:

type ServiceCountriesClientListOptions added in v0.3.0

type ServiceCountriesClientListOptions struct {
}

ServiceCountriesClientListOptions contains the optional parameters for the ServiceCountriesClient.NewListPager method.

type ServiceCountriesClientListResponse added in v0.3.0

type ServiceCountriesClientListResponse struct {
	// The paginated list of peering service countries.
	ServiceCountryListResult
}

ServiceCountriesClientListResponse contains the response from method ServiceCountriesClient.NewListPager.

type ServiceCountry added in v0.3.0

type ServiceCountry struct {
	// READ-ONLY; The ID of the resource.
	ID *string

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

	// READ-ONLY; The type of the resource.
	Type *string
}

ServiceCountry - The peering service country.

func (ServiceCountry) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceCountry.

func (*ServiceCountry) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceCountry.

type ServiceCountryListResult added in v0.3.0

type ServiceCountryListResult struct {
	// The link to fetch the next page of peering service countries.
	NextLink *string

	// The list of peering service countries.
	Value []*ServiceCountry
}

ServiceCountryListResult - The paginated list of peering service countries.

func (ServiceCountryListResult) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceCountryListResult.

func (*ServiceCountryListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceCountryListResult.

type ServiceListResult added in v0.2.0

type ServiceListResult struct {
	// The link to fetch the next page of peering services.
	NextLink *string

	// The list of peering services.
	Value []*Service
}

ServiceListResult - The paginated list of peering services.

func (ServiceListResult) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceListResult.

func (*ServiceListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceListResult.

type ServiceLocation added in v0.2.0

type ServiceLocation struct {
	// The properties that define a peering service location.
	Properties *ServiceLocationProperties

	// READ-ONLY; The ID of the resource.
	ID *string

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

	// READ-ONLY; The type of the resource.
	Type *string
}

ServiceLocation - The peering service location.

func (ServiceLocation) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceLocation.

func (*ServiceLocation) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceLocation.

type ServiceLocationListResult added in v0.2.0

type ServiceLocationListResult struct {
	// The link to fetch the next page of peering service locations.
	NextLink *string

	// The list of peering service locations.
	Value []*ServiceLocation
}

ServiceLocationListResult - The paginated list of peering service locations.

func (ServiceLocationListResult) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceLocationListResult.

func (*ServiceLocationListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceLocationListResult.

type ServiceLocationProperties added in v0.2.0

type ServiceLocationProperties struct {
	// Azure region for the location
	AzureRegion *string

	// Country of the customer
	Country *string

	// State of the customer
	State *string
}

ServiceLocationProperties - The properties that define connectivity to the Peering Service Location.

func (ServiceLocationProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceLocationProperties.

func (*ServiceLocationProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceLocationProperties.

type ServiceLocationsClient added in v0.2.0

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

ServiceLocationsClient contains the methods for the PeeringServiceLocations group. Don't use this type directly, use NewServiceLocationsClient() instead.

func NewServiceLocationsClient added in v0.2.0

func NewServiceLocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceLocationsClient, error)

NewServiceLocationsClient creates a new instance of ServiceLocationsClient with the specified values.

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

func (*ServiceLocationsClient) NewListPager added in v0.5.0

NewListPager - Lists all of the available locations for peering service.

Generated from API version 2022-01-01

  • options - ServiceLocationsClientListOptions contains the optional parameters for the ServiceLocationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringServiceLocationsBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServiceLocationsClient().NewListPager(&armpeering.ServiceLocationsClientListOptions{Country: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ServiceLocationListResult = armpeering.ServiceLocationListResult{
		// 	Value: []*armpeering.ServiceLocation{
		// 		{
		// 			Name: to.Ptr("peeringServiceLocation1"),
		// 			Type: to.Ptr("Microsoft.Peering/peeringServiceLocations"),
		// 			ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peeringServiceLocations/peeringServiceLocation1"),
		// 			Properties: &armpeering.ServiceLocationProperties{
		// 				Country: to.Ptr("country1"),
		// 				State: to.Ptr("state1"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("peeringServiceLocation2"),
		// 			Type: to.Ptr("Microsoft.Peering/peeringServiceLocations"),
		// 			ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peeringServiceLocations/peeringServiceLocation2"),
		// 			Properties: &armpeering.ServiceLocationProperties{
		// 				Country: to.Ptr("country2"),
		// 				State: to.Ptr("state2"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ServiceLocationsClientListOptions added in v0.2.0

type ServiceLocationsClientListOptions struct {
	// The country of interest, in which the locations are to be present.
	Country *string
}

ServiceLocationsClientListOptions contains the optional parameters for the ServiceLocationsClient.NewListPager method.

type ServiceLocationsClientListResponse added in v0.2.0

type ServiceLocationsClientListResponse struct {
	// The paginated list of peering service locations.
	ServiceLocationListResult
}

ServiceLocationsClientListResponse contains the response from method ServiceLocationsClient.NewListPager.

type ServicePrefix added in v0.2.0

type ServicePrefix struct {
	// Gets or sets the peering prefix properties.
	Properties *ServicePrefixProperties

	// READ-ONLY; The ID of the resource.
	ID *string

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

	// READ-ONLY; The type of the resource.
	Type *string
}

ServicePrefix - The peering service prefix class.

func (ServicePrefix) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServicePrefix.

func (*ServicePrefix) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrefix.

type ServicePrefixEvent added in v0.3.0

type ServicePrefixEvent struct {
	// READ-ONLY; The description of the event associated with a prefix.
	EventDescription *string

	// READ-ONLY; The level of the event associated with a prefix.
	EventLevel *string

	// READ-ONLY; The summary of the event associated with a prefix.
	EventSummary *string

	// READ-ONLY; The timestamp of the event associated with a prefix.
	EventTimestamp *time.Time

	// READ-ONLY; The type of the event associated with a prefix.
	EventType *string
}

ServicePrefixEvent - The details of the event associated with a prefix.

func (ServicePrefixEvent) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ServicePrefixEvent.

func (*ServicePrefixEvent) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrefixEvent.

type ServicePrefixListResult added in v0.2.0

type ServicePrefixListResult struct {
	// The link to fetch the next page of peering service prefixes.
	NextLink *string

	// The list of peering service prefixes.
	Value []*ServicePrefix
}

ServicePrefixListResult - The paginated list of peering service prefixes.

func (ServicePrefixListResult) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ServicePrefixListResult.

func (*ServicePrefixListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrefixListResult.

type ServicePrefixProperties added in v0.2.0

type ServicePrefixProperties struct {
	// The peering service prefix key
	PeeringServicePrefixKey *string

	// The prefix from which your traffic originates.
	Prefix *string

	// READ-ONLY; The error message for validation state
	ErrorMessage *string

	// READ-ONLY; The list of events for peering service prefix
	Events []*ServicePrefixEvent

	// READ-ONLY; The prefix learned type
	LearnedType *LearnedType

	// READ-ONLY; The prefix validation state
	PrefixValidationState *PrefixValidationState

	// READ-ONLY; The provisioning state of the resource.
	ProvisioningState *ProvisioningState
}

ServicePrefixProperties - The peering service prefix properties class.

func (ServicePrefixProperties) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ServicePrefixProperties.

func (*ServicePrefixProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrefixProperties.

type ServiceProperties added in v0.2.0

type ServiceProperties struct {
	// The Log Analytics Workspace Properties
	LogAnalyticsWorkspaceProperties *LogAnalyticsWorkspaceProperties

	// The location (state/province) of the customer.
	PeeringServiceLocation *string

	// The name of the service provider.
	PeeringServiceProvider *string

	// The backup peering (Microsoft/service provider) location to be used for customer traffic.
	ProviderBackupPeeringLocation *string

	// The primary peering (Microsoft/service provider) location to be used for customer traffic.
	ProviderPrimaryPeeringLocation *string

	// READ-ONLY; The provisioning state of the resource.
	ProvisioningState *ProvisioningState
}

ServiceProperties - The properties that define connectivity to the Peering Service.

func (ServiceProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceProperties.

func (*ServiceProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProperties.

type ServiceProvider added in v0.2.0

type ServiceProvider struct {
	// The properties that define a peering service provider.
	Properties *ServiceProviderProperties

	// READ-ONLY; The ID of the resource.
	ID *string

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

	// READ-ONLY; The type of the resource.
	Type *string
}

ServiceProvider - PeeringService provider

func (ServiceProvider) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceProvider.

func (*ServiceProvider) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProvider.

type ServiceProviderListResult added in v0.2.0

type ServiceProviderListResult struct {
	// The link to fetch the next page of peering service providers.
	NextLink *string

	// The list of peering service providers.
	Value []*ServiceProvider
}

ServiceProviderListResult - The paginated list of peering service providers.

func (ServiceProviderListResult) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceProviderListResult.

func (*ServiceProviderListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProviderListResult.

type ServiceProviderProperties added in v0.2.0

type ServiceProviderProperties struct {
	// The list of locations at which the service provider peers with Microsoft.
	PeeringLocations []*string

	// The name of the service provider.
	ServiceProviderName *string
}

ServiceProviderProperties - The properties that define connectivity to the Peering Service Provider.

func (ServiceProviderProperties) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceProviderProperties.

func (*ServiceProviderProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProviderProperties.

type ServiceProvidersClient added in v0.2.0

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

ServiceProvidersClient contains the methods for the PeeringServiceProviders group. Don't use this type directly, use NewServiceProvidersClient() instead.

func NewServiceProvidersClient added in v0.2.0

func NewServiceProvidersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceProvidersClient, error)

NewServiceProvidersClient creates a new instance of ServiceProvidersClient with the specified values.

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

func (*ServiceProvidersClient) NewListPager added in v0.5.0

NewListPager - Lists all of the available peering service locations for the specified kind of peering.

Generated from API version 2022-01-01

  • options - ServiceProvidersClientListOptions contains the optional parameters for the ServiceProvidersClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringServiceProviders.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServiceProvidersClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ServiceProviderListResult = armpeering.ServiceProviderListResult{
		// 	Value: []*armpeering.ServiceProvider{
		// 		{
		// 			Name: to.Ptr("peeringServiceProvider1"),
		// 			Type: to.Ptr("Microsoft.Peering/peeringServiceProviders"),
		// 			ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peeringServiceProviders/peeringServiceProvider1"),
		// 			Properties: &armpeering.ServiceProviderProperties{
		// 				PeeringLocations: []*string{
		// 					to.Ptr("peeringLocation1"),
		// 					to.Ptr("peeringLocation2")},
		// 					ServiceProviderName: to.Ptr("peeringServiceProvider1"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("peeringServiceProvider2"),
		// 				Type: to.Ptr("Microsoft.Peering/peeringServiceProviders"),
		// 				ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Peering/peeringServiceProviders/peeringServiceProvider2"),
		// 				Properties: &armpeering.ServiceProviderProperties{
		// 					PeeringLocations: []*string{
		// 						to.Ptr("peeringLocation1"),
		// 						to.Ptr("peeringLocation2")},
		// 						ServiceProviderName: to.Ptr("peeringServiceProvider2"),
		// 					},
		// 			}},
		// 		}
	}
}
Output:

type ServiceProvidersClientListOptions added in v0.2.0

type ServiceProvidersClientListOptions struct {
}

ServiceProvidersClientListOptions contains the optional parameters for the ServiceProvidersClient.NewListPager method.

type ServiceProvidersClientListResponse added in v0.2.0

type ServiceProvidersClientListResponse struct {
	// The paginated list of peering service providers.
	ServiceProviderListResult
}

ServiceProvidersClientListResponse contains the response from method ServiceProvidersClient.NewListPager.

type ServiceSKU added in v0.3.0

type ServiceSKU struct {
	// The name of the peering service SKU.
	Name *string
}

ServiceSKU - The SKU that defines the type of the peering service.

func (ServiceSKU) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceSKU.

func (*ServiceSKU) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSKU.

type ServiceSpecification added in v0.3.0

type ServiceSpecification struct {
	// READ-ONLY; Specifications of the Metrics for Azure Monitoring.
	MetricSpecifications []*MetricSpecification
}

ServiceSpecification - Service specification payload.

func (ServiceSpecification) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceSpecification.

func (*ServiceSpecification) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSpecification.

type ServicesClient added in v0.2.0

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

ServicesClient contains the methods for the PeeringServices group. Don't use this type directly, use NewServicesClient() instead.

func NewServicesClient added in v0.2.0

func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServicesClient, error)

NewServicesClient creates a new instance of ServicesClient with the specified values.

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

func (*ServicesClient) CreateOrUpdate added in v0.2.0

func (client *ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringServiceName string, peeringService Service, options *ServicesClientCreateOrUpdateOptions) (ServicesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates a new peering service or updates an existing peering with the specified name under the given subscription and resource group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringServiceName - The name of the peering service.
  • peeringService - The properties needed to create or update a peering service.
  • options - ServicesClientCreateOrUpdateOptions contains the optional parameters for the ServicesClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/CreatePeeringService.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/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServicesClient().CreateOrUpdate(ctx, "rgName", "peeringServiceName", armpeering.Service{
		Location: to.Ptr("eastus"),
		Properties: &armpeering.ServiceProperties{
			PeeringServiceLocation:         to.Ptr("state1"),
			PeeringServiceProvider:         to.Ptr("serviceProvider1"),
			ProviderBackupPeeringLocation:  to.Ptr("peeringLocation2"),
			ProviderPrimaryPeeringLocation: to.Ptr("peeringLocation1"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Service = armpeering.Service{
	// 	Name: to.Ptr("peeringServiceName"),
	// 	Type: to.Ptr("Microsoft.Peering/peeringServices"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peeringServices/peeringServiceName"),
	// 	Location: to.Ptr("eastus"),
	// 	Properties: &armpeering.ServiceProperties{
	// 		PeeringServiceLocation: to.Ptr("state1"),
	// 		PeeringServiceProvider: to.Ptr("serviceProvider1"),
	// 		ProviderBackupPeeringLocation: to.Ptr("peeringLocation2"),
	// 		ProviderPrimaryPeeringLocation: to.Ptr("peeringLocation1"),
	// 		ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*ServicesClient) Delete added in v0.2.0

func (client *ServicesClient) Delete(ctx context.Context, resourceGroupName string, peeringServiceName string, options *ServicesClientDeleteOptions) (ServicesClientDeleteResponse, error)

Delete - Deletes an existing peering service with the specified name under the given subscription and resource group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringServiceName - The name of the peering service.
  • options - ServicesClientDeleteOptions contains the optional parameters for the ServicesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/DeletePeeringService.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewServicesClient().Delete(ctx, "rgName", "peeringServiceName", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ServicesClient) Get added in v0.2.0

func (client *ServicesClient) Get(ctx context.Context, resourceGroupName string, peeringServiceName string, options *ServicesClientGetOptions) (ServicesClientGetResponse, error)

Get - Gets an existing peering service with the specified name under the given subscription and resource group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringServiceName - The name of the peering.
  • options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/GetPeeringService.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServicesClient().Get(ctx, "rgName", "peeringServiceName", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Service = armpeering.Service{
	// 	Name: to.Ptr("peeringServiceName"),
	// 	Type: to.Ptr("Microsoft.Peering/peeringServices"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peeringServices/peeringServiceName"),
	// 	Location: to.Ptr("eastus"),
	// 	Properties: &armpeering.ServiceProperties{
	// 		LogAnalyticsWorkspaceProperties: &armpeering.LogAnalyticsWorkspaceProperties{
	// 			ConnectedAgents: []*string{
	// 				to.Ptr("Agent1"),
	// 				to.Ptr("Agent2")},
	// 				Key: to.Ptr("key"),
	// 				WorkspaceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			},
	// 			PeeringServiceLocation: to.Ptr("state1"),
	// 			PeeringServiceProvider: to.Ptr("serviceProvider1"),
	// 			ProviderBackupPeeringLocation: to.Ptr("peeringLocation2"),
	// 			ProviderPrimaryPeeringLocation: to.Ptr("peeringLocation1"),
	// 			ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 		},
	// 	}
}
Output:

func (*ServicesClient) InitializeConnectionMonitor added in v0.3.0

InitializeConnectionMonitor - Initialize Peering Service for Connection Monitor functionality If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • options - ServicesClientInitializeConnectionMonitorOptions contains the optional parameters for the ServicesClient.InitializeConnectionMonitor method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/InitializeConnectionMonitor.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

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

func (*ServicesClient) NewListByResourceGroupPager added in v0.5.0

func (client *ServicesClient) NewListByResourceGroupPager(resourceGroupName string, options *ServicesClientListByResourceGroupOptions) *runtime.Pager[ServicesClientListByResourceGroupResponse]

NewListByResourceGroupPager - Lists all of the peering services under the given subscription and resource group.

Generated from API version 2022-01-01

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringServicesByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServicesClient().NewListByResourceGroupPager("rgName", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ServiceListResult = armpeering.ServiceListResult{
		// 	Value: []*armpeering.Service{
		// 		{
		// 			Name: to.Ptr("peeringServiceName"),
		// 			Type: to.Ptr("Microsoft.Peering/peeringServices"),
		// 			ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peeringServices/peeringServiceName"),
		// 			Location: to.Ptr("eastus"),
		// 			Properties: &armpeering.ServiceProperties{
		// 				LogAnalyticsWorkspaceProperties: &armpeering.LogAnalyticsWorkspaceProperties{
		// 					ConnectedAgents: []*string{
		// 						to.Ptr("Agent1"),
		// 						to.Ptr("Agent2")},
		// 						Key: to.Ptr("key"),
		// 						WorkspaceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					},
		// 					PeeringServiceLocation: to.Ptr("state1"),
		// 					PeeringServiceProvider: to.Ptr("serviceProvider1"),
		// 					ProviderBackupPeeringLocation: to.Ptr("peeringLocation2"),
		// 					ProviderPrimaryPeeringLocation: to.Ptr("peeringLocation1"),
		// 					ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
		// 				},
		// 		}},
		// 	}
	}
}
Output:

func (*ServicesClient) NewListBySubscriptionPager added in v0.5.0

NewListBySubscriptionPager - Lists all of the peerings under the given subscription.

Generated from API version 2022-01-01

  • options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/ListPeeringServicesBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServicesClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ServiceListResult = armpeering.ServiceListResult{
		// 	Value: []*armpeering.Service{
		// 		{
		// 			Name: to.Ptr("peeringServiceName"),
		// 			Type: to.Ptr("Microsoft.Peering/peeringServices"),
		// 			ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peeringServices/peeringServiceName"),
		// 			Location: to.Ptr("eastus"),
		// 			Properties: &armpeering.ServiceProperties{
		// 				LogAnalyticsWorkspaceProperties: &armpeering.LogAnalyticsWorkspaceProperties{
		// 					ConnectedAgents: []*string{
		// 						to.Ptr("Agent1"),
		// 						to.Ptr("Agent2")},
		// 						Key: to.Ptr("key"),
		// 						WorkspaceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					},
		// 					PeeringServiceLocation: to.Ptr("state1"),
		// 					PeeringServiceProvider: to.Ptr("serviceProvider1"),
		// 					ProviderBackupPeeringLocation: to.Ptr("peeringLocation2"),
		// 					ProviderPrimaryPeeringLocation: to.Ptr("peeringLocation1"),
		// 					ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
		// 				},
		// 		}},
		// 	}
	}
}
Output:

func (*ServicesClient) Update added in v0.2.0

func (client *ServicesClient) Update(ctx context.Context, resourceGroupName string, peeringServiceName string, tags ResourceTags, options *ServicesClientUpdateOptions) (ServicesClientUpdateResponse, error)

Update - Updates tags for a peering service with the specified name under the given subscription and resource group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-01-01

  • resourceGroupName - The name of the resource group.
  • peeringServiceName - The name of the peering service.
  • tags - The resource tags.
  • options - ServicesClientUpdateOptions contains the optional parameters for the ServicesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/peering/resource-manager/Microsoft.Peering/stable/2022-01-01/examples/UpdatePeeringServiceTags.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/peering/armpeering"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpeering.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServicesClient().Update(ctx, "rgName", "peeringServiceName", armpeering.ResourceTags{
		Tags: map[string]*string{
			"tag0": to.Ptr("value0"),
			"tag1": to.Ptr("value1"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Service = armpeering.Service{
	// 	Name: to.Ptr("peeringServiceName"),
	// 	Type: to.Ptr("Microsoft.Peering/peeringServices"),
	// 	ID: to.Ptr("/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.Peering/peeringServices/peeringServiceName"),
	// 	Location: to.Ptr("eastus"),
	// 	Properties: &armpeering.ServiceProperties{
	// 		LogAnalyticsWorkspaceProperties: &armpeering.LogAnalyticsWorkspaceProperties{
	// 			ConnectedAgents: []*string{
	// 				to.Ptr("Agent1"),
	// 				to.Ptr("Agent2")},
	// 				Key: to.Ptr("key"),
	// 				WorkspaceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			},
	// 			PeeringServiceLocation: to.Ptr("state1"),
	// 			PeeringServiceProvider: to.Ptr("serviceProvider1"),
	// 			ProviderBackupPeeringLocation: to.Ptr("peeringLocation2"),
	// 			ProviderPrimaryPeeringLocation: to.Ptr("peeringLocation1"),
	// 			ProvisioningState: to.Ptr(armpeering.ProvisioningStateSucceeded),
	// 		},
	// 		Tags: map[string]*string{
	// 			"tag0": to.Ptr("value0"),
	// 			"tag1": to.Ptr("value1"),
	// 		},
	// 	}
}
Output:

type ServicesClientCreateOrUpdateOptions added in v0.2.0

type ServicesClientCreateOrUpdateOptions struct {
}

ServicesClientCreateOrUpdateOptions contains the optional parameters for the ServicesClient.CreateOrUpdate method.

type ServicesClientCreateOrUpdateResponse added in v0.2.0

type ServicesClientCreateOrUpdateResponse struct {
	// Peering Service
	Service
}

ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.CreateOrUpdate.

type ServicesClientDeleteOptions added in v0.2.0

type ServicesClientDeleteOptions struct {
}

ServicesClientDeleteOptions contains the optional parameters for the ServicesClient.Delete method.

type ServicesClientDeleteResponse added in v0.2.0

type ServicesClientDeleteResponse struct {
}

ServicesClientDeleteResponse contains the response from method ServicesClient.Delete.

type ServicesClientGetOptions added in v0.2.0

type ServicesClientGetOptions struct {
}

ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method.

type ServicesClientGetResponse added in v0.2.0

type ServicesClientGetResponse struct {
	// Peering Service
	Service
}

ServicesClientGetResponse contains the response from method ServicesClient.Get.

type ServicesClientInitializeConnectionMonitorOptions added in v0.3.0

type ServicesClientInitializeConnectionMonitorOptions struct {
}

ServicesClientInitializeConnectionMonitorOptions contains the optional parameters for the ServicesClient.InitializeConnectionMonitor method.

type ServicesClientInitializeConnectionMonitorResponse added in v0.3.0

type ServicesClientInitializeConnectionMonitorResponse struct {
}

ServicesClientInitializeConnectionMonitorResponse contains the response from method ServicesClient.InitializeConnectionMonitor.

type ServicesClientListByResourceGroupOptions added in v0.2.0

type ServicesClientListByResourceGroupOptions struct {
}

ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager method.

type ServicesClientListByResourceGroupResponse added in v0.2.0

type ServicesClientListByResourceGroupResponse struct {
	// The paginated list of peering services.
	ServiceListResult
}

ServicesClientListByResourceGroupResponse contains the response from method ServicesClient.NewListByResourceGroupPager.

type ServicesClientListBySubscriptionOptions added in v0.2.0

type ServicesClientListBySubscriptionOptions struct {
}

ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager method.

type ServicesClientListBySubscriptionResponse added in v0.2.0

type ServicesClientListBySubscriptionResponse struct {
	// The paginated list of peering services.
	ServiceListResult
}

ServicesClientListBySubscriptionResponse contains the response from method ServicesClient.NewListBySubscriptionPager.

type ServicesClientUpdateOptions added in v0.2.0

type ServicesClientUpdateOptions struct {
}

ServicesClientUpdateOptions contains the optional parameters for the ServicesClient.Update method.

type ServicesClientUpdateResponse added in v0.2.0

type ServicesClientUpdateResponse struct {
	// Peering Service
	Service
}

ServicesClientUpdateResponse contains the response from method ServicesClient.Update.

type SessionAddressProvider

type SessionAddressProvider string

SessionAddressProvider - The field indicating if Microsoft provides session ip addresses.

const (
	SessionAddressProviderMicrosoft SessionAddressProvider = "Microsoft"
	SessionAddressProviderPeer      SessionAddressProvider = "Peer"
)

func PossibleSessionAddressProviderValues

func PossibleSessionAddressProviderValues() []SessionAddressProvider

PossibleSessionAddressProviderValues returns the possible values for the SessionAddressProvider const type.

type SessionStateV4

type SessionStateV4 string

SessionStateV4 - The state of the IPv4 session.

const (
	SessionStateV4Active        SessionStateV4 = "Active"
	SessionStateV4Connect       SessionStateV4 = "Connect"
	SessionStateV4Established   SessionStateV4 = "Established"
	SessionStateV4Idle          SessionStateV4 = "Idle"
	SessionStateV4None          SessionStateV4 = "None"
	SessionStateV4OpenConfirm   SessionStateV4 = "OpenConfirm"
	SessionStateV4OpenReceived  SessionStateV4 = "OpenReceived"
	SessionStateV4OpenSent      SessionStateV4 = "OpenSent"
	SessionStateV4PendingAdd    SessionStateV4 = "PendingAdd"
	SessionStateV4PendingRemove SessionStateV4 = "PendingRemove"
	SessionStateV4PendingUpdate SessionStateV4 = "PendingUpdate"
)

func PossibleSessionStateV4Values

func PossibleSessionStateV4Values() []SessionStateV4

PossibleSessionStateV4Values returns the possible values for the SessionStateV4 const type.

type SessionStateV6

type SessionStateV6 string

SessionStateV6 - The state of the IPv6 session.

const (
	SessionStateV6Active        SessionStateV6 = "Active"
	SessionStateV6Connect       SessionStateV6 = "Connect"
	SessionStateV6Established   SessionStateV6 = "Established"
	SessionStateV6Idle          SessionStateV6 = "Idle"
	SessionStateV6None          SessionStateV6 = "None"
	SessionStateV6OpenConfirm   SessionStateV6 = "OpenConfirm"
	SessionStateV6OpenReceived  SessionStateV6 = "OpenReceived"
	SessionStateV6OpenSent      SessionStateV6 = "OpenSent"
	SessionStateV6PendingAdd    SessionStateV6 = "PendingAdd"
	SessionStateV6PendingRemove SessionStateV6 = "PendingRemove"
	SessionStateV6PendingUpdate SessionStateV6 = "PendingUpdate"
)

func PossibleSessionStateV6Values

func PossibleSessionStateV6Values() []SessionStateV6

PossibleSessionStateV6Values returns the possible values for the SessionStateV6 const type.

type Size

type Size string

Size - The size of the peering SKU.

const (
	SizeFree      Size = "Free"
	SizeMetered   Size = "Metered"
	SizeUnlimited Size = "Unlimited"
)

func PossibleSizeValues

func PossibleSizeValues() []Size

PossibleSizeValues returns the possible values for the Size const type.

type SubResource

type SubResource struct {
	// The identifier of the referenced resource.
	ID *string
}

SubResource - The sub resource.

func (SubResource) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SubResource.

func (*SubResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubResource.

type Tier

type Tier string

Tier - The tier of the peering SKU.

const (
	TierBasic   Tier = "Basic"
	TierPremium Tier = "Premium"
)

func PossibleTierValues

func PossibleTierValues() []Tier

PossibleTierValues returns the possible values for the Tier const type.

type ValidationState

type ValidationState string

ValidationState - The validation state of the ASN associated with the peer.

const (
	ValidationStateApproved ValidationState = "Approved"
	ValidationStateFailed   ValidationState = "Failed"
	ValidationStateNone     ValidationState = "None"
	ValidationStatePending  ValidationState = "Pending"
)

func PossibleValidationStateValues

func PossibleValidationStateValues() []ValidationState

PossibleValidationStateValues returns the possible values for the ValidationState const type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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