armmanagednetwork

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: MIT Imports: 14 Imported by: 4

README

Azure Managed Network Module for Go

PkgGoDev

The armmanagednetwork module provides operations for working with Azure Managed Network.

Source code

Getting started

Prerequisites

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Managed Network module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetwork/armmanagednetwork

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Managed Network. 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 Managed Network modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential.

client, err := armmanagednetwork.NewGroupsClient(<subscription ID>, cred, nil)

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

options := arm.ClientOptions{
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
client, err := armmanagednetwork.NewGroupsClient(<subscription ID>, cred, &options)

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Managed Network 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 ConnectivityCollection

type ConnectivityCollection struct {
	// READ-ONLY; The collection of connectivity related Managed Network Groups within the Managed Network
	Groups []*Group `json:"groups,omitempty" azure:"ro"`

	// READ-ONLY; The collection of Managed Network Peering Policies within the Managed Network
	Peerings []*PeeringPolicy `json:"peerings,omitempty" azure:"ro"`
}

ConnectivityCollection - The collection of Connectivity related groups and policies within the Managed Network

func (ConnectivityCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ConnectivityCollection.

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 Group

type Group struct {
	// Responsibility role under which this Managed Network Group will be created
	Kind *Kind `json:"kind,omitempty"`

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

	// Gets or sets the properties of a network group
	Properties *GroupProperties `json:"properties,omitempty"`

	// READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
	Type *string `json:"type,omitempty" azure:"ro"`
}

Group - The Managed Network Group resource

type GroupListResult

type GroupListResult struct {
	// Gets the URL to get the next set of results.
	NextLink *string `json:"nextLink,omitempty"`

	// Gets a page of ManagedNetworkGroup
	Value []*Group `json:"value,omitempty"`
}

GroupListResult - Result of the request to list Managed Network Groups. It contains a list of groups and a URL link to get the next set of results.

type GroupProperties

type GroupProperties struct {
	// The collection of management groups covered by the Managed Network
	ManagementGroups []*ResourceID `json:"managementGroups,omitempty"`

	// The collection of subnets covered by the Managed Network
	Subnets []*ResourceID `json:"subnets,omitempty"`

	// The collection of subscriptions covered by the Managed Network
	Subscriptions []*ResourceID `json:"subscriptions,omitempty"`

	// The collection of virtual nets covered by the Managed Network
	VirtualNetworks []*ResourceID `json:"virtualNetworks,omitempty"`

	// READ-ONLY; A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty" azure:"ro"`

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

GroupProperties - Properties of a Managed Network Group

func (GroupProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type GroupProperties.

type GroupsClient

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

GroupsClient contains the methods for the ManagedNetworkGroups group. Don't use this type directly, use NewGroupsClient() instead.

func NewGroupsClient

func NewGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupsClient, error)

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

func (*GroupsClient) BeginCreateOrUpdate

func (client *GroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedNetworkName string, managedNetworkGroupName string, managedNetworkGroup Group, options *GroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GroupsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - The Put ManagedNetworkGroups operation creates or updates a Managed Network Group resource If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview resourceGroupName - The name of the resource group. managedNetworkName - The name of the Managed Network. managedNetworkGroupName - The name of the Managed Network Group. managedNetworkGroup - Parameters supplied to the create/update a Managed Network Group resource options - GroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the GroupsClient.BeginCreateOrUpdate method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ManagedNetworkGroup/ManagedNetworkGroupsPut.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/managednetwork/armmanagednetwork"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmanagednetwork.NewGroupsClient("subscriptionA", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginCreateOrUpdate(ctx,
		"myResourceGroup",
		"myManagedNetwork",
		"myManagedNetworkGroup1",
		armmanagednetwork.Group{
			Properties: &armmanagednetwork.GroupProperties{
				ManagementGroups: []*armmanagednetwork.ResourceID{},
				Subnets: []*armmanagednetwork.ResourceID{
					{
						ID: to.Ptr("/subscriptionB/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/VnetA/subnets/subnetA"),
					}},
				Subscriptions: []*armmanagednetwork.ResourceID{},
				VirtualNetworks: []*armmanagednetwork.ResourceID{
					{
						ID: to.Ptr("/subscriptionB/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/VnetA"),
					},
					{
						ID: to.Ptr("/subscriptionB/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/VnetB"),
					}},
			},
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*GroupsClient) BeginDelete

func (client *GroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, managedNetworkName string, managedNetworkGroupName string, options *GroupsClientBeginDeleteOptions) (*runtime.Poller[GroupsClientDeleteResponse], error)

BeginDelete - The Delete ManagedNetworkGroups operation deletes a Managed Network Group specified by the resource group, Managed Network name, and group name If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview resourceGroupName - The name of the resource group. managedNetworkName - The name of the Managed Network. managedNetworkGroupName - The name of the Managed Network Group. options - GroupsClientBeginDeleteOptions contains the optional parameters for the GroupsClient.BeginDelete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ManagedNetworkGroup/ManagedNetworkGroupsDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetwork/armmanagednetwork"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmanagednetwork.NewGroupsClient("subscriptionA", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginDelete(ctx,
		"myResourceGroup",
		"myManagedNetwork",
		"myManagedNetworkGroup1",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*GroupsClient) Get

func (client *GroupsClient) Get(ctx context.Context, resourceGroupName string, managedNetworkName string, managedNetworkGroupName string, options *GroupsClientGetOptions) (GroupsClientGetResponse, error)

Get - The Get ManagedNetworkGroups operation gets a Managed Network Group specified by the resource group, Managed Network name, and group name If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview resourceGroupName - The name of the resource group. managedNetworkName - The name of the Managed Network. managedNetworkGroupName - The name of the Managed Network Group. options - GroupsClientGetOptions contains the optional parameters for the GroupsClient.Get method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ManagedNetworkGroup/ManagedNetworkGroupsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetwork/armmanagednetwork"
)

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

func (*GroupsClient) NewListByManagedNetworkPager

func (client *GroupsClient) NewListByManagedNetworkPager(resourceGroupName string, managedNetworkName string, options *GroupsClientListByManagedNetworkOptions) *runtime.Pager[GroupsClientListByManagedNetworkResponse]

NewListByManagedNetworkPager - The ListByManagedNetwork ManagedNetworkGroup operation retrieves all the Managed Network Groups in a specified Managed Networks in a paginated format. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview resourceGroupName - The name of the resource group. managedNetworkName - The name of the Managed Network. options - GroupsClientListByManagedNetworkOptions contains the optional parameters for the GroupsClient.ListByManagedNetwork method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ManagedNetworkGroup/ManagedNetworkGroupsListByManagedNetwork.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetwork/armmanagednetwork"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmanagednetwork.NewGroupsClient("subscriptionA", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByManagedNetworkPager("myResourceGroup",
		"myManagedNetwork",
		&armmanagednetwork.GroupsClientListByManagedNetworkOptions{Top: nil,
			Skiptoken: nil,
		})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type GroupsClientBeginCreateOrUpdateOptions

type GroupsClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the GroupsClient.BeginCreateOrUpdate method.

type GroupsClientBeginDeleteOptions

type GroupsClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GroupsClientBeginDeleteOptions contains the optional parameters for the GroupsClient.BeginDelete method.

type GroupsClientCreateOrUpdateResponse

type GroupsClientCreateOrUpdateResponse struct {
	Group
}

GroupsClientCreateOrUpdateResponse contains the response from method GroupsClient.CreateOrUpdate.

type GroupsClientDeleteResponse

type GroupsClientDeleteResponse struct {
}

GroupsClientDeleteResponse contains the response from method GroupsClient.Delete.

type GroupsClientGetOptions

type GroupsClientGetOptions struct {
}

GroupsClientGetOptions contains the optional parameters for the GroupsClient.Get method.

type GroupsClientGetResponse

type GroupsClientGetResponse struct {
	Group
}

GroupsClientGetResponse contains the response from method GroupsClient.Get.

type GroupsClientListByManagedNetworkOptions

type GroupsClientListByManagedNetworkOptions struct {
	// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element,
	// the value of the nextLink element will include a skiptoken parameter that
	// specifies a starting point to use for subsequent calls.
	Skiptoken *string
	// May be used to limit the number of results in a page for list queries.
	Top *int32
}

GroupsClientListByManagedNetworkOptions contains the optional parameters for the GroupsClient.ListByManagedNetwork method.

type GroupsClientListByManagedNetworkResponse

type GroupsClientListByManagedNetworkResponse struct {
	GroupListResult
}

GroupsClientListByManagedNetworkResponse contains the response from method GroupsClient.ListByManagedNetwork.

type HubAndSpokePeeringPolicyProperties

type HubAndSpokePeeringPolicyProperties struct {
	// REQUIRED; Gets or sets the connectivity type of a network structure policy
	Type *Type `json:"type,omitempty"`

	// Gets or sets the hub virtual network ID
	Hub *ResourceID `json:"hub,omitempty"`

	// Gets or sets the mesh group IDs
	Mesh []*ResourceID `json:"mesh,omitempty"`

	// Gets or sets the spokes group IDs
	Spokes []*ResourceID `json:"spokes,omitempty"`

	// READ-ONLY; A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty" azure:"ro"`

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

HubAndSpokePeeringPolicyProperties - Properties of a Hub and Spoke Peering Policy

func (HubAndSpokePeeringPolicyProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type HubAndSpokePeeringPolicyProperties.

type Kind

type Kind string

Kind - Responsibility role under which this Managed Network Group will be created

const (
	KindConnectivity Kind = "Connectivity"
)

func PossibleKindValues

func PossibleKindValues() []Kind

PossibleKindValues returns the possible values for the Kind const type.

type ListResult

type ListResult struct {
	// Gets the URL to get the next page of results.
	NextLink *string `json:"nextLink,omitempty"`

	// Gets a page of ManagedNetworks
	Value []*ManagedNetwork `json:"value,omitempty"`
}

ListResult - Result of the request to list Managed Network. It contains a list of Managed Networks and a URL link to get the next set of results.

type ManagedNetwork

type ManagedNetwork struct {
	// The geo-location where the resource lives
	Location *string `json:"location,omitempty"`

	// The MNC properties
	Properties *Properties `json:"properties,omitempty"`

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

	// READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedNetwork - The Managed Network resource

func (ManagedNetwork) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedNetwork.

type ManagedNetworksClient

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

ManagedNetworksClient contains the methods for the ManagedNetworks group. Don't use this type directly, use NewManagedNetworksClient() instead.

func NewManagedNetworksClient

func NewManagedNetworksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedNetworksClient, error)

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

func (*ManagedNetworksClient) BeginDelete

func (client *ManagedNetworksClient) BeginDelete(ctx context.Context, resourceGroupName string, managedNetworkName string, options *ManagedNetworksClientBeginDeleteOptions) (*runtime.Poller[ManagedNetworksClientDeleteResponse], error)

BeginDelete - The Delete ManagedNetworks operation deletes a Managed Network Resource, specified by the resource group and Managed Network name If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview resourceGroupName - The name of the resource group. managedNetworkName - The name of the Managed Network. options - ManagedNetworksClientBeginDeleteOptions contains the optional parameters for the ManagedNetworksClient.BeginDelete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ManagedNetwork/ManagedNetworksDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetwork/armmanagednetwork"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmanagednetwork.NewManagedNetworksClient("subscriptionA", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginDelete(ctx,
		"myResourceGroup",
		"myManagedNetwork",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*ManagedNetworksClient) BeginUpdate

func (client *ManagedNetworksClient) BeginUpdate(ctx context.Context, resourceGroupName string, managedNetworkName string, parameters Update, options *ManagedNetworksClientBeginUpdateOptions) (*runtime.Poller[ManagedNetworksClientUpdateResponse], error)

BeginUpdate - Updates the specified Managed Network resource tags. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview resourceGroupName - The name of the resource group. managedNetworkName - The name of the Managed Network. parameters - Parameters supplied to update application gateway tags and/or scope. options - ManagedNetworksClientBeginUpdateOptions contains the optional parameters for the ManagedNetworksClient.BeginUpdate method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ManagedNetwork/ManagedNetworksPatch.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetwork/armmanagednetwork"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmanagednetwork.NewManagedNetworksClient("subscriptionA", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginUpdate(ctx,
		"myResourceGroup",
		"myManagedNetwork",
		armmanagednetwork.Update{
			Tags: map[string]*string{},
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*ManagedNetworksClient) CreateOrUpdate

func (client *ManagedNetworksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedNetworkName string, managedNetwork ManagedNetwork, options *ManagedNetworksClientCreateOrUpdateOptions) (ManagedNetworksClientCreateOrUpdateResponse, error)

CreateOrUpdate - The Put ManagedNetworks operation creates/updates a Managed Network Resource, specified by resource group and Managed Network name If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview resourceGroupName - The name of the resource group. managedNetworkName - The name of the Managed Network. managedNetwork - Parameters supplied to the create/update a Managed Network Resource options - ManagedNetworksClientCreateOrUpdateOptions contains the optional parameters for the ManagedNetworksClient.CreateOrUpdate method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ManagedNetwork/ManagedNetworksPut.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/managednetwork/armmanagednetwork"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmanagednetwork.NewManagedNetworksClient("subscriptionA", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx,
		"myResourceGroup",
		"myManagedNetwork",
		armmanagednetwork.ManagedNetwork{
			Location: to.Ptr("eastus"),
			Tags:     map[string]*string{},
			Properties: &armmanagednetwork.Properties{
				Scope: &armmanagednetwork.Scope{
					ManagementGroups: []*armmanagednetwork.ResourceID{
						{
							ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0001-0000-0000-000000000000"),
						},
						{
							ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0002-0000-0000-000000000000"),
						}},
					Subnets: []*armmanagednetwork.ResourceID{
						{
							ID: to.Ptr("/subscriptions/subscriptionC/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/VnetC/subnets/subnetA"),
						},
						{
							ID: to.Ptr("/subscriptions/subscriptionC/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/VnetC/subnets/subnetB"),
						}},
					Subscriptions: []*armmanagednetwork.ResourceID{
						{
							ID: to.Ptr("subscriptionA"),
						},
						{
							ID: to.Ptr("subscriptionB"),
						}},
					VirtualNetworks: []*armmanagednetwork.ResourceID{
						{
							ID: to.Ptr("/subscriptions/subscriptionC/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/VnetA"),
						},
						{
							ID: to.Ptr("/subscriptions/subscriptionC/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/VnetB"),
						}},
				},
			},
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*ManagedNetworksClient) Get

func (client *ManagedNetworksClient) Get(ctx context.Context, resourceGroupName string, managedNetworkName string, options *ManagedNetworksClientGetOptions) (ManagedNetworksClientGetResponse, error)

Get - The Get ManagedNetworks operation gets a Managed Network Resource, specified by the resource group and Managed Network name If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview resourceGroupName - The name of the resource group. managedNetworkName - The name of the Managed Network. options - ManagedNetworksClientGetOptions contains the optional parameters for the ManagedNetworksClient.Get method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ManagedNetwork/ManagedNetworksGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetwork/armmanagednetwork"
)

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

func (*ManagedNetworksClient) NewListByResourceGroupPager

NewListByResourceGroupPager - The ListByResourceGroup ManagedNetwork operation retrieves all the Managed Network resources in a resource group in a paginated format. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview resourceGroupName - The name of the resource group. options - ManagedNetworksClientListByResourceGroupOptions contains the optional parameters for the ManagedNetworksClient.ListByResourceGroup method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ManagedNetwork/ManagedNetworksListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetwork/armmanagednetwork"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmanagednetwork.NewManagedNetworksClient("subscriptionA", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByResourceGroupPager("myResourceGroup",
		&armmanagednetwork.ManagedNetworksClientListByResourceGroupOptions{Top: nil,
			Skiptoken: nil,
		})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*ManagedNetworksClient) NewListBySubscriptionPager

