armpeering

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: MIT Imports: 12 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

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.

Clients

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

client := armpeering.NewPeeringLocationsClient(<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{
    Host: arm.AzureChina,
}
client := armpeering.NewPeeringLocationsClient(<subscription ID>, cred, &options)

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 `json:"offerName,omitempty"`

	// The value of the bandwidth offer in Mbps.
	ValueInMbps *int32 `json:"valueInMbps,omitempty"`
}

BandwidthOffer - The properties that define a peering bandwidth offer.

type BgpSession

type BgpSession struct {
	// The MD5 authentication key of the session.
	MD5AuthenticationKey *string `json:"md5AuthenticationKey,omitempty"`

	// The maximum number of prefixes advertised over the IPv4 session.
	MaxPrefixesAdvertisedV4 *int32 `json:"maxPrefixesAdvertisedV4,omitempty"`

	// The maximum number of prefixes advertised over the IPv6 session.
	MaxPrefixesAdvertisedV6 *int32 `json:"maxPrefixesAdvertisedV6,omitempty"`

	// The IPv4 session address on peer's end.
	PeerSessionIPv4Address *string `json:"peerSessionIPv4Address,omitempty"`

	// The IPv6 session address on peer's end.
	PeerSessionIPv6Address *string `json:"peerSessionIPv6Address,omitempty"`

	// The IPv4 prefix that contains both ends' IPv4 addresses.
	SessionPrefixV4 *string `json:"sessionPrefixV4,omitempty"`

	// The IPv6 prefix that contains both ends' IPv6 addresses.
	SessionPrefixV6 *string `json:"sessionPrefixV6,omitempty"`

	// READ-ONLY; The IPv4 session address on Microsoft's end.
	MicrosoftSessionIPv4Address *string `json:"microsoftSessionIPv4Address,omitempty" azure:"ro"`

	// READ-ONLY; The IPv6 session address on Microsoft's end.
	MicrosoftSessionIPv6Address *string `json:"microsoftSessionIPv6Address,omitempty" azure:"ro"`

	// READ-ONLY; The state of the IPv4 session.
	SessionStateV4 *SessionStateV4 `json:"sessionStateV4,omitempty" azure:"ro"`

	// READ-ONLY; The state of the IPv6 session.
	SessionStateV6 *SessionStateV6 `json:"sessionStateV6,omitempty" azure:"ro"`
}

BgpSession - The properties that define a BGP session.

type CheckServiceProviderAvailabilityInput

type CheckServiceProviderAvailabilityInput struct {
	// Gets or sets the PeeringServiceLocation
	PeeringServiceLocation *string `json:"peeringServiceLocation,omitempty"`

	// Gets or sets the PeeringServiceProvider
	PeeringServiceProvider *string `json:"peeringServiceProvider,omitempty"`
}

CheckServiceProviderAvailabilityInput - Class for CheckServiceProviderAvailabilityInput

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.

func (ConnectionState) ToPtr

func (c ConnectionState) ToPtr() *ConnectionState

ToPtr returns a *ConnectionState pointing to the current value.

type ContactInfo

type ContactInfo struct {
	// The list of email addresses.
	Emails []*string `json:"emails,omitempty"`

	// The list of contact numbers.
	Phone []*string `json:"phone,omitempty"`
}

ContactInfo - The contact information of the peer.

func (ContactInfo) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ContactInfo.

type DirectConnection

type DirectConnection struct {
	// The bandwidth of the connection.
	BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"`

	// The BGP session associated with the connection.
	BgpSession *BgpSession `json:"bgpSession,omitempty"`

	// The unique identifier (GUID) for the connection.
	ConnectionIdentifier *string `json:"connectionIdentifier,omitempty"`

	// The PeeringDB.com ID of the facility at which the connection has to be set up.
	PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"`

	// The bandwidth that is actually provisioned.
	ProvisionedBandwidthInMbps *int32 `json:"provisionedBandwidthInMbps,omitempty"`

	// The field indicating if Microsoft provides session ip addresses.
	SessionAddressProvider *SessionAddressProvider `json:"sessionAddressProvider,omitempty"`

	// The flag that indicates whether or not the connection is used for peering service.
	UseForPeeringService *bool `json:"useForPeeringService,omitempty"`

	// READ-ONLY; The state of the connection.
	ConnectionState *ConnectionState `json:"connectionState,omitempty" azure:"ro"`
}

DirectConnection - The properties that define a direct connection.

type DirectPeeringFacility

type DirectPeeringFacility struct {
	// The address of the direct peering facility.
	Address *string `json:"address,omitempty"`

	// The type of the direct peering.
	DirectPeeringType *DirectPeeringType `json:"directPeeringType,omitempty"`

	// The PeeringDB.com ID of the facility.
	PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"`

	// The PeeringDB.com URL of the facility.
	PeeringDBFacilityLink *string `json:"peeringDBFacilityLink,omitempty"`
}

DirectPeeringFacility - The properties that define a direct peering facility.

type DirectPeeringType

type DirectPeeringType string

DirectPeeringType - The type of direct peering.

const (
	DirectPeeringTypeCdn      DirectPeeringType = "Cdn"
	DirectPeeringTypeEdge     DirectPeeringType = "Edge"
	DirectPeeringTypeInternal DirectPeeringType = "Internal"
	DirectPeeringTypeTransit  DirectPeeringType = "Transit"
)

func PossibleDirectPeeringTypeValues

func PossibleDirectPeeringTypeValues() []DirectPeeringType

PossibleDirectPeeringTypeValues returns the possible values for the DirectPeeringType const type.

func (DirectPeeringType) ToPtr

ToPtr returns a *DirectPeeringType pointing to the current value.

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.

func (Enum0) ToPtr

func (c Enum0) ToPtr() *Enum0

ToPtr returns a *Enum0 pointing to the current value.

type Enum1

type Enum1 string
const (
	Enum1Direct   Enum1 = "Direct"
	Enum1Exchange Enum1 = "Exchange"
)

func PossibleEnum1Values

func PossibleEnum1Values() []Enum1

PossibleEnum1Values returns the possible values for the Enum1 const type.

func (Enum1) ToPtr

func (c Enum1) ToPtr() *Enum1

ToPtr returns a *Enum1 pointing to the current value.

type Enum14

type Enum14 string
const (
	Enum14Direct   Enum14 = "Direct"
	Enum14Exchange Enum14 = "Exchange"
)

func PossibleEnum14Values

func PossibleEnum14Values() []Enum14

