armnetworkfunction

package module
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 14 Imported by: 2

README

Azure Network Function Manager Module for Go

PkgGoDev

The armnetworkfunction module provides operations for working with Azure Network Function Manager.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Network Function Manager module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkfunction/armnetworkfunction

Authorization

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

cred, err := azidentity.NewDefaultAzureCredential(nil)

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

Client Factory

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

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

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

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

Clients

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

client := clientFactory.NewClient()

Fakes

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

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

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Network Function Manager label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIVersionParameter

type APIVersionParameter string
const (
	APIVersionParameterTwoThousandTwentyTwo0501 APIVersionParameter = "2022-05-01"
	APIVersionParameterTwoThousandTwentyTwo0801 APIVersionParameter = "2022-08-01"
	APIVersionParameterTwoThousandTwentyTwo1101 APIVersionParameter = "2022-11-01"
)

func PossibleAPIVersionParameterValues

func PossibleAPIVersionParameterValues() []APIVersionParameter

PossibleAPIVersionParameterValues returns the possible values for the APIVersionParameter const type.

type AzureTrafficCollector

type AzureTrafficCollector struct {
	// REQUIRED; Resource location.
	Location *string

	// Properties of the Azure Traffic Collector.
	Properties *AzureTrafficCollectorPropertiesFormat

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

	// READ-ONLY; A unique read-only string that changes whenever the resource is updated.
	Etag *string

	// READ-ONLY; Resource ID.
	ID *string

	// READ-ONLY; Resource name.
	Name *string

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

	// READ-ONLY; Resource type.
	Type *string
}

AzureTrafficCollector - Azure Traffic Collector resource.

func (AzureTrafficCollector) MarshalJSON

func (a AzureTrafficCollector) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureTrafficCollector.

func (*AzureTrafficCollector) UnmarshalJSON

func (a *AzureTrafficCollector) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureTrafficCollector.

type AzureTrafficCollectorListResult

type AzureTrafficCollectorListResult struct {
	// A list of Traffic Collector resources.
	Value []*AzureTrafficCollector

	// READ-ONLY; The URL to get the next set of results.
	NextLink *string
}

AzureTrafficCollectorListResult - Response for the ListTrafficCollectors API service call.

func (AzureTrafficCollectorListResult) MarshalJSON