NewListBySubscriptionPager - The ListBySubscription ManagedNetwork operation retrieves all the Managed Network Resources in the current subscription in a paginated format. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview options - ManagedNetworksClientListBySubscriptionOptions contains the optional parameters for the ManagedNetworksClient.ListBySubscription method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ManagedNetwork/ManagedNetworksListBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetwork/armmanagednetwork"
)

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

type ManagedNetworksClientBeginDeleteOptions

type ManagedNetworksClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ManagedNetworksClientBeginDeleteOptions contains the optional parameters for the ManagedNetworksClient.BeginDelete method.

type ManagedNetworksClientBeginUpdateOptions

type ManagedNetworksClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ManagedNetworksClientBeginUpdateOptions contains the optional parameters for the ManagedNetworksClient.BeginUpdate method.

type ManagedNetworksClientCreateOrUpdateOptions

type ManagedNetworksClientCreateOrUpdateOptions struct {
}

ManagedNetworksClientCreateOrUpdateOptions contains the optional parameters for the ManagedNetworksClient.CreateOrUpdate method.

type ManagedNetworksClientCreateOrUpdateResponse

type ManagedNetworksClientCreateOrUpdateResponse struct {
	ManagedNetwork
}

ManagedNetworksClientCreateOrUpdateResponse contains the response from method ManagedNetworksClient.CreateOrUpdate.