PossibleEnum14Values returns the possible values for the Enum14 const type.

func (Enum14) ToPtr

func (c Enum14) ToPtr() *Enum14

ToPtr returns a *Enum14 pointing to the current value.

type Enum15

type Enum15 string
const (
	Enum15Cdn      Enum15 = "Cdn"
	Enum15Edge     Enum15 = "Edge"
	Enum15Internal Enum15 = "Internal"
	Enum15Transit  Enum15 = "Transit"
)

func PossibleEnum15Values

func PossibleEnum15Values() []Enum15

PossibleEnum15Values returns the possible values for the Enum15 const type.

func (Enum15) ToPtr

func (c Enum15) ToPtr() *Enum15

ToPtr returns a *Enum15 pointing to the current value.

type ErrorResponse

type ErrorResponse struct {
	// READ-ONLY; The error code.
	Code *string `json:"code,omitempty" azure:"ro"`

	// READ-ONLY; The error message.
	Message *string `json:"message,omitempty" azure:"ro"`
}

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

type ExchangeConnection

type ExchangeConnection struct {
	// The BGP session associated with the connection.
	BgpSession *BgpSession `json:"bgpSession,omitempty"`

	// The unique identifier (GUID) for the connection.
	ConnectionIdentifier *string `json:"connectionIdentifier,omitempty"`

	// The PeeringDB.com ID of the facility at which the connection has to be set up.
	PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"`

	// READ-ONLY; The state of the connection.
	ConnectionState *ConnectionState `json:"connectionState,omitempty" azure:"ro"`
}

ExchangeConnection - The properties that define an exchange connection.

type ExchangePeeringFacility

type ExchangePeeringFacility struct {
	// The bandwidth of the connection between Microsoft and the exchange peering facility.
	BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"`

	// The name of the exchange peering facility.
	ExchangeName *string `json:"exchangeName,omitempty"`

	// The IPv4 prefixes associated with the exchange peering facility.
	FacilityIPv4Prefix *string `json:"facilityIPv4Prefix,omitempty"`

	// The IPv6 prefixes associated with the exchange peering facility.
	FacilityIPv6Prefix *string `json:"facilityIPv6Prefix,omitempty"`

	// The IPv4 address of Microsoft at the exchange peering facility.
	MicrosoftIPv4Address *string `json:"microsoftIPv4Address,omitempty"`

	// The IPv6 address of Microsoft at the exchange peering facility.
	MicrosoftIPv6Address *string `json:"microsoftIPv6Address,omitempty"`

	// The PeeringDB.com ID of the facility.
	PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"`

	// The PeeringDB.com URL of the facility.
	PeeringDBFacilityLink *string `json:"peeringDBFacilityLink,omitempty"`
}

ExchangePeeringFacility - The properties that define an exchange peering facility.

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.

func (Family) ToPtr

func (c Family) ToPtr() *Family

ToPtr returns a *Family pointing to the current value.

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.

func (Kind) ToPtr

func (c Kind) ToPtr() *Kind

ToPtr returns a *Kind pointing to the current value.

type LearnedType

type LearnedType string

LearnedType - The prefix learned type

const (
	LearnedTypeNone       LearnedType = "None"
	LearnedTypeViaPartner LearnedType = "ViaPartner"
	LearnedTypeViaSession LearnedType = "ViaSession"
)

func PossibleLearnedTypeValues

func PossibleLearnedTypeValues() []LearnedType

PossibleLearnedTypeValues returns the possible values for the LearnedType const type.

func (LearnedType) ToPtr

func (c LearnedType) ToPtr() *LearnedType

ToPtr returns a *LearnedType pointing to the current value.

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

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) List

List - Lists all of the legacy peerings under the given subscription matching the specified kind and location. If the operation fails it returns an *azcore.ResponseError type. peeringLocation - The location of the peering. kind - The kind of the peering. options - LegacyPeeringsClientListOptions contains the optional parameters for the LegacyPeeringsClient.List method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewLegacyPeeringsClient("<subscription-id>", cred, nil)
	pager := client.List("<peering-location>",
		armpeering.Enum1("Exchange"),
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type LegacyPeeringsClientListOptions added in v0.2.0

type LegacyPeeringsClientListOptions struct {
}

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

type LegacyPeeringsClientListPager added in v0.2.0

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

LegacyPeeringsClientListPager provides operations for iterating over paged responses.

func (*LegacyPeeringsClientListPager) Err added in v0.2.0

Err returns the last error encountered while paging.

func (*LegacyPeeringsClientListPager) NextPage added in v0.2.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LegacyPeeringsClientListPager) PageResponse added in v0.2.0

PageResponse returns the current LegacyPeeringsClientListResponse page.

type LegacyPeeringsClientListResponse added in v0.2.0

type LegacyPeeringsClientListResponse struct {
	LegacyPeeringsClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LegacyPeeringsClientListResponse contains the response from method LegacyPeeringsClient.List.

type LegacyPeeringsClientListResult added in v0.2.0

type LegacyPeeringsClientListResult struct {
	ListResult
}

LegacyPeeringsClientListResult contains the result from method LegacyPeeringsClient.List.

type ListResult added in v0.2.0

type ListResult struct {
	// The link to fetch the next page of peerings.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of peerings.
	Value []*Peering `json:"value,omitempty"`
}

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.

type Location added in v0.2.0

type Location struct {
	// The kind of peering that the peering location supports.
	Kind *Kind `json:"kind,omitempty"`

	// The properties that define a peering location.
	Properties *LocationProperties `json:"properties,omitempty"`

	// READ-ONLY; The ID of the resource.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource.
	Type *string `json:"type,omitempty" azure:"ro"`
}

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

type LocationListResult added in v0.2.0

type LocationListResult struct {
	// The link to fetch the next page of peering locations.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of peering locations.
	Value []*Location `json:"value,omitempty"`
}

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.

type LocationProperties added in v0.2.0

type LocationProperties struct {
	// The Azure region associated with the peering location.
	AzureRegion *string `json:"azureRegion,omitempty"`

	// The country in which the peering location exists.
	Country *string `json:"country,omitempty"`

	// The properties that define a direct peering location.
	Direct *LocationPropertiesDirect `json:"direct,omitempty"`

	// The properties that define an exchange peering location.
	Exchange *LocationPropertiesExchange `json:"exchange,omitempty"`

	// The name of the peering location.
	PeeringLocation *string `json:"peeringLocation,omitempty"`
}

LocationProperties - The properties that define a peering location.

type LocationPropertiesDirect added in v0.2.0

type LocationPropertiesDirect struct {
	// The list of bandwidth offers available at the peering location.
	BandwidthOffers []*BandwidthOffer `json:"bandwidthOffers,omitempty"`

	// The list of direct peering facilities at the peering location.
	PeeringFacilities []*DirectPeeringFacility `json:"peeringFacilities,omitempty"`
}

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.

type LocationPropertiesExchange added in v0.2.0

type LocationPropertiesExchange struct {
	// The list of exchange peering facilities at the peering location.
	PeeringFacilities []*ExchangePeeringFacility `json:"peeringFacilities,omitempty"`
}

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.

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

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) List added in v0.2.0