func (a AzureTrafficCollectorListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureTrafficCollectorListResult.

func (*AzureTrafficCollectorListResult) UnmarshalJSON

func (a *AzureTrafficCollectorListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureTrafficCollectorListResult.

type AzureTrafficCollectorPropertiesFormat

type AzureTrafficCollectorPropertiesFormat struct {
	// The virtualHub to which the Azure Traffic Collector belongs.
	VirtualHub *ResourceReference

	// READ-ONLY; Collector Policies for Azure Traffic Collector.
	CollectorPolicies []*ResourceReference

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

AzureTrafficCollectorPropertiesFormat - Azure Traffic Collector resource properties.

func (AzureTrafficCollectorPropertiesFormat) MarshalJSON

func (a AzureTrafficCollectorPropertiesFormat) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureTrafficCollectorPropertiesFormat.

func (*AzureTrafficCollectorPropertiesFormat) UnmarshalJSON

func (a *AzureTrafficCollectorPropertiesFormat) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureTrafficCollectorPropertiesFormat.

type AzureTrafficCollectorsByResourceGroupClient

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

AzureTrafficCollectorsByResourceGroupClient contains the methods for the AzureTrafficCollectorsByResourceGroup group. Don't use this type directly, use NewAzureTrafficCollectorsByResourceGroupClient() instead.

func NewAzureTrafficCollectorsByResourceGroupClient

func NewAzureTrafficCollectorsByResourceGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureTrafficCollectorsByResourceGroupClient, error)

NewAzureTrafficCollectorsByResourceGroupClient creates a new instance of AzureTrafficCollectorsByResourceGroupClient with the specified values.

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

func (*AzureTrafficCollectorsByResourceGroupClient) NewListPager

NewListPager - Return list of Azure Traffic Collectors in a Resource Group

Generated from API version 2022-11-01

  • resourceGroupName - The name of the resource group.
  • options - AzureTrafficCollectorsByResourceGroupClientListOptions contains the optional parameters for the AzureTrafficCollectorsByResourceGroupClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorsByResourceGroupList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetworkfunction.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewAzureTrafficCollectorsByResourceGroupClient().NewListPager("rg1", nil)
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.AzureTrafficCollectorListResult = armnetworkfunction.AzureTrafficCollectorListResult{
	// 	Value: []*armnetworkfunction.AzureTrafficCollector{
	// 		{
	// 			Name: to.Ptr("atc"),
	// 			Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc"),
	// 			Location: to.Ptr("West US"),
	// 			Tags: map[string]*string{
	// 				"key1": to.Ptr("value1"),
	// 			},
	// 			Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
	// 			Properties: &armnetworkfunction.AzureTrafficCollectorPropertiesFormat{
	// 				CollectorPolicies: []*armnetworkfunction.ResourceReference{
	// 				},
	// 				ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded),
	// 			},
	// 	}},
	// }
}
Output:

type AzureTrafficCollectorsByResourceGroupClientListOptions

type AzureTrafficCollectorsByResourceGroupClientListOptions struct {
}

AzureTrafficCollectorsByResourceGroupClientListOptions contains the optional parameters for the AzureTrafficCollectorsByResourceGroupClient.NewListPager method.

type AzureTrafficCollectorsByResourceGroupClientListResponse

type AzureTrafficCollectorsByResourceGroupClientListResponse struct {
	// Response for the ListTrafficCollectors API service call.
	AzureTrafficCollectorListResult
}

AzureTrafficCollectorsByResourceGroupClientListResponse contains the response from method AzureTrafficCollectorsByResourceGroupClient.NewListPager.

type AzureTrafficCollectorsBySubscriptionClient

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

AzureTrafficCollectorsBySubscriptionClient contains the methods for the AzureTrafficCollectorsBySubscription group. Don't use this type directly, use NewAzureTrafficCollectorsBySubscriptionClient() instead.

func NewAzureTrafficCollectorsBySubscriptionClient

func NewAzureTrafficCollectorsBySubscriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureTrafficCollectorsBySubscriptionClient, error)

NewAzureTrafficCollectorsBySubscriptionClient creates a new instance of AzureTrafficCollectorsBySubscriptionClient with the specified values.

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

func (*AzureTrafficCollectorsBySubscriptionClient) NewListPager

NewListPager - Return list of Azure Traffic Collectors in a subscription

Generated from API version 2022-11-01

  • options - AzureTrafficCollectorsBySubscriptionClientListOptions contains the optional parameters for the AzureTrafficCollectorsBySubscriptionClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorsBySubscriptionList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetworkfunction.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewAzureTrafficCollectorsBySubscriptionClient().NewListPager(nil)
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.AzureTrafficCollectorListResult = armnetworkfunction.AzureTrafficCollectorListResult{
	// 	Value: []*armnetworkfunction.AzureTrafficCollector{
	// 		{
	// 			Name: to.Ptr("atc"),
	// 			Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc"),
	// 			Location: to.Ptr("West US"),
	// 			Tags: map[string]*string{
	// 				"key1": to.Ptr("value1"),
	// 			},
	// 			Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
	// 			Properties: &armnetworkfunction.AzureTrafficCollectorPropertiesFormat{
	// 				CollectorPolicies: []*armnetworkfunction.ResourceReference{
	// 				},
	// 				ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded),
	// 			},
	// 	}},
	// }
}
Output:

type AzureTrafficCollectorsBySubscriptionClientListOptions

type AzureTrafficCollectorsBySubscriptionClientListOptions struct {
}

AzureTrafficCollectorsBySubscriptionClientListOptions contains the optional parameters for the AzureTrafficCollectorsBySubscriptionClient.NewListPager method.

type AzureTrafficCollectorsBySubscriptionClientListResponse

type AzureTrafficCollectorsBySubscriptionClientListResponse struct {
	// Response for the ListTrafficCollectors API service call.
	AzureTrafficCollectorListResult
}

AzureTrafficCollectorsBySubscriptionClientListResponse contains the response from method AzureTrafficCollectorsBySubscriptionClient.NewListPager.

type AzureTrafficCollectorsClient

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

AzureTrafficCollectorsClient contains the methods for the AzureTrafficCollectors group. Don't use this type directly, use NewAzureTrafficCollectorsClient() instead.

func NewAzureTrafficCollectorsClient

func NewAzureTrafficCollectorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureTrafficCollectorsClient, error)

NewAzureTrafficCollectorsClient creates a new instance of AzureTrafficCollectorsClient with the specified values.

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