type ManagedNetworksClientDeleteResponse

type ManagedNetworksClientDeleteResponse struct {
}

ManagedNetworksClientDeleteResponse contains the response from method ManagedNetworksClient.Delete.

type ManagedNetworksClientGetOptions

type ManagedNetworksClientGetOptions struct {
}

ManagedNetworksClientGetOptions contains the optional parameters for the ManagedNetworksClient.Get method.

type ManagedNetworksClientGetResponse

type ManagedNetworksClientGetResponse struct {
	ManagedNetwork
}

ManagedNetworksClientGetResponse contains the response from method ManagedNetworksClient.Get.

type ManagedNetworksClientListByResourceGroupOptions

type ManagedNetworksClientListByResourceGroupOptions struct {
	// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element,
	// the value of the nextLink element will include a skiptoken parameter that
	// specifies a starting point to use for subsequent calls.
	Skiptoken *string
	// May be used to limit the number of results in a page for list queries.
	Top *int32
}

ManagedNetworksClientListByResourceGroupOptions contains the optional parameters for the ManagedNetworksClient.ListByResourceGroup method.

type ManagedNetworksClientListByResourceGroupResponse

type ManagedNetworksClientListByResourceGroupResponse struct {
	ListResult
}

ManagedNetworksClientListByResourceGroupResponse contains the response from method ManagedNetworksClient.ListByResourceGroup.