List - Lists all of the available peering locations for the specified kind of peering. If the operation fails it returns an *azcore.ResponseError type. kind - The kind of the peering. options - LocationsClientListOptions contains the optional parameters for the LocationsClient.List method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewLocationsClient("<subscription-id>", cred, nil)
	pager := client.List(armpeering.Enum14("Direct"),
		&armpeering.LocationsClientListOptions{DirectPeeringType: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type LocationsClientListOptions added in v0.2.0

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

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

type LocationsClientListPager added in v0.2.0

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

LocationsClientListPager provides operations for iterating over paged responses.

func (*LocationsClientListPager) Err added in v0.2.0

Err returns the last error encountered while paging.

func (*LocationsClientListPager) NextPage added in v0.2.0

func (p *LocationsClientListPager) NextPage(ctx context.Context) bool

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LocationsClientListPager) PageResponse added in v0.2.0

PageResponse returns the current LocationsClientListResponse page.

type LocationsClientListResponse added in v0.2.0

type LocationsClientListResponse struct {
	LocationsClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LocationsClientListResponse contains the response from method LocationsClient.List.

type LocationsClientListResult added in v0.2.0

type LocationsClientListResult struct {
	LocationListResult
}

LocationsClientListResult contains the result from method LocationsClient.List.

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

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. checkServiceProviderAvailabilityInput - The CheckServiceProviderAvailabilityInput indicating customer location and service provider. options - ManagementClientCheckServiceProviderAvailabilityOptions contains the optional parameters for the ManagementClient.CheckServiceProviderAvailability method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewManagementClient("<subscription-id>", cred, nil)
	res, err := client.CheckServiceProviderAvailability(ctx,
		armpeering.CheckServiceProviderAvailabilityInput{
			PeeringServiceLocation: to.StringPtr("<peering-service-location>"),
			PeeringServiceProvider: to.StringPtr("<peering-service-provider>"),
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagementClientCheckServiceProviderAvailabilityResult)
}
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 {
	ManagementClientCheckServiceProviderAvailabilityResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagementClientCheckServiceProviderAvailabilityResponse contains the response from method ManagementClient.CheckServiceProviderAvailability.

type ManagementClientCheckServiceProviderAvailabilityResult added in v0.2.0

type ManagementClientCheckServiceProviderAvailabilityResult struct {
	Value *Enum0
}

ManagementClientCheckServiceProviderAvailabilityResult contains the result from method ManagementClient.CheckServiceProviderAvailability.

type Name

type Name string

Name - The name of the peering SKU.

const (
	NameBasicDirectFree        Name = "Basic_Direct_Free"
	NameBasicExchangeFree      Name = "Basic_Exchange_Free"
	NamePremiumDirectFree      Name = "Premium_Direct_Free"
	NamePremiumDirectMetered   Name = "Premium_Direct_Metered"
	NamePremiumDirectUnlimited Name = "Premium_Direct_Unlimited"
	NamePremiumExchangeMetered Name = "Premium_Exchange_Metered"
)

func PossibleNameValues

func PossibleNameValues() []Name

PossibleNameValues returns the possible values for the Name const type.

func (Name) ToPtr

func (c Name) ToPtr() *Name

ToPtr returns a *Name pointing to the current value.

type Operation

type Operation struct {
	// READ-ONLY; The information related to the operation.
	Display *OperationDisplayInfo `json:"display,omitempty" azure:"ro"`

	// READ-ONLY; The flag that indicates whether the operation applies to data plane.
	IsDataAction *bool `json:"isDataAction,omitempty" azure:"ro"`

	// READ-ONLY; The name of the operation.
	Name *string `json:"name,omitempty" azure:"ro"`
}

Operation - The peering API operation.

type OperationDisplayInfo

type OperationDisplayInfo struct {
	// READ-ONLY; The description of the operation.
	Description *string `json:"description,omitempty" azure:"ro"`

	// READ-ONLY; The name of the operation.
	Operation *string `json:"operation,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource provider.
	Provider *string `json:"provider,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource.
	Resource *string `json:"resource,omitempty" azure:"ro"`
}

OperationDisplayInfo - The information related to the operation.

type OperationListResult

type OperationListResult struct {
	// The link to fetch the next page of peering API operations.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of peering API operations.
	Value []*Operation `json:"value,omitempty"`
}

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.

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

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) List

List - Lists all of the available API operations for peering resources. If the operation fails it returns an *azcore.ResponseError type. options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewOperationsClient(cred, nil)
	pager := client.List(nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListPager added in v0.2.0

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

OperationsClientListPager provides operations for iterating over paged responses.

func (*OperationsClientListPager) Err added in v0.2.0

Err returns the last error encountered while paging.

func (*OperationsClientListPager) NextPage added in v0.2.0

func (p *OperationsClientListPager) NextPage(ctx context.Context) bool

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*OperationsClientListPager) PageResponse added in v0.2.0

PageResponse returns the current OperationsClientListResponse page.

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	OperationsClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type OperationsClientListResult added in v0.2.0

type OperationsClientListResult struct {
	OperationListResult
}

OperationsClientListResult contains the result from method OperationsClient.List.

type PeerAsn

type PeerAsn struct {
	// The properties that define a peer's ASN.
	Properties *PeerAsnProperties `json:"properties,omitempty"`

	// READ-ONLY; The ID of the resource.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource.
	Type *string `json:"type,omitempty" azure:"ro"`
}

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

type PeerAsnListResult

type PeerAsnListResult struct {
	// The link to fetch the next page of peer ASNs.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of peer ASNs.
	Value []*PeerAsn `json:"value,omitempty"`
}

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.

type PeerAsnProperties

type PeerAsnProperties struct {
	// The Autonomous System Number (ASN) of the peer.
	PeerAsn *int32 `json:"peerAsn,omitempty"`

	// The contact information of the peer.
	PeerContactInfo *ContactInfo `json:"peerContactInfo,omitempty"`

	// The name of the peer.
	PeerName *string `json:"peerName,omitempty"`

	// The validation state of the ASN associated with the peer.
	ValidationState *ValidationState `json:"validationState,omitempty"`
}

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

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

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. peerAsnName - The peer ASN name. peerAsn - The peer ASN. options - PeerAsnsClientCreateOrUpdateOptions contains the optional parameters for the PeerAsnsClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewPeerAsnsClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<peer-asn-name>",
		armpeering.PeerAsn{
			Properties: &armpeering.PeerAsnProperties{
				PeerAsn: to.Int32Ptr(65000),
				PeerContactInfo: &armpeering.ContactInfo{
					Emails: []*string{
						to.StringPtr("abc@contoso.com"),
						to.StringPtr("xyz@contoso.com")},
					Phone: []*string{
						to.StringPtr("+1 (234) 567-8900")},
				},
				PeerName: to.StringPtr("<peer-name>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.PeerAsnsClientCreateOrUpdateResult)
}
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. peerAsnName - The peer ASN name. options - PeerAsnsClientDeleteOptions contains the optional parameters for the PeerAsnsClient.Delete method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewPeerAsnsClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<peer-asn-name>",
		nil)
	if err != nil {
		log.Fatal(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. peerAsnName - The peer ASN name. options - PeerAsnsClientGetOptions contains the optional parameters for the PeerAsnsClient.Get method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewPeerAsnsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<peer-asn-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.PeerAsnsClientGetResult)
}
Output:

func (*PeerAsnsClient) ListBySubscription

ListBySubscription - Lists all of the peer ASNs under the given subscription. If the operation fails it returns an *azcore.ResponseError type. options - PeerAsnsClientListBySubscriptionOptions contains the optional parameters for the PeerAsnsClient.ListBySubscription method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewPeerAsnsClient("<subscription-id>", cred, nil)
	pager := client.ListBySubscription(nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
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 {
	PeerAsnsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PeerAsnsClientCreateOrUpdateResponse contains the response from method PeerAsnsClient.CreateOrUpdate.

type PeerAsnsClientCreateOrUpdateResult added in v0.2.0

type PeerAsnsClientCreateOrUpdateResult struct {
	PeerAsn
}

PeerAsnsClientCreateOrUpdateResult contains the result 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 {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

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 {
	PeerAsnsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PeerAsnsClientGetResponse contains the response from method PeerAsnsClient.Get.

type PeerAsnsClientGetResult added in v0.2.0

type PeerAsnsClientGetResult struct {
	PeerAsn
}

PeerAsnsClientGetResult contains the result from method PeerAsnsClient.Get.

type PeerAsnsClientListBySubscriptionOptions added in v0.2.0

type PeerAsnsClientListBySubscriptionOptions struct {
}

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

type PeerAsnsClientListBySubscriptionPager added in v0.2.0

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

PeerAsnsClientListBySubscriptionPager provides operations for iterating over paged responses.

func (*PeerAsnsClientListBySubscriptionPager) Err added in v0.2.0

Err returns the last error encountered while paging.

func (*PeerAsnsClientListBySubscriptionPager) NextPage added in v0.2.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*PeerAsnsClientListBySubscriptionPager) PageResponse added in v0.2.0

PageResponse returns the current PeerAsnsClientListBySubscriptionResponse page.

type PeerAsnsClientListBySubscriptionResponse added in v0.2.0

type PeerAsnsClientListBySubscriptionResponse struct {
	PeerAsnsClientListBySubscriptionResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PeerAsnsClientListBySubscriptionResponse contains the response from method PeerAsnsClient.ListBySubscription.

type PeerAsnsClientListBySubscriptionResult added in v0.2.0

type PeerAsnsClientListBySubscriptionResult struct {
	PeerAsnListResult
}

PeerAsnsClientListBySubscriptionResult contains the result from method PeerAsnsClient.ListBySubscription.

type Peering

type Peering struct {
	// REQUIRED; The kind of the peering.
	Kind *Kind `json:"kind,omitempty"`

	// REQUIRED; The location of the resource.
	Location *string `json:"location,omitempty"`

	// REQUIRED; The SKU that defines the tier and kind of the peering.
	SKU *SKU `json:"sku,omitempty"`

	// The properties that define a peering.
	Properties *Properties `json:"properties,omitempty"`

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

	// READ-ONLY; The ID of the resource.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource.
	Type *string `json:"type,omitempty" azure:"ro"`
}

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.

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

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

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewPeeringsClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<peering-name>",
		armpeering.Peering{
			Kind:     armpeering.Kind("Direct").ToPtr(),
			Location: to.StringPtr("<location>"),
			Properties: &armpeering.Properties{
				Direct: &armpeering.PropertiesDirect{
					Connections: []*armpeering.DirectConnection{
						{
							BandwidthInMbps: to.Int32Ptr(10000),
							BgpSession: &armpeering.BgpSession{
								MaxPrefixesAdvertisedV4: to.Int32Ptr(1000),
								MaxPrefixesAdvertisedV6: to.Int32Ptr(100),
								MD5AuthenticationKey:    to.StringPtr("<md5authentication-key>"),
								SessionPrefixV4:         to.StringPtr("<session-prefix-v4>"),
								SessionPrefixV6:         to.StringPtr("<session-prefix-v6>"),
							},
							ConnectionIdentifier:   to.StringPtr("<connection-identifier>"),
							PeeringDBFacilityID:    to.Int32Ptr(99999),
							SessionAddressProvider: armpeering.SessionAddressProvider("Peer").ToPtr(),
							UseForPeeringService:   to.BoolPtr(false),
						},
						{
							BandwidthInMbps: to.Int32Ptr(10000),
							BgpSession: &armpeering.BgpSession{
								MaxPrefixesAdvertisedV4: to.Int32Ptr(1000),
								MaxPrefixesAdvertisedV6: to.Int32Ptr(100),
								MD5AuthenticationKey:    to.StringPtr("<md5authentication-key>"),
								SessionPrefixV4:         to.StringPtr("<session-prefix-v4>"),
								SessionPrefixV6:         to.StringPtr("<session-prefix-v6>"),
							},
							ConnectionIdentifier:   to.StringPtr("<connection-identifier>"),
							PeeringDBFacilityID:    to.Int32Ptr(99999),
							SessionAddressProvider: armpeering.SessionAddressProvider("Microsoft").ToPtr(),
							UseForPeeringService:   to.BoolPtr(true),
						}},
					DirectPeeringType: armpeering.DirectPeeringType("Edge").ToPtr(),
					PeerAsn: &armpeering.SubResource{
						ID: to.StringPtr("<id>"),
					},
					UseForPeeringService: to.BoolPtr(false),
				},
				PeeringLocation: to.StringPtr("<peering-location>"),
			},
			SKU: &armpeering.SKU{
				Name: armpeering.Name("Basic_Direct_Free").ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.PeeringsClientCreateOrUpdateResult)
}
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. 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

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewPeeringsClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<peering-name>",
		nil)
	if err != nil {
		log.Fatal(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. 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

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewPeeringsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<peering-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.PeeringsClientGetResult)
}
Output:

func (*PeeringsClient) ListByResourceGroup

func (client *PeeringsClient) ListByResourceGroup(resourceGroupName string, options *PeeringsClientListByResourceGroupOptions) *PeeringsClientListByResourceGroupPager

ListByResourceGroup - Lists all of the peerings under the given subscription and resource group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group. options - PeeringsClientListByResourceGroupOptions contains the optional parameters for the PeeringsClient.ListByResourceGroup method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewPeeringsClient("<subscription-id>", cred, nil)
	pager := client.ListByResourceGroup("<resource-group-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*PeeringsClient) ListBySubscription

ListBySubscription - Lists all of the peerings under the given subscription. If the operation fails it returns an *azcore.ResponseError type. options - PeeringsClientListBySubscriptionOptions contains the optional parameters for the PeeringsClient.ListBySubscription method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewPeeringsClient("<subscription-id>", cred, nil)
	pager := client.ListBySubscription(nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
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. 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

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewPeeringsClient("<subscription-id>", cred, nil)
	res, err := client.Update(ctx,
		"<resource-group-name>",
		"<peering-name>",
		armpeering.ResourceTags{
			Tags: map[string]*string{
				"tag0": to.StringPtr("value0"),
				"tag1": to.StringPtr("value1"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.PeeringsClientUpdateResult)
}
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 {
	PeeringsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PeeringsClientCreateOrUpdateResponse contains the response from method PeeringsClient.CreateOrUpdate.

type PeeringsClientCreateOrUpdateResult added in v0.2.0

type PeeringsClientCreateOrUpdateResult struct {
	Peering
}

PeeringsClientCreateOrUpdateResult contains the result 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 {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

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 {
	PeeringsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PeeringsClientGetResponse contains the response from method PeeringsClient.Get.

type PeeringsClientGetResult added in v0.2.0

type PeeringsClientGetResult struct {
	Peering
}

PeeringsClientGetResult contains the result from method PeeringsClient.Get.

type PeeringsClientListByResourceGroupOptions added in v0.2.0

type PeeringsClientListByResourceGroupOptions struct {
}

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

type PeeringsClientListByResourceGroupPager added in v0.2.0

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

PeeringsClientListByResourceGroupPager provides operations for iterating over paged responses.

func (*PeeringsClientListByResourceGroupPager) Err added in v0.2.0

Err returns the last error encountered while paging.

func (*PeeringsClientListByResourceGroupPager) NextPage added in v0.2.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*PeeringsClientListByResourceGroupPager) PageResponse added in v0.2.0

PageResponse returns the current PeeringsClientListByResourceGroupResponse page.

type PeeringsClientListByResourceGroupResponse added in v0.2.0

type PeeringsClientListByResourceGroupResponse struct {
	PeeringsClientListByResourceGroupResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PeeringsClientListByResourceGroupResponse contains the response from method PeeringsClient.ListByResourceGroup.

type PeeringsClientListByResourceGroupResult added in v0.2.0

type PeeringsClientListByResourceGroupResult struct {
	ListResult
}

PeeringsClientListByResourceGroupResult contains the result from method PeeringsClient.ListByResourceGroup.

type PeeringsClientListBySubscriptionOptions added in v0.2.0

type PeeringsClientListBySubscriptionOptions struct {
}

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

type PeeringsClientListBySubscriptionPager added in v0.2.0

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

PeeringsClientListBySubscriptionPager provides operations for iterating over paged responses.

func (*PeeringsClientListBySubscriptionPager) Err added in v0.2.0

Err returns the last error encountered while paging.

func (*PeeringsClientListBySubscriptionPager) NextPage added in v0.2.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*PeeringsClientListBySubscriptionPager) PageResponse added in v0.2.0

PageResponse returns the current PeeringsClientListBySubscriptionResponse page.

type PeeringsClientListBySubscriptionResponse added in v0.2.0

type PeeringsClientListBySubscriptionResponse struct {
	PeeringsClientListBySubscriptionResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PeeringsClientListBySubscriptionResponse contains the response from method PeeringsClient.ListBySubscription.

type PeeringsClientListBySubscriptionResult added in v0.2.0

type PeeringsClientListBySubscriptionResult struct {
	ListResult
}

PeeringsClientListBySubscriptionResult contains the result from method PeeringsClient.ListBySubscription.

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 {
	PeeringsClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PeeringsClientUpdateResponse contains the response from method PeeringsClient.Update.

type PeeringsClientUpdateResult added in v0.2.0

type PeeringsClientUpdateResult struct {
	Peering
}

PeeringsClientUpdateResult contains the result 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"
)

func PossiblePrefixValidationStateValues

func PossiblePrefixValidationStateValues() []PrefixValidationState

PossiblePrefixValidationStateValues returns the possible values for the PrefixValidationState const type.

func (PrefixValidationState) ToPtr

ToPtr returns a *PrefixValidationState pointing to the current value.

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

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) ListByPeeringService

func (client *PrefixesClient) ListByPeeringService(resourceGroupName string, peeringServiceName string, options *PrefixesClientListByPeeringServiceOptions) *PrefixesClientListByPeeringServicePager

ListByPeeringService - Lists the peerings prefix in the resource group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The resource group name. peeringServiceName - The peering service name. options - PrefixesClientListByPeeringServiceOptions contains the optional parameters for the PrefixesClient.ListByPeeringService method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewPrefixesClient("<subscription-id>", cred, nil)
	pager := client.ListByPeeringService("<resource-group-name>",
		"<peering-service-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type PrefixesClientListByPeeringServiceOptions added in v0.2.0

type PrefixesClientListByPeeringServiceOptions struct {
}

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

type PrefixesClientListByPeeringServicePager added in v0.2.0

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

PrefixesClientListByPeeringServicePager provides operations for iterating over paged responses.

func (*PrefixesClientListByPeeringServicePager) Err added in v0.2.0

Err returns the last error encountered while paging.

func (*PrefixesClientListByPeeringServicePager) NextPage added in v0.2.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*PrefixesClientListByPeeringServicePager) PageResponse added in v0.2.0

PageResponse returns the current PrefixesClientListByPeeringServiceResponse page.

type PrefixesClientListByPeeringServiceResponse added in v0.2.0

type PrefixesClientListByPeeringServiceResponse struct {
	PrefixesClientListByPeeringServiceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PrefixesClientListByPeeringServiceResponse contains the response from method PrefixesClient.ListByPeeringService.

type PrefixesClientListByPeeringServiceResult added in v0.2.0

type PrefixesClientListByPeeringServiceResult struct {
	ServicePrefixListResult
}

PrefixesClientListByPeeringServiceResult contains the result from method PrefixesClient.ListByPeeringService.

type Properties added in v0.2.0

type Properties struct {
	// The properties that define a direct peering.
	Direct *PropertiesDirect `json:"direct,omitempty"`

	// The properties that define an exchange peering.
	Exchange *PropertiesExchange `json:"exchange,omitempty"`

	// The location of the peering.
	PeeringLocation *string `json:"peeringLocation,omitempty"`

	// READ-ONLY; The provisioning state of the resource.
	ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"`
}

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

type PropertiesDirect added in v0.2.0

type PropertiesDirect struct {
	// The set of connections that constitute a direct peering.
	Connections []*DirectConnection `json:"connections,omitempty"`

	// The type of direct peering.
	DirectPeeringType *DirectPeeringType `json:"directPeeringType,omitempty"`

	// The reference of the peer ASN.
	PeerAsn *SubResource `json:"peerAsn,omitempty"`

	// The flag that indicates whether or not the peering is used for peering service.
	UseForPeeringService *bool `json:"useForPeeringService,omitempty"`
}

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.

type PropertiesExchange added in v0.2.0

type PropertiesExchange struct {
	// The set of connections that constitute an exchange peering.
	Connections []*ExchangeConnection `json:"connections,omitempty"`

	// The reference of the peer ASN.
	PeerAsn *SubResource `json:"peerAsn,omitempty"`
}

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.

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.

func (ProvisioningState) ToPtr

ToPtr returns a *ProvisioningState pointing to the current value.

type Resource

type Resource struct {
	// READ-ONLY; The ID of the resource.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource.
	Type *string `json:"type,omitempty" azure:"ro"`
}

Resource - The ARM resource class.

type ResourceTags

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

ResourceTags - The resource tags.

func (ResourceTags) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ResourceTags.

type SKU added in v0.2.0

type SKU struct {
	// The family of the peering SKU.
	Family *Family `json:"family,omitempty"`

	// The name of the peering SKU.
	Name *Name `json:"name,omitempty"`

	// The size of the peering SKU.
	Size *Size `json:"size,omitempty"`

	// The tier of the peering SKU.
	Tier *Tier `json:"tier,omitempty"`
}

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

type Service added in v0.2.0

type Service struct {
	// REQUIRED; The location of the resource.
	Location *string `json:"location,omitempty"`

	// The properties that define a peering service.
	Properties *ServiceProperties `json:"properties,omitempty"`

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

	// READ-ONLY; The ID of the resource.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource.
	Type *string `json:"type,omitempty" azure:"ro"`
}

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.

type ServiceListResult added in v0.2.0

type ServiceListResult struct {
	// The link to fetch the next page of peering services.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of peering services.
	Value []*Service `json:"value,omitempty"`
}

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.

type ServiceLocation added in v0.2.0

type ServiceLocation struct {
	// The properties that define a peering service location.
	Properties *ServiceLocationProperties `json:"properties,omitempty"`

	// READ-ONLY; The ID of the resource.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServiceLocation - PeeringService location

type ServiceLocationListResult added in v0.2.0

type ServiceLocationListResult struct {
	// The link to fetch the next page of peering service locations.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of peering service locations.
	Value []*ServiceLocation `json:"value,omitempty"`
}

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.

type ServiceLocationProperties added in v0.2.0

type ServiceLocationProperties struct {
	// Azure region for the location
	AzureRegion *string `json:"azureRegion,omitempty"`

	// Country of the customer
	Country *string `json:"country,omitempty"`

	// State of the customer
	State *string `json:"state,omitempty"`
}

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

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

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) List added in v0.2.0

List - Lists all of the available peering service locations for the specified kind of peering. If the operation fails it returns an *azcore.ResponseError type. options - ServiceLocationsClientListOptions contains the optional parameters for the ServiceLocationsClient.List method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeeringServiceLocations.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()
	client := armpeering.NewServiceLocationsClient("<subscription-id>", cred, nil)
	pager := client.List(nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ServiceLocationsClientListOptions added in v0.2.0

type ServiceLocationsClientListOptions struct {
}

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

type ServiceLocationsClientListPager added in v0.2.0

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

ServiceLocationsClientListPager provides operations for iterating over paged responses.

func (*ServiceLocationsClientListPager) Err added in v0.2.0

Err returns the last error encountered while paging.

func (*ServiceLocationsClientListPager) NextPage added in v0.2.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServiceLocationsClientListPager) PageResponse added in v0.2.0

PageResponse returns the current ServiceLocationsClientListResponse page.

type ServiceLocationsClientListResponse added in v0.2.0

type ServiceLocationsClientListResponse struct {
	ServiceLocationsClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServiceLocationsClientListResponse contains the response from method ServiceLocationsClient.List.

type ServiceLocationsClientListResult added in v0.2.0

type ServiceLocationsClientListResult struct {
	ServiceLocationListResult
}

ServiceLocationsClientListResult contains the result from method ServiceLocationsClient.List.

type ServicePrefix added in v0.2.0

type ServicePrefix struct {
	// Gets or sets the peering prefix properties.
	Properties *ServicePrefixProperties `json:"properties,omitempty"`

	// READ-ONLY; The ID of the resource.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServicePrefix - The peering service prefix class.

type ServicePrefixListResult added in v0.2.0

type ServicePrefixListResult struct {
	// The link to fetch the next page of [T].
	NextLink *string `json:"nextLink,omitempty"`

	// The list of [T].
	Value []*ServicePrefix `json:"value,omitempty"`
}

ServicePrefixListResult - The paginated list of [T].

func (ServicePrefixListResult) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ServicePrefixListResult.

type ServicePrefixProperties added in v0.2.0

type ServicePrefixProperties struct {
	// The prefix learned type
	LearnedType *LearnedType `json:"learnedType,omitempty"`

	// Valid route prefix
	Prefix *string `json:"prefix,omitempty"`

	// The prefix validation state
	PrefixValidationState *PrefixValidationState `json:"prefixValidationState,omitempty"`

	// READ-ONLY; The provisioning state of the resource.
	ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"`
}

ServicePrefixProperties - The peering service prefix properties class.

type ServicePrefixesClient added in v0.2.0

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

ServicePrefixesClient contains the methods for the PeeringServicePrefixes group. Don't use this type directly, use NewServicePrefixesClient() instead.

func NewServicePrefixesClient added in v0.2.0

func NewServicePrefixesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServicePrefixesClient

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

func (client *ServicePrefixesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, peeringServicePrefix ServicePrefix, options *ServicePrefixesClientCreateOrUpdateOptions) (ServicePrefixesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates the peering prefix. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The resource group name. peeringServiceName - The peering service name. prefixName - The prefix name peeringServicePrefix - The IP prefix for an peering options - ServicePrefixesClientCreateOrUpdateOptions contains the optional parameters for the ServicePrefixesClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewServicePrefixesClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<peering-service-name>",
		"<prefix-name>",
		armpeering.ServicePrefix{
			Properties: &armpeering.ServicePrefixProperties{
				Prefix: to.StringPtr("<prefix>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServicePrefixesClientCreateOrUpdateResult)
}
Output:

func (*ServicePrefixesClient) Delete added in v0.2.0

func (client *ServicePrefixesClient) Delete(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, options *ServicePrefixesClientDeleteOptions) (ServicePrefixesClientDeleteResponse, error)

Delete - removes the peering prefix. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The resource group name. peeringServiceName - The peering service name. prefixName - The prefix name options - ServicePrefixesClientDeleteOptions contains the optional parameters for the ServicePrefixesClient.Delete method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewServicePrefixesClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<peering-service-name>",
		"<prefix-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ServicePrefixesClient) Get added in v0.2.0

func (client *ServicePrefixesClient) Get(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, options *ServicePrefixesClientGetOptions) (ServicePrefixesClientGetResponse, error)

Get - Gets the peering service prefix. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The resource group name. peeringServiceName - The peering service name. prefixName - The prefix name. options - ServicePrefixesClientGetOptions contains the optional parameters for the ServicePrefixesClient.Get method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewServicePrefixesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<peering-service-name>",
		"<prefix-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServicePrefixesClientGetResult)
}
Output:

type ServicePrefixesClientCreateOrUpdateOptions added in v0.2.0

type ServicePrefixesClientCreateOrUpdateOptions struct {
}

ServicePrefixesClientCreateOrUpdateOptions contains the optional parameters for the ServicePrefixesClient.CreateOrUpdate method.

type ServicePrefixesClientCreateOrUpdateResponse added in v0.2.0

type ServicePrefixesClientCreateOrUpdateResponse struct {
	ServicePrefixesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServicePrefixesClientCreateOrUpdateResponse contains the response from method ServicePrefixesClient.CreateOrUpdate.

type ServicePrefixesClientCreateOrUpdateResult added in v0.2.0

type ServicePrefixesClientCreateOrUpdateResult struct {
	ServicePrefix
}

ServicePrefixesClientCreateOrUpdateResult contains the result from method ServicePrefixesClient.CreateOrUpdate.

type ServicePrefixesClientDeleteOptions added in v0.2.0

type ServicePrefixesClientDeleteOptions struct {
}

ServicePrefixesClientDeleteOptions contains the optional parameters for the ServicePrefixesClient.Delete method.

type ServicePrefixesClientDeleteResponse added in v0.2.0

type ServicePrefixesClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServicePrefixesClientDeleteResponse contains the response from method ServicePrefixesClient.Delete.

type ServicePrefixesClientGetOptions added in v0.2.0

type ServicePrefixesClientGetOptions struct {
}

ServicePrefixesClientGetOptions contains the optional parameters for the ServicePrefixesClient.Get method.

type ServicePrefixesClientGetResponse added in v0.2.0

type ServicePrefixesClientGetResponse struct {
	ServicePrefixesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServicePrefixesClientGetResponse contains the response from method ServicePrefixesClient.Get.

type ServicePrefixesClientGetResult added in v0.2.0

type ServicePrefixesClientGetResult struct {
	ServicePrefix
}

ServicePrefixesClientGetResult contains the result from method ServicePrefixesClient.Get.

type ServiceProperties added in v0.2.0

type ServiceProperties struct {
	// The PeeringServiceLocation of the Customer.
	PeeringServiceLocation *string `json:"peeringServiceLocation,omitempty"`

	// The MAPS Provider Name.
	PeeringServiceProvider *string `json:"peeringServiceProvider,omitempty"`

	// READ-ONLY; The provisioning state of the resource.
	ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"`
}

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

type ServiceProvider added in v0.2.0

type ServiceProvider struct {
	// The properties that define a peering service provider.
	Properties *ServiceProviderProperties `json:"properties,omitempty"`

	// READ-ONLY; The ID of the resource.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServiceProvider - PeeringService provider

type ServiceProviderListResult added in v0.2.0

type ServiceProviderListResult struct {
	// The link to fetch the next page of peering service providers.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of peering service providers.
	Value []*ServiceProvider `json:"value,omitempty"`
}

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.

type ServiceProviderProperties added in v0.2.0

type ServiceProviderProperties struct {
	// The name of the service provider.
	ServiceProviderName *string `json:"serviceProviderName,omitempty"`
}

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

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

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) List added in v0.2.0

List - Lists all of the available peering service locations for the specified kind of peering. If the operation fails it returns an *azcore.ResponseError type. options - ServiceProvidersClientListOptions contains the optional parameters for the ServiceProvidersClient.List method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewServiceProvidersClient("<subscription-id>", cred, nil)
	pager := client.List(nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ServiceProvidersClientListOptions added in v0.2.0

type ServiceProvidersClientListOptions struct {
}

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

type ServiceProvidersClientListPager added in v0.2.0

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

ServiceProvidersClientListPager provides operations for iterating over paged responses.

func (*ServiceProvidersClientListPager) Err added in v0.2.0

Err returns the last error encountered while paging.

func (*ServiceProvidersClientListPager) NextPage added in v0.2.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServiceProvidersClientListPager) PageResponse added in v0.2.0

PageResponse returns the current ServiceProvidersClientListResponse page.

type ServiceProvidersClientListResponse added in v0.2.0

type ServiceProvidersClientListResponse struct {
	ServiceProvidersClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServiceProvidersClientListResponse contains the response from method ServiceProvidersClient.List.

type ServiceProvidersClientListResult added in v0.2.0

type ServiceProvidersClientListResult struct {
	ServiceProviderListResult
}

ServiceProvidersClientListResult contains the result from method ServiceProvidersClient.List.

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

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

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewServicesClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<peering-service-name>",
		armpeering.Service{
			Location: to.StringPtr("<location>"),
			Properties: &armpeering.ServiceProperties{
				PeeringServiceLocation: to.StringPtr("<peering-service-location>"),
				PeeringServiceProvider: to.StringPtr("<peering-service-provider>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServicesClientCreateOrUpdateResult)
}
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. 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

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewServicesClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<peering-service-name>",
		nil)
	if err != nil {
		log.Fatal(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. 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

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewServicesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<peering-service-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServicesClientGetResult)
}
Output:

func (*ServicesClient) ListByResourceGroup added in v0.2.0

func (client *ServicesClient) ListByResourceGroup(resourceGroupName string, options *ServicesClientListByResourceGroupOptions) *ServicesClientListByResourceGroupPager

ListByResourceGroup - Lists all of the peering services under the given subscription and resource group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group. options - ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.ListByResourceGroup method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewServicesClient("<subscription-id>", cred, nil)
	pager := client.ListByResourceGroup("<resource-group-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*ServicesClient) ListBySubscription added in v0.2.0

ListBySubscription - Lists all of the peerings under the given subscription. If the operation fails it returns an *azcore.ResponseError type. options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.ListBySubscription method.

Example

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewServicesClient("<subscription-id>", cred, nil)
	pager := client.ListBySubscription(nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
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. 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

x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/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()
	client := armpeering.NewServicesClient("<subscription-id>", cred, nil)
	res, err := client.Update(ctx,
		"<resource-group-name>",
		"<peering-service-name>",
		armpeering.ResourceTags{
			Tags: map[string]*string{
				"tag0": to.StringPtr("value0"),
				"tag1": to.StringPtr("value1"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServicesClientUpdateResult)
}
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 {
	ServicesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.CreateOrUpdate.

type ServicesClientCreateOrUpdateResult added in v0.2.0

type ServicesClientCreateOrUpdateResult struct {
	Service
}

ServicesClientCreateOrUpdateResult contains the result 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 {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

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 {
	ServicesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServicesClientGetResponse contains the response from method ServicesClient.Get.

type ServicesClientGetResult added in v0.2.0

type ServicesClientGetResult struct {
	Service
}

ServicesClientGetResult contains the result from method ServicesClient.Get.

type ServicesClientListByResourceGroupOptions added in v0.2.0

type ServicesClientListByResourceGroupOptions struct {
}

ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.ListByResourceGroup method.

type ServicesClientListByResourceGroupPager added in v0.2.0

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

ServicesClientListByResourceGroupPager provides operations for iterating over paged responses.

func (*ServicesClientListByResourceGroupPager) Err added in v0.2.0

Err returns the last error encountered while paging.

func (*ServicesClientListByResourceGroupPager) NextPage added in v0.2.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServicesClientListByResourceGroupPager) PageResponse added in v0.2.0

PageResponse returns the current ServicesClientListByResourceGroupResponse page.

type ServicesClientListByResourceGroupResponse added in v0.2.0

type ServicesClientListByResourceGroupResponse struct {
	ServicesClientListByResourceGroupResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServicesClientListByResourceGroupResponse contains the response from method ServicesClient.ListByResourceGroup.

type ServicesClientListByResourceGroupResult added in v0.2.0

type ServicesClientListByResourceGroupResult struct {
	ServiceListResult
}

ServicesClientListByResourceGroupResult contains the result from method ServicesClient.ListByResourceGroup.

type ServicesClientListBySubscriptionOptions added in v0.2.0

type ServicesClientListBySubscriptionOptions struct {
}

ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.ListBySubscription method.

type ServicesClientListBySubscriptionPager added in v0.2.0

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

ServicesClientListBySubscriptionPager provides operations for iterating over paged responses.

func (*ServicesClientListBySubscriptionPager) Err added in v0.2.0

Err returns the last error encountered while paging.

func (*ServicesClientListBySubscriptionPager) NextPage added in v0.2.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServicesClientListBySubscriptionPager) PageResponse added in v0.2.0

PageResponse returns the current ServicesClientListBySubscriptionResponse page.

type ServicesClientListBySubscriptionResponse added in v0.2.0

type ServicesClientListBySubscriptionResponse struct {
	ServicesClientListBySubscriptionResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServicesClientListBySubscriptionResponse contains the response from method ServicesClient.ListBySubscription.

type ServicesClientListBySubscriptionResult added in v0.2.0

type ServicesClientListBySubscriptionResult struct {
	ServiceListResult
}

ServicesClientListBySubscriptionResult contains the result from method ServicesClient.ListBySubscription.

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 {
	ServicesClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServicesClientUpdateResponse contains the response from method ServicesClient.Update.

type ServicesClientUpdateResult added in v0.2.0

type ServicesClientUpdateResult struct {
	Service
}

ServicesClientUpdateResult contains the result 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.

func (SessionAddressProvider) ToPtr

ToPtr returns a *SessionAddressProvider pointing to the current value.

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.

func (SessionStateV4) ToPtr

func (c SessionStateV4) ToPtr() *SessionStateV4

ToPtr returns a *SessionStateV4 pointing to the current value.

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.

func (SessionStateV6) ToPtr

func (c SessionStateV6) ToPtr() *SessionStateV6

ToPtr returns a *SessionStateV6 pointing to the current value.

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.

func (Size) ToPtr

func (c Size) ToPtr() *Size

ToPtr returns a *Size pointing to the current value.

type SubResource

type SubResource struct {
	// The identifier of the referenced resource.
	ID *string `json:"id,omitempty"`
}

SubResource - The sub resource.

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.

func (Tier) ToPtr

func (c Tier) ToPtr() *Tier

ToPtr returns a *Tier pointing to the current value.

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.

func (ValidationState) ToPtr

func (c ValidationState) ToPtr() *ValidationState

ToPtr returns a *ValidationState pointing to the current value.

Jump to

Keyboard shortcuts

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