func (*AzureTrafficCollectorsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates a Azure Traffic Collector resource If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • resourceGroupName - The name of the resource group.
  • azureTrafficCollectorName - Azure Traffic Collector name
  • parameters - The parameters to provide for the created Azure Traffic Collector.
  • options - AzureTrafficCollectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureTrafficCollectorsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetworkfunction.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAzureTrafficCollectorsClient().BeginCreateOrUpdate(ctx, "rg1", "atc", armnetworkfunction.AzureTrafficCollector{
	Location: to.Ptr("West US"),
	Tags: map[string]*string{
		"key1": to.Ptr("value1"),
	},
	Properties: &armnetworkfunction.AzureTrafficCollectorPropertiesFormat{},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AzureTrafficCollector = armnetworkfunction.AzureTrafficCollector{
// 	Name: to.Ptr("atc"),
// 	Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 		"key1": to.Ptr("value1"),
// 	},
// 	Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
// 	Properties: &armnetworkfunction.AzureTrafficCollectorPropertiesFormat{
// 		CollectorPolicies: []*armnetworkfunction.ResourceReference{
// 		},
// 		ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded),
// 	},
// }
Output:

func (*AzureTrafficCollectorsClient) BeginDelete

BeginDelete - Deletes a specified Azure Traffic Collector resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • resourceGroupName - The name of the resource group.
  • azureTrafficCollectorName - Azure Traffic Collector name
  • options - AzureTrafficCollectorsClientBeginDeleteOptions contains the optional parameters for the AzureTrafficCollectorsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetworkfunction.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAzureTrafficCollectorsClient().BeginDelete(ctx, "rg1", "atc", 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 (*AzureTrafficCollectorsClient) Get

func (client *AzureTrafficCollectorsClient) Get(ctx context.Context, resourceGroupName string, azureTrafficCollectorName string, options *AzureTrafficCollectorsClientGetOptions) (AzureTrafficCollectorsClientGetResponse, error)

Get - Gets the specified Azure Traffic Collector in a specified resource group If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • resourceGroupName - The name of the resource group.
  • azureTrafficCollectorName - Azure Traffic Collector name
  • options - AzureTrafficCollectorsClientGetOptions contains the optional parameters for the AzureTrafficCollectorsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetworkfunction.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAzureTrafficCollectorsClient().Get(ctx, "rg1", "atc", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AzureTrafficCollector = armnetworkfunction.AzureTrafficCollector{
// 	Name: to.Ptr("atc"),
// 	Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 		"key1": to.Ptr("value1"),
// 	},
// 	Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
// 	Properties: &armnetworkfunction.AzureTrafficCollectorPropertiesFormat{
// 		CollectorPolicies: []*armnetworkfunction.ResourceReference{
// 		},
// 		ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded),
// 	},
// }
Output:

func (*AzureTrafficCollectorsClient) UpdateTags

func (client *AzureTrafficCollectorsClient) UpdateTags(ctx context.Context, resourceGroupName string, azureTrafficCollectorName string, parameters TagsObject, options *AzureTrafficCollectorsClientUpdateTagsOptions) (AzureTrafficCollectorsClientUpdateTagsResponse, error)

UpdateTags - Updates the specified Azure Traffic Collector tags. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • resourceGroupName - The name of the resource group.
  • azureTrafficCollectorName - Azure Traffic Collector name
  • parameters - Parameters supplied to update Azure Traffic Collector tags.
  • options - AzureTrafficCollectorsClientUpdateTagsOptions contains the optional parameters for the AzureTrafficCollectorsClient.UpdateTags method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorUpdateTags.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetworkfunction.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAzureTrafficCollectorsClient().UpdateTags(ctx, "rg1", "atc", armnetworkfunction.TagsObject{
	Tags: map[string]*string{
		"key1": to.Ptr("value1"),
		"key2": to.Ptr("value2"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AzureTrafficCollector = armnetworkfunction.AzureTrafficCollector{
// 	Name: to.Ptr("atc"),
// 	Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc"),
// 	Location: to.Ptr("West US"),
// 	Tags: map[string]*string{
// 		"key1": to.Ptr("value1"),
// 		"key2": to.Ptr("value2"),
// 	},
// 	Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
// 	Properties: &armnetworkfunction.AzureTrafficCollectorPropertiesFormat{
// 		CollectorPolicies: []*armnetworkfunction.ResourceReference{
// 		},
// 		ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded),
// 	},
// }
Output:

type AzureTrafficCollectorsClientBeginCreateOrUpdateOptions

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

AzureTrafficCollectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureTrafficCollectorsClient.BeginCreateOrUpdate method.

type AzureTrafficCollectorsClientBeginDeleteOptions

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

AzureTrafficCollectorsClientBeginDeleteOptions contains the optional parameters for the AzureTrafficCollectorsClient.BeginDelete method.

type AzureTrafficCollectorsClientCreateOrUpdateResponse

type AzureTrafficCollectorsClientCreateOrUpdateResponse struct {
	// Azure Traffic Collector resource.
	AzureTrafficCollector
}

AzureTrafficCollectorsClientCreateOrUpdateResponse contains the response from method AzureTrafficCollectorsClient.BeginCreateOrUpdate.

type AzureTrafficCollectorsClientDeleteResponse

type AzureTrafficCollectorsClientDeleteResponse struct {
}

AzureTrafficCollectorsClientDeleteResponse contains the response from method AzureTrafficCollectorsClient.BeginDelete.

type AzureTrafficCollectorsClientGetOptions

type AzureTrafficCollectorsClientGetOptions struct {
}

AzureTrafficCollectorsClientGetOptions contains the optional parameters for the AzureTrafficCollectorsClient.Get method.

type AzureTrafficCollectorsClientGetResponse

type AzureTrafficCollectorsClientGetResponse struct {
	// Azure Traffic Collector resource.
	AzureTrafficCollector
}

AzureTrafficCollectorsClientGetResponse contains the response from method AzureTrafficCollectorsClient.Get.

type AzureTrafficCollectorsClientUpdateTagsOptions

type AzureTrafficCollectorsClientUpdateTagsOptions struct {
}

AzureTrafficCollectorsClientUpdateTagsOptions contains the optional parameters for the AzureTrafficCollectorsClient.UpdateTags method.

type AzureTrafficCollectorsClientUpdateTagsResponse

type AzureTrafficCollectorsClientUpdateTagsResponse struct {
	// Azure Traffic Collector resource.
	AzureTrafficCollector
}

AzureTrafficCollectorsClientUpdateTagsResponse contains the response from method AzureTrafficCollectorsClient.UpdateTags.

type Client

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

Client contains the methods for the NetworkFunction group. Don't use this type directly, use NewClient() instead.

func NewClient

func NewClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error)

NewClient creates a new instance of Client with the specified values.

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

func (*Client) NewListOperationsPager

func (client *Client) NewListOperationsPager(options *ClientListOperationsOptions) *runtime.Pager[ClientListOperationsResponse]

NewListOperationsPager - Lists all of the available NetworkFunction Rest API operations.

Generated from API version 2022-11-01

  • options - ClientListOperationsOptions contains the optional parameters for the Client.NewListOperationsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/OperationsList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetworkfunction.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewClient().NewListOperationsPager(nil)
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.OperationListResult = armnetworkfunction.OperationListResult{
	// 	Value: []*armnetworkfunction.Operation{
	// 		{
	// 			Name: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors/write"),
	// 			Display: &armnetworkfunction.OperationDisplay{
	// 				Description: to.Ptr("Creates or Update a azure traffic collector"),
	// 				Operation: to.Ptr("Create/Update a azure traffic collector"),
	// 				Provider: to.Ptr("Microsoft NetworkFunction"),
	// 				Resource: to.Ptr("AzureTrafficCollector"),
	// 			},
	// 	}},
	// }
}
Output:

type ClientFactory added in v2.1.0

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

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

func NewClientFactory added in v2.1.0

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

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

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

func (*ClientFactory) NewAzureTrafficCollectorsByResourceGroupClient added in v2.1.0

func (c *ClientFactory) NewAzureTrafficCollectorsByResourceGroupClient() *AzureTrafficCollectorsByResourceGroupClient

NewAzureTrafficCollectorsByResourceGroupClient creates a new instance of AzureTrafficCollectorsByResourceGroupClient.

func (*ClientFactory) NewAzureTrafficCollectorsBySubscriptionClient added in v2.1.0

func (c *ClientFactory) NewAzureTrafficCollectorsBySubscriptionClient() *AzureTrafficCollectorsBySubscriptionClient

NewAzureTrafficCollectorsBySubscriptionClient creates a new instance of AzureTrafficCollectorsBySubscriptionClient.

func (*ClientFactory) NewAzureTrafficCollectorsClient added in v2.1.0

func (c *ClientFactory) NewAzureTrafficCollectorsClient() *AzureTrafficCollectorsClient

NewAzureTrafficCollectorsClient creates a new instance of AzureTrafficCollectorsClient.

func (*ClientFactory) NewClient added in v2.1.0

func (c *ClientFactory) NewClient() *Client

NewClient creates a new instance of Client.

func (*ClientFactory) NewCollectorPoliciesClient added in v2.1.0

func (c *ClientFactory) NewCollectorPoliciesClient() *CollectorPoliciesClient

NewCollectorPoliciesClient creates a new instance of CollectorPoliciesClient.

type ClientListOperationsOptions

type ClientListOperationsOptions struct {
}

ClientListOperationsOptions contains the optional parameters for the Client.NewListOperationsPager method.

type ClientListOperationsResponse

type ClientListOperationsResponse struct {
	// Result of the request to list Azure Traffic Collector operations. It contains a list of operations and a URL link to get
	// the next set of results.
	OperationListResult
}

ClientListOperationsResponse contains the response from method Client.NewListOperationsPager.

type CollectorPoliciesClient

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

CollectorPoliciesClient contains the methods for the CollectorPolicies group. Don't use this type directly, use NewCollectorPoliciesClient() instead.

func NewCollectorPoliciesClient

func NewCollectorPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CollectorPoliciesClient, error)

NewCollectorPoliciesClient creates a new instance of CollectorPoliciesClient with the specified values.

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

func (*CollectorPoliciesClient) BeginCreateOrUpdate

func (client *CollectorPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, azureTrafficCollectorName string, collectorPolicyName string, parameters CollectorPolicy, options *CollectorPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[CollectorPoliciesClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates a Collector Policy resource If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • resourceGroupName - The name of the resource group.
  • azureTrafficCollectorName - Azure Traffic Collector name
  • collectorPolicyName - Collector Policy Name
  • parameters - The parameters to provide for the created Collector Policy.
  • options - CollectorPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the CollectorPoliciesClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyCreate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetworkfunction.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCollectorPoliciesClient().BeginCreateOrUpdate(ctx, "rg1", "atc", "cp1", armnetworkfunction.CollectorPolicy{
	Location: to.Ptr("West US"),
	Properties: &armnetworkfunction.CollectorPolicyPropertiesFormat{
		EmissionPolicies: []*armnetworkfunction.EmissionPoliciesPropertiesFormat{
			{
				EmissionDestinations: []*armnetworkfunction.EmissionPolicyDestination{
					{
						DestinationType: to.Ptr(armnetworkfunction.DestinationTypeAzureMonitor),
					}},
				EmissionType: to.Ptr(armnetworkfunction.EmissionTypeIPFIX),
			}},
		IngestionPolicy: &armnetworkfunction.IngestionPolicyPropertiesFormat{
			IngestionSources: []*armnetworkfunction.IngestionSourcesPropertiesFormat{
				{
					ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"),
					SourceType: to.Ptr(armnetworkfunction.SourceTypeResource),
				}},
			IngestionType: to.Ptr(armnetworkfunction.IngestionTypeIPFIX),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CollectorPolicy = armnetworkfunction.CollectorPolicy{
// 	Name: to.Ptr("cp1"),
// 	Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/AzureTrafficCollector/atc/collectorPolicies/cp1"),
// 	Location: to.Ptr("westus"),
// 	Etag: to.Ptr("w/\\72090554-7e3b-43f2-80ad-99a9020dcb11\\"),
// 	Properties: &armnetworkfunction.CollectorPolicyPropertiesFormat{
// 		EmissionPolicies: []*armnetworkfunction.EmissionPoliciesPropertiesFormat{
// 			{
// 				EmissionDestinations: []*armnetworkfunction.EmissionPolicyDestination{
// 					{
// 						DestinationType: to.Ptr(armnetworkfunction.DestinationTypeAzureMonitor),
// 				}},
// 				EmissionType: to.Ptr(armnetworkfunction.EmissionTypeIPFIX),
// 		}},
// 		IngestionPolicy: &armnetworkfunction.IngestionPolicyPropertiesFormat{
// 			IngestionSources: []*armnetworkfunction.IngestionSourcesPropertiesFormat{
// 				{
// 					ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"),
// 					SourceType: to.Ptr(armnetworkfunction.SourceTypeResource),
// 			}},
// 			IngestionType: to.Ptr(armnetworkfunction.IngestionTypeIPFIX),
// 		},
// 		ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded),
// 	},
// }
Output:

func (*CollectorPoliciesClient) BeginDelete

func (client *CollectorPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, azureTrafficCollectorName string, collectorPolicyName string, options *CollectorPoliciesClientBeginDeleteOptions) (*runtime.Poller[CollectorPoliciesClientDeleteResponse], error)

BeginDelete - Deletes a specified Collector Policy resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • resourceGroupName - The name of the resource group.
  • azureTrafficCollectorName - Azure Traffic Collector name
  • collectorPolicyName - Collector Policy Name
  • options - CollectorPoliciesClientBeginDeleteOptions contains the optional parameters for the CollectorPoliciesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetworkfunction.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCollectorPoliciesClient().BeginDelete(ctx, "rg1", "atc", "cp1", 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 (*CollectorPoliciesClient) Get

func (client *CollectorPoliciesClient) Get(ctx context.Context, resourceGroupName string, azureTrafficCollectorName string, collectorPolicyName string, options *CollectorPoliciesClientGetOptions) (CollectorPoliciesClientGetResponse, error)

Get - Gets the collector policy in a specified Traffic Collector If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • resourceGroupName - The name of the resource group.
  • azureTrafficCollectorName - Azure Traffic Collector name
  • collectorPolicyName - Collector Policy Name
  • options - CollectorPoliciesClientGetOptions contains the optional parameters for the CollectorPoliciesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyGet.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetworkfunction.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCollectorPoliciesClient().Get(ctx, "rg1", "atc", "cp1", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CollectorPolicy = armnetworkfunction.CollectorPolicy{
// 	Name: to.Ptr("atc"),
// 	Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc/collectorPolicies/cp1"),
// 	Location: to.Ptr("westus"),
// 	Etag: to.Ptr("w/\\72090554-7e3b-43f2-80ad-99a9020dcb11\\"),
// 	Properties: &armnetworkfunction.CollectorPolicyPropertiesFormat{
// 		EmissionPolicies: []*armnetworkfunction.EmissionPoliciesPropertiesFormat{
// 			{
// 				EmissionDestinations: []*armnetworkfunction.EmissionPolicyDestination{
// 					{
// 						DestinationType: to.Ptr(armnetworkfunction.DestinationTypeAzureMonitor),
// 				}},
// 				EmissionType: to.Ptr(armnetworkfunction.EmissionTypeIPFIX),
// 		}},
// 		IngestionPolicy: &armnetworkfunction.IngestionPolicyPropertiesFormat{
// 			IngestionSources: []*armnetworkfunction.IngestionSourcesPropertiesFormat{
// 				{
// 					ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"),
// 					SourceType: to.Ptr(armnetworkfunction.SourceTypeResource),
// 			}},
// 			IngestionType: to.Ptr(armnetworkfunction.IngestionTypeIPFIX),
// 		},
// 		ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded),
// 	},
// }
Output:

func (*CollectorPoliciesClient) NewListPager

func (client *CollectorPoliciesClient) NewListPager(resourceGroupName string, azureTrafficCollectorName string, options *CollectorPoliciesClientListOptions) *runtime.Pager[CollectorPoliciesClientListResponse]

NewListPager - Return list of Collector policies in a Azure Traffic Collector

Generated from API version 2022-11-01

  • resourceGroupName - The name of the resource group.
  • azureTrafficCollectorName - Azure Traffic Collector name
  • options - CollectorPoliciesClientListOptions contains the optional parameters for the CollectorPoliciesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPoliciesList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetworkfunction.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewCollectorPoliciesClient().NewListPager("rg1", "atc", nil)
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.CollectorPolicyListResult = armnetworkfunction.CollectorPolicyListResult{
	// 	Value: []*armnetworkfunction.CollectorPolicy{
	// 		{
	// 			Name: to.Ptr("atc"),
	// 			Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc/collectorPolicies/cp1"),
	// 			Location: to.Ptr("westus"),
	// 			Etag: to.Ptr("w/\\72090554-7e3b-43f2-80ad-99a9020dcb11\\"),
	// 			Properties: &armnetworkfunction.CollectorPolicyPropertiesFormat{
	// 				EmissionPolicies: []*armnetworkfunction.EmissionPoliciesPropertiesFormat{
	// 					{
	// 						EmissionDestinations: []*armnetworkfunction.EmissionPolicyDestination{
	// 							{
	// 								DestinationType: to.Ptr(armnetworkfunction.DestinationTypeAzureMonitor),
	// 						}},
	// 						EmissionType: to.Ptr(armnetworkfunction.EmissionTypeIPFIX),
	// 				}},
	// 				IngestionPolicy: &armnetworkfunction.IngestionPolicyPropertiesFormat{
	// 					IngestionSources: []*armnetworkfunction.IngestionSourcesPropertiesFormat{
	// 						{
	// 							ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"),
	// 							SourceType: to.Ptr(armnetworkfunction.SourceTypeResource),
	// 					}},
	// 					IngestionType: to.Ptr(armnetworkfunction.IngestionTypeIPFIX),
	// 				},
	// 				ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded),
	// 			},
	// 	}},
	// }
}
Output:

func (*CollectorPoliciesClient) UpdateTags

func (client *CollectorPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, azureTrafficCollectorName string, collectorPolicyName string, parameters TagsObject, options *CollectorPoliciesClientUpdateTagsOptions) (CollectorPoliciesClientUpdateTagsResponse, error)

UpdateTags - Updates the specified Collector Policy tags. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-11-01

  • resourceGroupName - The name of the resource group.
  • azureTrafficCollectorName - Azure Traffic Collector name
  • collectorPolicyName - Collector Policy Name
  • parameters - Parameters supplied to update Collector Policy tags.
  • options - CollectorPoliciesClientUpdateTagsOptions contains the optional parameters for the CollectorPoliciesClient.UpdateTags method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyUpdateTags.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetworkfunction.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCollectorPoliciesClient().UpdateTags(ctx, "rg1", "atc", "cp1", armnetworkfunction.TagsObject{
	Tags: map[string]*string{
		"key1": to.Ptr("value1"),
		"key2": to.Ptr("value2"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CollectorPolicy = armnetworkfunction.CollectorPolicy{
// 	Name: to.Ptr("atc"),
// 	Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies"),
// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc/collectorPolicies/cp1"),
// 	Location: to.Ptr("westus"),
// 	Tags: map[string]*string{
// 		"key1": to.Ptr("value1"),
// 		"key2": to.Ptr("value2"),
// 	},
// 	Etag: to.Ptr("w/\\72090554-7e3b-43f2-80ad-99a9020dcb11\\"),
// 	Properties: &armnetworkfunction.CollectorPolicyPropertiesFormat{
// 		EmissionPolicies: []*armnetworkfunction.EmissionPoliciesPropertiesFormat{
// 			{
// 				EmissionDestinations: []*armnetworkfunction.EmissionPolicyDestination{
// 					{
// 						DestinationType: to.Ptr(armnetworkfunction.DestinationTypeAzureMonitor),
// 				}},
// 				EmissionType: to.Ptr(armnetworkfunction.EmissionTypeIPFIX),
// 		}},
// 		IngestionPolicy: &armnetworkfunction.IngestionPolicyPropertiesFormat{
// 			IngestionSources: []*armnetworkfunction.IngestionSourcesPropertiesFormat{
// 				{
// 					ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"),
// 					SourceType: to.Ptr(armnetworkfunction.SourceTypeResource),
// 			}},
// 			IngestionType: to.Ptr(armnetworkfunction.IngestionTypeIPFIX),
// 		},
// 		ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded),
// 	},
// }
Output:

type CollectorPoliciesClientBeginCreateOrUpdateOptions

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

CollectorPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the CollectorPoliciesClient.BeginCreateOrUpdate method.

type CollectorPoliciesClientBeginDeleteOptions

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

CollectorPoliciesClientBeginDeleteOptions contains the optional parameters for the CollectorPoliciesClient.BeginDelete method.

type CollectorPoliciesClientCreateOrUpdateResponse

type CollectorPoliciesClientCreateOrUpdateResponse struct {
	// Collector policy resource.
	CollectorPolicy
}

CollectorPoliciesClientCreateOrUpdateResponse contains the response from method CollectorPoliciesClient.BeginCreateOrUpdate.

type CollectorPoliciesClientDeleteResponse

type CollectorPoliciesClientDeleteResponse struct {
}

CollectorPoliciesClientDeleteResponse contains the response from method CollectorPoliciesClient.BeginDelete.

type CollectorPoliciesClientGetOptions

type CollectorPoliciesClientGetOptions struct {
}

CollectorPoliciesClientGetOptions contains the optional parameters for the CollectorPoliciesClient.Get method.

type CollectorPoliciesClientGetResponse

type CollectorPoliciesClientGetResponse struct {
	// Collector policy resource.
	CollectorPolicy
}

CollectorPoliciesClientGetResponse contains the response from method CollectorPoliciesClient.Get.

type CollectorPoliciesClientListOptions

type CollectorPoliciesClientListOptions struct {
}

CollectorPoliciesClientListOptions contains the optional parameters for the CollectorPoliciesClient.NewListPager method.

type CollectorPoliciesClientListResponse

type CollectorPoliciesClientListResponse struct {
	// Response for the ListCollectorPolicies API service call.
	CollectorPolicyListResult
}

CollectorPoliciesClientListResponse contains the response from method CollectorPoliciesClient.NewListPager.

type CollectorPoliciesClientUpdateTagsOptions

type CollectorPoliciesClientUpdateTagsOptions struct {
}

CollectorPoliciesClientUpdateTagsOptions contains the optional parameters for the CollectorPoliciesClient.UpdateTags method.

type CollectorPoliciesClientUpdateTagsResponse

type CollectorPoliciesClientUpdateTagsResponse struct {
	// Collector policy resource.
	CollectorPolicy
}

CollectorPoliciesClientUpdateTagsResponse contains the response from method CollectorPoliciesClient.UpdateTags.

type CollectorPolicy

type CollectorPolicy struct {
	// REQUIRED; Resource location.
	Location *string

	// Properties of the Collector Policy.
	Properties *CollectorPolicyPropertiesFormat

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

	// READ-ONLY; A unique read-only string that changes whenever the resource is updated.
	Etag *string

	// READ-ONLY; Resource ID.
	ID *string

	// READ-ONLY; Resource name.
	Name *string

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

	// READ-ONLY; Resource type.
	Type *string
}

CollectorPolicy - Collector policy resource.

func (CollectorPolicy) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CollectorPolicy.

func (*CollectorPolicy) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CollectorPolicy.

type CollectorPolicyListResult

type CollectorPolicyListResult struct {
	// A list of collection policies.
	Value []*CollectorPolicy

	// READ-ONLY; The URL to get the next set of results.
	NextLink *string
}

CollectorPolicyListResult - Response for the ListCollectorPolicies API service call.

func (CollectorPolicyListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CollectorPolicyListResult.

func (*CollectorPolicyListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CollectorPolicyListResult.

type CollectorPolicyPropertiesFormat

type CollectorPolicyPropertiesFormat struct {
	// Emission policies.
	EmissionPolicies []*EmissionPoliciesPropertiesFormat

	// Ingestion policies.
	IngestionPolicy *IngestionPolicyPropertiesFormat

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

CollectorPolicyPropertiesFormat - Collection policy properties.

func (CollectorPolicyPropertiesFormat) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CollectorPolicyPropertiesFormat.

func (*CollectorPolicyPropertiesFormat) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CollectorPolicyPropertiesFormat.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

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

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type DestinationType

type DestinationType string

DestinationType - Emission destination type.

const (
	DestinationTypeAzureMonitor DestinationType = "AzureMonitor"
)

func PossibleDestinationTypeValues

func PossibleDestinationTypeValues() []DestinationType

PossibleDestinationTypeValues returns the possible values for the DestinationType const type.

type EmissionPoliciesPropertiesFormat

type EmissionPoliciesPropertiesFormat struct {
	// Emission policy destinations.
	EmissionDestinations []*EmissionPolicyDestination

	// Emission format type.
	EmissionType *EmissionType
}

EmissionPoliciesPropertiesFormat - Emission policy properties.

func (EmissionPoliciesPropertiesFormat) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EmissionPoliciesPropertiesFormat.

func (*EmissionPoliciesPropertiesFormat) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type EmissionPoliciesPropertiesFormat.

type EmissionPolicyDestination

type EmissionPolicyDestination struct {
	// Emission destination type.
	DestinationType *DestinationType
}

EmissionPolicyDestination - Emission policy destination properties.

func (EmissionPolicyDestination) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EmissionPolicyDestination.

func (*EmissionPolicyDestination) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type EmissionPolicyDestination.

type EmissionType

type EmissionType string

EmissionType - Emission format type.

const (
	EmissionTypeIPFIX EmissionType = "IPFIX"
)

func PossibleEmissionTypeValues

func PossibleEmissionTypeValues() []EmissionType

PossibleEmissionTypeValues returns the possible values for the EmissionType const type.

type IngestionPolicyPropertiesFormat

type IngestionPolicyPropertiesFormat struct {
	// Ingestion Sources.
	IngestionSources []*IngestionSourcesPropertiesFormat

	// The ingestion type.
	IngestionType *IngestionType
}

IngestionPolicyPropertiesFormat - Ingestion Policy properties.

func (IngestionPolicyPropertiesFormat) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type IngestionPolicyPropertiesFormat.

func (*IngestionPolicyPropertiesFormat) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type IngestionPolicyPropertiesFormat.

type IngestionSourcesPropertiesFormat

type IngestionSourcesPropertiesFormat struct {
	// Resource ID.
	ResourceID *string

	// Ingestion source type.
	SourceType *SourceType
}

IngestionSourcesPropertiesFormat - Ingestion policy properties.

func (IngestionSourcesPropertiesFormat) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type IngestionSourcesPropertiesFormat.

func (*IngestionSourcesPropertiesFormat) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type IngestionSourcesPropertiesFormat.

type IngestionType

type IngestionType string

IngestionType - The ingestion type.

const (
	IngestionTypeIPFIX IngestionType = "IPFIX"
)

func PossibleIngestionTypeValues

func PossibleIngestionTypeValues() []IngestionType

PossibleIngestionTypeValues returns the possible values for the IngestionType const type.

type Operation

type Operation struct {
	// Display metadata associated with the operation.
	Display *OperationDisplay

	// Indicates whether the operation is a data action
	IsDataAction *bool

	// Operation name: {provider}/{resource}/{operation}
	Name *string

	// Origin of the operation
	Origin *string
}

Operation - Azure Traffic Collector REST API operation definition.

func (Operation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// Description of the operation.
	Description *string

	// Type of operation: get, read, delete, etc.
	Operation *string

	// Service provider: Microsoft NetworkFunction.
	Provider *string

	// Resource on which the operation is performed etc.
	Resource *string
}

OperationDisplay - Display metadata associated with the operation.

func (OperationDisplay) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// URL to get the next set of operation list results if there are any.
	NextLink *string

	// List of operations supported by the Azure Traffic Collector resource provider.
	Value []*Operation
}

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

func (OperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type ProvisioningState

type ProvisioningState string

ProvisioningState - The current provisioning state.

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 {
	// READ-ONLY; Azure resource Id
	ID *string

	// READ-ONLY; Azure resource name
	Name *string

	// READ-ONLY; Azure resource type
	Type *string
}

ProxyResource - An azure resource object

func (ProxyResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ProxyResource.

func (*ProxyResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.

type ResourceReference

type ResourceReference struct {
	// READ-ONLY; Resource ID.
	ID *string
}

ResourceReference - Resource reference properties.

func (ResourceReference) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ResourceReference.

func (*ResourceReference) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceReference.

type SourceType

type SourceType string

SourceType - Ingestion source type.

const (
	SourceTypeResource SourceType = "Resource"
)

func PossibleSourceTypeValues

func PossibleSourceTypeValues() []SourceType

PossibleSourceTypeValues returns the possible values for the SourceType const type.

type SystemData

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

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

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

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

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

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

func (SystemData) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type TagsObject

type TagsObject struct {
	// Resource tags.
	Tags map[string]*string
}

TagsObject - Tags object for patch operations.

func (TagsObject) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TagsObject.

func (*TagsObject) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagsObject.

type TrackedResource

type TrackedResource struct {
	// REQUIRED; Resource location.
	Location *string

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

	// READ-ONLY; Resource ID.
	ID *string

	// READ-ONLY; Resource name.
	Name *string

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

	// READ-ONLY; Resource type.
	Type *string
}

TrackedResource - Common resource representation.

func (TrackedResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TrackedResource.

func (*TrackedResource) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.

type TrackedResourceSystemData

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

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

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

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

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

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

func (TrackedResourceSystemData) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TrackedResourceSystemData.

func (*TrackedResourceSystemData) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResourceSystemData.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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