type ManagedNetworksClientListBySubscriptionOptions

type ManagedNetworksClientListBySubscriptionOptions struct {
	// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element,
	// the value of the nextLink element will include a skiptoken parameter that
	// specifies a starting point to use for subsequent calls.
	Skiptoken *string
	// May be used to limit the number of results in a page for list queries.
	Top *int32
}

ManagedNetworksClientListBySubscriptionOptions contains the optional parameters for the ManagedNetworksClient.ListBySubscription method.

type ManagedNetworksClientListBySubscriptionResponse

type ManagedNetworksClientListBySubscriptionResponse struct {
	ListResult
}

ManagedNetworksClientListBySubscriptionResponse contains the response from method ManagedNetworksClient.ListBySubscription.

type ManagedNetworksClientUpdateResponse

type ManagedNetworksClientUpdateResponse struct {
	ManagedNetwork
}

ManagedNetworksClientUpdateResponse contains the response from method ManagedNetworksClient.Update.

type MeshPeeringPolicyProperties

type MeshPeeringPolicyProperties struct {
	// REQUIRED; Gets or sets the connectivity type of a network structure policy
	Type *Type `json:"type,omitempty"`

	// Gets or sets the hub virtual network ID
	Hub *ResourceID `json:"hub,omitempty"`

	// Gets or sets the mesh group IDs
	Mesh []*ResourceID `json:"mesh,omitempty"`

	// Gets or sets the spokes group IDs
	Spokes []*ResourceID `json:"spokes,omitempty"`

	// READ-ONLY; A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty" azure:"ro"`

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

MeshPeeringPolicyProperties - Properties of a Mesh Peering Policy

func (MeshPeeringPolicyProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MeshPeeringPolicyProperties.

type Operation

type Operation struct {
	// The object that represents the operation.
	Display *OperationDisplay `json:"display,omitempty"`

	// Operation name: {provider}/{resource}/{operation}
	Name *string `json:"name,omitempty"`
}

Operation - REST API operation

type OperationDisplay

type OperationDisplay struct {
	// Operation type: Read, write, delete, etc.
	Operation *string `json:"operation,omitempty"`

	// Service provider: Microsoft.ManagedNetwork
	Provider *string `json:"provider,omitempty"`

	// Resource on which the operation is performed: Profile, endpoint, etc.
	Resource *string `json:"resource,omitempty"`
}

OperationDisplay - The object that represents the operation.

type OperationListResult

type OperationListResult struct {
	// URL to get the next set of operation list results if there are any.
	NextLink *string `json:"nextLink,omitempty"`

	// List of Resource Provider operations supported by the Managed Network resource provider.
	Value []*Operation `json:"value,omitempty"`
}

OperationListResult - Result of the request to list Managed Network operations. It contains a list of operations and a URL link to get the next set of results.

type OperationsClient

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

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

func NewOperationsClient

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

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

func (*OperationsClient) NewListPager

NewListPager - Lists all of the available MNC operations. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse

type OperationsClientListResponse struct {
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type PeeringPoliciesClient

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

PeeringPoliciesClient contains the methods for the ManagedNetworkPeeringPolicies group. Don't use this type directly, use NewPeeringPoliciesClient() instead.

func NewPeeringPoliciesClient

func NewPeeringPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PeeringPoliciesClient, error)

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

func (*PeeringPoliciesClient) BeginCreateOrUpdate

func (client *PeeringPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedNetworkName string, managedNetworkPeeringPolicyName string, managedNetworkPolicy PeeringPolicy, options *PeeringPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[PeeringPoliciesClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - The Put ManagedNetworkPeeringPolicies operation creates/updates a new Managed Network Peering Policy If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview resourceGroupName - The name of the resource group. managedNetworkName - The name of the Managed Network. managedNetworkPeeringPolicyName - The name of the Managed Network Peering Policy. managedNetworkPolicy - Parameters supplied to create/update a Managed Network Peering Policy options - PeeringPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the PeeringPoliciesClient.BeginCreateOrUpdate method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ManagedNetworkPeeringPolicy/ManagedNetworkPeeringPoliciesPut.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/managednetwork/armmanagednetwork"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmanagednetwork.NewPeeringPoliciesClient("subscriptionA", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginCreateOrUpdate(ctx,
		"myResourceGroup",
		"myManagedNetwork",
		"myHubAndSpoke",
		armmanagednetwork.PeeringPolicy{
			Properties: &armmanagednetwork.PeeringPolicyProperties{
				Type: to.Ptr(armmanagednetwork.TypeHubAndSpokeTopology),
				Hub: &armmanagednetwork.ResourceID{
					ID: to.Ptr("/subscriptionB/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet"),
				},
				Spokes: []*armmanagednetwork.ResourceID{
					{
						ID: to.Ptr("/subscriptionB/resourceGroups/myResourceGroup/providers/Microsoft.ManagedNetwork/managedNetworks/myManagedNetwork/managedNetworkGroups/myManagedNetworkGroup1"),
					}},
			},
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*PeeringPoliciesClient) BeginDelete

func (client *PeeringPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, managedNetworkName string, managedNetworkPeeringPolicyName string, options *PeeringPoliciesClientBeginDeleteOptions) (*runtime.Poller[PeeringPoliciesClientDeleteResponse], error)

BeginDelete - The Delete ManagedNetworkPeeringPolicies operation deletes a Managed Network Peering Policy, specified by the resource group, Managed Network name, and peering policy name If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview resourceGroupName - The name of the resource group. managedNetworkName - The name of the Managed Network. managedNetworkPeeringPolicyName - The name of the Managed Network Peering Policy. options - PeeringPoliciesClientBeginDeleteOptions contains the optional parameters for the PeeringPoliciesClient.BeginDelete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ManagedNetworkPeeringPolicy/ManagedNetworkPeeringPoliciesDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetwork/armmanagednetwork"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmanagednetwork.NewPeeringPoliciesClient("subscriptionA", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginDelete(ctx,
		"myResourceGroup",
		"myManagedNetwork",
		"myHubAndSpoke",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*PeeringPoliciesClient) Get

func (client *PeeringPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedNetworkName string, managedNetworkPeeringPolicyName string, options *PeeringPoliciesClientGetOptions) (PeeringPoliciesClientGetResponse, error)

Get - The Get ManagedNetworkPeeringPolicies operation gets a Managed Network Peering Policy resource, specified by the resource group, Managed Network name, and peering policy name If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview resourceGroupName - The name of the resource group. managedNetworkName - The name of the Managed Network. managedNetworkPeeringPolicyName - The name of the Managed Network Peering Policy. options - PeeringPoliciesClientGetOptions contains the optional parameters for the PeeringPoliciesClient.Get method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ManagedNetworkPeeringPolicy/ManagedNetworkPeeringPoliciesGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetwork/armmanagednetwork"
)

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

func (*PeeringPoliciesClient) NewListByManagedNetworkPager

func (client *PeeringPoliciesClient) NewListByManagedNetworkPager(resourceGroupName string, managedNetworkName string, options *PeeringPoliciesClientListByManagedNetworkOptions) *runtime.Pager[PeeringPoliciesClientListByManagedNetworkResponse]

NewListByManagedNetworkPager - The ListByManagedNetwork PeeringPolicies operation retrieves all the Managed Network Peering Policies in a specified Managed Network, in a paginated format. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview resourceGroupName - The name of the resource group. managedNetworkName - The name of the Managed Network. options - PeeringPoliciesClientListByManagedNetworkOptions contains the optional parameters for the PeeringPoliciesClient.ListByManagedNetwork method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ManagedNetworkPeeringPolicy/ManagedNetworkPeeringPoliciesListByManagedNetwork.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetwork/armmanagednetwork"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmanagednetwork.NewPeeringPoliciesClient("subscriptionA", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByManagedNetworkPager("myResourceGroup",
		"myManagedNetwork",
		&armmanagednetwork.PeeringPoliciesClientListByManagedNetworkOptions{Top: nil,
			Skiptoken: nil,
		})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type PeeringPoliciesClientBeginCreateOrUpdateOptions

type PeeringPoliciesClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

PeeringPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the PeeringPoliciesClient.BeginCreateOrUpdate method.

type PeeringPoliciesClientBeginDeleteOptions

type PeeringPoliciesClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

PeeringPoliciesClientBeginDeleteOptions contains the optional parameters for the PeeringPoliciesClient.BeginDelete method.

type PeeringPoliciesClientCreateOrUpdateResponse

type PeeringPoliciesClientCreateOrUpdateResponse struct {
	PeeringPolicy
}

PeeringPoliciesClientCreateOrUpdateResponse contains the response from method PeeringPoliciesClient.CreateOrUpdate.

type PeeringPoliciesClientDeleteResponse

type PeeringPoliciesClientDeleteResponse struct {
}

PeeringPoliciesClientDeleteResponse contains the response from method PeeringPoliciesClient.Delete.

type PeeringPoliciesClientGetOptions

type PeeringPoliciesClientGetOptions struct {
}

PeeringPoliciesClientGetOptions contains the optional parameters for the PeeringPoliciesClient.Get method.

type PeeringPoliciesClientGetResponse

type PeeringPoliciesClientGetResponse struct {
	PeeringPolicy
}

PeeringPoliciesClientGetResponse contains the response from method PeeringPoliciesClient.Get.

type PeeringPoliciesClientListByManagedNetworkOptions

type PeeringPoliciesClientListByManagedNetworkOptions struct {
	// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element,
	// the value of the nextLink element will include a skiptoken parameter that
	// specifies a starting point to use for subsequent calls.
	Skiptoken *string
	// May be used to limit the number of results in a page for list queries.
	Top *int32
}

PeeringPoliciesClientListByManagedNetworkOptions contains the optional parameters for the PeeringPoliciesClient.ListByManagedNetwork method.

type PeeringPoliciesClientListByManagedNetworkResponse

type PeeringPoliciesClientListByManagedNetworkResponse struct {
	PeeringPolicyListResult
}

PeeringPoliciesClientListByManagedNetworkResponse contains the response from method PeeringPoliciesClient.ListByManagedNetwork.

type PeeringPolicy

type PeeringPolicy struct {
	// The geo-location where the resource lives
	Location *string `json:"location,omitempty"`

	// Gets or sets the properties of a Managed Network Policy
	Properties *PeeringPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
	Type *string `json:"type,omitempty" azure:"ro"`
}

PeeringPolicy - The Managed Network Peering Policy resource

type PeeringPolicyListResult

type PeeringPolicyListResult struct {
	// Gets the URL to get the next page of results.
	NextLink *string `json:"nextLink,omitempty"`

	// Gets a page of Peering Policies
	Value []*PeeringPolicy `json:"value,omitempty"`
}

PeeringPolicyListResult - Result of the request to list Managed Network Peering Policies. It contains a list of policies and a URL link to get the next set of results.

type PeeringPolicyProperties

type PeeringPolicyProperties struct {
	// REQUIRED; Gets or sets the connectivity type of a network structure policy
	Type *Type `json:"type,omitempty"`

	// Gets or sets the hub virtual network ID
	Hub *ResourceID `json:"hub,omitempty"`

	// Gets or sets the mesh group IDs
	Mesh []*ResourceID `json:"mesh,omitempty"`

	// Gets or sets the spokes group IDs
	Spokes []*ResourceID `json:"spokes,omitempty"`

	// READ-ONLY; A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty" azure:"ro"`

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

PeeringPolicyProperties - Properties of a Managed Network Peering Policy

func (PeeringPolicyProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PeeringPolicyProperties.

type Properties

type Properties struct {
	// The collection of management groups, subscriptions, virtual networks, and subnets by the Managed Network. This is a read-only
	// property that is reflective of all ScopeAssignments for this Managed
	// Network
	Scope *Scope `json:"scope,omitempty"`

	// READ-ONLY; The collection of groups and policies concerned with connectivity
	Connectivity *ConnectivityCollection `json:"connectivity,omitempty" azure:"ro"`

	// READ-ONLY; A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty" azure:"ro"`

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

Properties of Managed Network

type ProvisioningState

type ProvisioningState string

ProvisioningState - Provisioning state of the ManagedNetwork resource.

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

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type ProxyResource

type ProxyResource struct {
	// The geo-location where the resource lives
	Location *string `json:"location,omitempty"`

	// READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
	Type *string `json:"type,omitempty" azure:"ro"`
}

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

type Resource

type Resource struct {
	// The geo-location where the resource lives
	Location *string `json:"location,omitempty"`

	// READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
	Type *string `json:"type,omitempty" azure:"ro"`
}

Resource - The general resource model definition

type ResourceID

type ResourceID struct {
	// Resource Id
	ID *string `json:"id,omitempty"`
}

ResourceID - Generic pointer to a resource

type ResourceProperties

type ResourceProperties struct {
	// READ-ONLY; A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty" azure:"ro"`

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

ResourceProperties - Base for resource properties.

type Scope

type Scope struct {
	// The collection of management groups covered by the Managed Network
	ManagementGroups []*ResourceID `json:"managementGroups,omitempty"`

	// The collection of subnets covered by the Managed Network
	Subnets []*ResourceID `json:"subnets,omitempty"`

	// The collection of subscriptions covered by the Managed Network
	Subscriptions []*ResourceID `json:"subscriptions,omitempty"`

	// The collection of virtual nets covered by the Managed Network
	VirtualNetworks []*ResourceID `json:"virtualNetworks,omitempty"`
}

Scope of a Managed Network

func (Scope) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Scope.

type ScopeAssignment

type ScopeAssignment struct {
	// The geo-location where the resource lives
	Location *string `json:"location,omitempty"`

	// The Scope Assignment properties
	Properties *ScopeAssignmentProperties `json:"properties,omitempty"`

	// READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ScopeAssignment - The Managed Network resource

type ScopeAssignmentListResult

type ScopeAssignmentListResult struct {
	// Gets the URL to get the next set of results.
	NextLink *string `json:"nextLink,omitempty"`

	// Gets a page of ScopeAssignment
	Value []*ScopeAssignment `json:"value,omitempty"`
}

ScopeAssignmentListResult - Result of the request to list ScopeAssignment. It contains a list of groups and a URL link to get the next set of results.

type ScopeAssignmentProperties

type ScopeAssignmentProperties struct {
	// The managed network ID with scope will be assigned to.
	AssignedManagedNetwork *string `json:"assignedManagedNetwork,omitempty"`

	// READ-ONLY; A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty" azure:"ro"`

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

ScopeAssignmentProperties - Properties of Managed Network

type ScopeAssignmentsClient

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

ScopeAssignmentsClient contains the methods for the ScopeAssignments group. Don't use this type directly, use NewScopeAssignmentsClient() instead.

func NewScopeAssignmentsClient

func NewScopeAssignmentsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ScopeAssignmentsClient, error)

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

func (*ScopeAssignmentsClient) CreateOrUpdate

CreateOrUpdate - Creates a scope assignment. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview scope - The base resource of the scope assignment to create. The scope can be any REST resource instance. For example, use 'subscriptions/{subscription-id}' for a subscription, 'subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and 'subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. scopeAssignmentName - The name of the scope assignment to create. parameters - Parameters supplied to the specify which Managed Network this scope is being assigned options - ScopeAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the ScopeAssignmentsClient.CreateOrUpdate method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ScopeAssignment/ScopeAssignmentsPut.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/managednetwork/armmanagednetwork"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmanagednetwork.NewScopeAssignmentsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx,
		"subscriptions/subscriptionC",
		"subscriptionCAssignment",
		armmanagednetwork.ScopeAssignment{
			Properties: &armmanagednetwork.ScopeAssignmentProperties{
				AssignedManagedNetwork: to.Ptr("/subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.ManagedNetwork/managedNetworks/myManagedNetwork"),
			},
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*ScopeAssignmentsClient) Delete

Delete - Deletes a scope assignment. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview scope - The scope of the scope assignment to delete. scopeAssignmentName - The name of the scope assignment to delete. options - ScopeAssignmentsClientDeleteOptions contains the optional parameters for the ScopeAssignmentsClient.Delete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ScopeAssignment/ScopeAssignmentsDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetwork/armmanagednetwork"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmanagednetwork.NewScopeAssignmentsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = client.Delete(ctx,
		"subscriptions/subscriptionC",
		"subscriptionCAssignment",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ScopeAssignmentsClient) Get

Get - Get the specified scope assignment. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview scope - The base resource of the scope assignment. scopeAssignmentName - The name of the scope assignment to get. options - ScopeAssignmentsClientGetOptions contains the optional parameters for the ScopeAssignmentsClient.Get method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ScopeAssignment/ScopeAssignmentsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetwork/armmanagednetwork"
)

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

func (*ScopeAssignmentsClient) NewListPager

NewListPager - Get the specified scope assignment. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-06-01-preview scope - The base resource of the scope assignment. options - ScopeAssignmentsClientListOptions contains the optional parameters for the ScopeAssignmentsClient.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/managednetwork/resource-manager/Microsoft.ManagedNetwork/preview/2019-06-01-preview/examples/ScopeAssignment/ScopeAssignmentsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetwork/armmanagednetwork"
)

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

type ScopeAssignmentsClientCreateOrUpdateOptions

type ScopeAssignmentsClientCreateOrUpdateOptions struct {
}

ScopeAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the ScopeAssignmentsClient.CreateOrUpdate method.

type ScopeAssignmentsClientCreateOrUpdateResponse

type ScopeAssignmentsClientCreateOrUpdateResponse struct {
	ScopeAssignment
}

ScopeAssignmentsClientCreateOrUpdateResponse contains the response from method ScopeAssignmentsClient.CreateOrUpdate.

type ScopeAssignmentsClientDeleteOptions

type ScopeAssignmentsClientDeleteOptions struct {
}

ScopeAssignmentsClientDeleteOptions contains the optional parameters for the ScopeAssignmentsClient.Delete method.

type ScopeAssignmentsClientDeleteResponse

type ScopeAssignmentsClientDeleteResponse struct {
}

ScopeAssignmentsClientDeleteResponse contains the response from method ScopeAssignmentsClient.Delete.

type ScopeAssignmentsClientGetOptions

type ScopeAssignmentsClientGetOptions struct {
}

ScopeAssignmentsClientGetOptions contains the optional parameters for the ScopeAssignmentsClient.Get method.

type ScopeAssignmentsClientGetResponse

type ScopeAssignmentsClientGetResponse struct {
	ScopeAssignment
}

ScopeAssignmentsClientGetResponse contains the response from method ScopeAssignmentsClient.Get.

type ScopeAssignmentsClientListOptions

type ScopeAssignmentsClientListOptions struct {
}

ScopeAssignmentsClientListOptions contains the optional parameters for the ScopeAssignmentsClient.List method.

type ScopeAssignmentsClientListResponse

type ScopeAssignmentsClientListResponse struct {
	ScopeAssignmentListResult
}

ScopeAssignmentsClientListResponse contains the response from method ScopeAssignmentsClient.List.

type TrackedResource

type TrackedResource struct {
	// The geo-location where the resource lives
	Location *string `json:"location,omitempty"`

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

	// READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
	Type *string `json:"type,omitempty" azure:"ro"`
}

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

func (TrackedResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TrackedResource.

type Type

type Type string

Type - Gets or sets the connectivity type of a network structure policy

const (
	TypeHubAndSpokeTopology Type = "HubAndSpokeTopology"
	TypeMeshTopology        Type = "MeshTopology"
)

func PossibleTypeValues

func PossibleTypeValues() []Type

PossibleTypeValues returns the possible values for the Type const type.

type Update

type Update struct {
	// Resource tags
	Tags map[string]*string `json:"tags,omitempty"`
}

Update Tags of Managed Network

func (Update) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Update.

Jump to

Keyboard shortcuts

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