armapplicationinsights

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 15 Imported by: 11

README

Azure Application Insight Module for Go

PkgGoDev

The armapplicationinsights module provides operations for working with Azure Application Insight.

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 Application Insight module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Application Insight. 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 Application Insight 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 := armapplicationinsights.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 := armapplicationinsights.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.NewAPIKeysClient()

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 Application Insight 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 APIKeyRequest

type APIKeyRequest struct {
	// The read access rights of this API Key.
	LinkedReadProperties []*string

	// The write access rights of this API Key.
	LinkedWriteProperties []*string

	// The name of the API Key.
	Name *string
}

APIKeyRequest - An Application Insights component API Key creation request definition.

func (APIKeyRequest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APIKeyRequest.

func (*APIKeyRequest) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIKeyRequest.

type APIKeysClient

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

APIKeysClient contains the methods for the APIKeys group. Don't use this type directly, use NewAPIKeysClient() instead.

func NewAPIKeysClient

func NewAPIKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIKeysClient, error)

NewAPIKeysClient creates a new instance of APIKeysClient with the specified values.

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

func (*APIKeysClient) Create

func (client *APIKeysClient) Create(ctx context.Context, resourceGroupName string, resourceName string, apiKeyProperties APIKeyRequest, options *APIKeysClientCreateOptions) (APIKeysClientCreateResponse, error)

Create - Create an API Key of an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • apiKeyProperties - Properties that need to be specified to create an API key of a Application Insights component.
  • options - APIKeysClientCreateOptions contains the optional parameters for the APIKeysClient.Create method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysCreate.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIKeysClient().Create(ctx, "my-resource-group", "my-component", armapplicationinsights.APIKeyRequest{
		Name: to.Ptr("test2"),
		LinkedReadProperties: []*string{
			to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/api"),
			to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/agentconfig")},
		LinkedWriteProperties: []*string{
			to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/annotations")},
	}, 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.ComponentAPIKey = armapplicationinsights.ComponentAPIKey{
	// 	Name: to.Ptr("test"),
	// 	APIKey: to.Ptr("eip8wlzuzlf4wzczhnzao54zcswew25azs4kadhb"),
	// 	CreatedDate: to.Ptr("Thu, 28 Sep 2017 16:58:52 GMT"),
	// 	ID: to.Ptr("/subscriptions/subid/resourcegroups/my-resource-group/providers/Microsoft.Insights/components/my-component/apikeys/fe2e0138-47c1-46c5-8726-872f54c1ca08"),
	// 	LinkedReadProperties: []*string{
	// 		to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/api"),
	// 		to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/agentconfig")},
	// 		LinkedWriteProperties: []*string{
	// 			to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/annotations")},
	// 		}
}
Output:

func (*APIKeysClient) Delete

func (client *APIKeysClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, keyID string, options *APIKeysClientDeleteOptions) (APIKeysClientDeleteResponse, error)

Delete - Delete an API Key of an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • keyID - The API Key ID. This is unique within a Application Insights component.
  • options - APIKeysClientDeleteOptions contains the optional parameters for the APIKeysClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIKeysClient().Delete(ctx, "my-resource-group", "my-component", "bb820f1b-3110-4a8b-ba2c-8c1129d7eb6a", 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.ComponentAPIKey = armapplicationinsights.ComponentAPIKey{
	// 	Name: to.Ptr("test2"),
	// 	CreatedDate: to.Ptr("Thu, 28 Sep 2017 16:59:18 GMT"),
	// 	ID: to.Ptr("/subscriptions/subid/resourcegroups/my-resource-group/providers/Microsoft.Insights/components/my-component/apikeys/bb820f1b-3110-4a8b-ba2c-8c1129d7eb6a"),
	// 	LinkedReadProperties: []*string{
	// 		to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/api"),
	// 		to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/draft"),
	// 		to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/extendqueries"),
	// 		to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/search"),
	// 		to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/aggregate"),
	// 		to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/agentconfig")},
	// 		LinkedWriteProperties: []*string{
	// 		},
	// 	}
}
Output:

func (*APIKeysClient) Get

func (client *APIKeysClient) Get(ctx context.Context, resourceGroupName string, resourceName string, keyID string, options *APIKeysClientGetOptions) (APIKeysClientGetResponse, error)

Get - Get the API Key for this key id. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • keyID - The API Key ID. This is unique within a Application Insights component.
  • options - APIKeysClientGetOptions contains the optional parameters for the APIKeysClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIKeysClient().Get(ctx, "my-resource-group", "my-component", "bb820f1b-3110-4a8b-ba2c-8c1129d7eb6a", 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.ComponentAPIKey = armapplicationinsights.ComponentAPIKey{
	// 	Name: to.Ptr("test2"),
	// 	CreatedDate: to.Ptr("Thu, 28 Sep 2017 16:59:18 GMT"),
	// 	ID: to.Ptr("/subscriptions/subid/resourcegroups/my-resource-group/providers/Microsoft.Insights/components/my-component/apikeys/bb820f1b-3110-4a8b-ba2c-8c1129d7eb6a"),
	// 	LinkedReadProperties: []*string{
	// 		to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/api"),
	// 		to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/draft"),
	// 		to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/extendqueries"),
	// 		to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/search"),
	// 		to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/aggregate"),
	// 		to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/agentconfig")},
	// 		LinkedWriteProperties: []*string{
	// 		},
	// 	}
}
Output:

func (*APIKeysClient) NewListPager added in v0.4.0

func (client *APIKeysClient) NewListPager(resourceGroupName string, resourceName string, options *APIKeysClientListOptions) *runtime.Pager[APIKeysClientListResponse]

NewListPager - Gets a list of API keys of an Application Insights component.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - APIKeysClientListOptions contains the optional parameters for the APIKeysClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPIKeysClient().NewListPager("my-resource-group", "my-component", 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.ComponentAPIKeyListResult = armapplicationinsights.ComponentAPIKeyListResult{
		// 	Value: []*armapplicationinsights.ComponentAPIKey{
		// 		{
		// 			Name: to.Ptr("test"),
		// 			CreatedDate: to.Ptr("Thu, 28 Sep 2017 16:58:52 GMT"),
		// 			ID: to.Ptr("/subscriptions/subid/resourcegroups/my-resource-group/providers/Microsoft.Insights/components/my-component/apikeys/fe2e0138-47c1-46c5-8726-872f54c1ca08"),
		// 			LinkedReadProperties: []*string{
		// 				to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/api"),
		// 				to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/draft"),
		// 				to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/extendqueries"),
		// 				to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/search"),
		// 				to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/aggregate"),
		// 				to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/agentconfig")},
		// 				LinkedWriteProperties: []*string{
		// 					to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/annotations")},
		// 				},
		// 				{
		// 					Name: to.Ptr("test2"),
		// 					CreatedDate: to.Ptr("Thu, 28 Sep 2017 16:59:18 GMT"),
		// 					ID: to.Ptr("/subscriptions/subid/resourcegroups/my-resource-group/providers/Microsoft.Insights/components/my-component/apikeys/bb820f1b-3110-4a8b-ba2c-8c1129d7eb6a"),
		// 					LinkedReadProperties: []*string{
		// 						to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/api"),
		// 						to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/draft"),
		// 						to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/extendqueries"),
		// 						to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/search"),
		// 						to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/aggregate"),
		// 						to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/agentconfig")},
		// 						LinkedWriteProperties: []*string{
		// 						},
		// 				}},
		// 			}
	}
}
Output:

type APIKeysClientCreateOptions added in v0.2.0

type APIKeysClientCreateOptions struct {
}

APIKeysClientCreateOptions contains the optional parameters for the APIKeysClient.Create method.

type APIKeysClientCreateResponse added in v0.2.0

type APIKeysClientCreateResponse struct {
	// Properties that define an API key of an Application Insights Component.
	ComponentAPIKey
}

APIKeysClientCreateResponse contains the response from method APIKeysClient.Create.

type APIKeysClientDeleteOptions added in v0.2.0

type APIKeysClientDeleteOptions struct {
}

APIKeysClientDeleteOptions contains the optional parameters for the APIKeysClient.Delete method.

type APIKeysClientDeleteResponse added in v0.2.0

type APIKeysClientDeleteResponse struct {
	// Properties that define an API key of an Application Insights Component.
	ComponentAPIKey
}

APIKeysClientDeleteResponse contains the response from method APIKeysClient.Delete.

type APIKeysClientGetOptions added in v0.2.0

type APIKeysClientGetOptions struct {
}

APIKeysClientGetOptions contains the optional parameters for the APIKeysClient.Get method.

type APIKeysClientGetResponse added in v0.2.0

type APIKeysClientGetResponse struct {
	// Properties that define an API key of an Application Insights Component.
	ComponentAPIKey
}

APIKeysClientGetResponse contains the response from method APIKeysClient.Get.

type APIKeysClientListOptions added in v0.2.0

type APIKeysClientListOptions struct {
}

APIKeysClientListOptions contains the optional parameters for the APIKeysClient.NewListPager method.

type APIKeysClientListResponse added in v0.2.0

type APIKeysClientListResponse struct {
	// Describes the list of API Keys of an Application Insights Component.
	ComponentAPIKeyListResult
}

APIKeysClientListResponse contains the response from method APIKeysClient.NewListPager.

type AnalyticsItemsClient

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

AnalyticsItemsClient contains the methods for the AnalyticsItems group. Don't use this type directly, use NewAnalyticsItemsClient() instead.

func NewAnalyticsItemsClient

func NewAnalyticsItemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AnalyticsItemsClient, error)

NewAnalyticsItemsClient creates a new instance of AnalyticsItemsClient with the specified values.

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

func (*AnalyticsItemsClient) Delete

func (client *AnalyticsItemsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, options *AnalyticsItemsClientDeleteOptions) (AnalyticsItemsClientDeleteResponse, error)

Delete - Deletes a specific Analytics Items defined within an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • scopePath - Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component.
  • options - AnalyticsItemsClientDeleteOptions contains the optional parameters for the AnalyticsItemsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemDelete.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAnalyticsItemsClient().Delete(ctx, "my-resource-group", "my-component", armapplicationinsights.ItemScopePathAnalyticsItems, &armapplicationinsights.AnalyticsItemsClientDeleteOptions{ID: to.Ptr("3466c160-4a10-4df8-afdf-0007f3f6dee5"),
		Name: nil,
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*AnalyticsItemsClient) Get

func (client *AnalyticsItemsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, options *AnalyticsItemsClientGetOptions) (AnalyticsItemsClientGetResponse, error)

Get - Gets a specific Analytics Items defined within an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • scopePath - Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component.
  • options - AnalyticsItemsClientGetOptions contains the optional parameters for the AnalyticsItemsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemGet.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAnalyticsItemsClient().Get(ctx, "my-resource-group", "my-component", armapplicationinsights.ItemScopePathAnalyticsItems, &armapplicationinsights.AnalyticsItemsClientGetOptions{ID: to.Ptr("3466c160-4a10-4df8-afdf-0007f3f6dee5"),
		Name: 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.ComponentAnalyticsItem = armapplicationinsights.ComponentAnalyticsItem{
	// 	Content: to.Ptr("let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId  \n) on problemId \n| order by  count_ desc\n"),
	// 	ID: to.Ptr("3466c160-4a10-4df8-afdf-0007f3f6dee5"),
	// 	Name: to.Ptr("Exceptions - New in the last 24 hours"),
	// 	Scope: to.Ptr(armapplicationinsights.ItemScopeShared),
	// 	TimeCreated: to.Ptr("2018-02-12T11:44:39.2980634Z"),
	// 	TimeModified: to.Ptr("2018-02-14T13:13:19.3381394Z"),
	// 	Type: to.Ptr(armapplicationinsights.ItemTypeQuery),
	// 	Version: to.Ptr("1.0"),
	// }
}
Output:

func (*AnalyticsItemsClient) List

func (client *AnalyticsItemsClient) List(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, options *AnalyticsItemsClientListOptions) (AnalyticsItemsClientListResponse, error)

List - Gets a list of Analytics Items defined within an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • scopePath - Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component.
  • options - AnalyticsItemsClientListOptions contains the optional parameters for the AnalyticsItemsClient.List method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAnalyticsItemsClient().List(ctx, "my-resource-group", "my-component", armapplicationinsights.ItemScopePathAnalyticsItems, &armapplicationinsights.AnalyticsItemsClientListOptions{Scope: nil,
		Type:           nil,
		IncludeContent: 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.ComponentAnalyticsItemArray = []*armapplicationinsights.ComponentAnalyticsItem{
	// 	{
	// 		Content: to.Ptr("//Top 10 countries by traffic in the past 24 hours\nrequests \n | where  timestamp > ago(24h) \n | summarize count() by client_CountryOrRegion\n | top 10 by count_ \n | render piechart"),
	// 		ID: to.Ptr("b753348d-333a-4678-a684-c0e9090713b7"),
	// 		Name: to.Ptr("1"),
	// 		Scope: to.Ptr(armapplicationinsights.ItemScopeUser),
	// 		TimeModified: to.Ptr("2017-06-29T10:27:03Z"),
	// 		Type: to.Ptr(armapplicationinsights.ItemTypeQuery),
	// 		Version: to.Ptr("1.0"),
	// 	},
	// 	{
	// 		Content: to.Ptr("//Top 10 countries by traffic in the past 24 hours\nrequests \n | where  timestamp > ago(24h) \n | summarize count() by client_CountryOrRegion\n | top 10 by count_ \n | render piechart"),
	// 		ID: to.Ptr("0d2f1b19-04b2-4c93-bc6f-2466b23c5284"),
	// 		Name: to.Ptr("4"),
	// 		Scope: to.Ptr(armapplicationinsights.ItemScopeUser),
	// 		TimeModified: to.Ptr("2017-06-29T10:27:13Z"),
	// 		Type: to.Ptr(armapplicationinsights.ItemTypeQuery),
	// 		Version: to.Ptr("1.0"),
	// 	},
	// 	{
	// 		Content: to.Ptr("//Top 10 countries by traffic in the past 24 hours\nrequests \n | where  timestamp > ago(24h) \n | summarize count() by client_CountryOrRegion\n | top 10 by count_ \n | render piechart"),
	// 		ID: to.Ptr("3d17bebb-0b20-4b58-9bbd-22aeed70be51"),
	// 		Name: to.Ptr("2"),
	// 		Scope: to.Ptr(armapplicationinsights.ItemScopeUser),
	// 		TimeModified: to.Ptr("2018-02-10T23:21:05.9952874Z"),
	// 		Type: to.Ptr(armapplicationinsights.ItemTypeQuery),
	// 		Version: to.Ptr("1.0"),
	// 	},
	// 	{
	// 		Content: to.Ptr("//Top 10 countries by traffic in the past 24 hours\nrequests \n | where  timestamp > ago(24h) \n | summarize count() by client_CountryOrRegion\n | top 10 by count_ \n | render piechart"),
	// 		ID: to.Ptr("2be491c6-10d9-4cf6-9490-2a7ce7270c54"),
	// 		Name: to.Ptr("5"),
	// 		Scope: to.Ptr(armapplicationinsights.ItemScopeUser),
	// 		TimeModified: to.Ptr("2017-06-29T10:27:17Z"),
	// 		Type: to.Ptr(armapplicationinsights.ItemTypeQuery),
	// 		Version: to.Ptr("1.0"),
	// 	},
	// 	{
	// 		Content: to.Ptr("//Top 10 countries by traffic in the past 24 hours\nrequests \n | where  timestamp > ago(24h) \n | summarize count() by client_CountryOrRegion\n | top 10 by count_ \n | render piechart"),
	// 		ID: to.Ptr("d8f83601-4a40-4dc1-8516-0a28dcb74420"),
	// 		Name: to.Ptr("8"),
	// 		Scope: to.Ptr(armapplicationinsights.ItemScopeUser),
	// 		TimeCreated: to.Ptr("2018-02-10T23:20:19.0174631Z"),
	// 		TimeModified: to.Ptr("2018-02-10T23:20:19.0174631Z"),
	// 		Type: to.Ptr(armapplicationinsights.ItemTypeQuery),
	// 		Version: to.Ptr("1.0"),
	// 	},
	// 	{
	// 		Content: to.Ptr("let newExceptionsTimeRange = 7d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId  \n) on problemId \n| order by  count_ desc\n"),
	// 		ID: to.Ptr("fd3afe4d-9139-4c76-9b47-81d0fada977b"),
	// 		Name: to.Ptr("Exceptions - New in the last 7 days"),
	// 		Scope: to.Ptr(armapplicationinsights.ItemScopeUser),
	// 		TimeCreated: to.Ptr("2018-02-11T22:05:57.6019354Z"),
	// 		TimeModified: to.Ptr("2018-02-12T11:01:15.5687326Z"),
	// 		Type: to.Ptr(armapplicationinsights.ItemTypeQuery),
	// 		Version: to.Ptr("1.0"),
	// 	},
	// 	{
	// 		Content: to.Ptr("let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId  \n) on problemId \n| order by  count_ desc\n"),
	// 		ID: to.Ptr("3466c160-4a10-4df8-afdf-0007f3f6dee5"),
	// 		Name: to.Ptr("Exceptions - New in the last 24 hours"),
	// 		Scope: to.Ptr(armapplicationinsights.ItemScopeShared),
	// 		TimeCreated: to.Ptr("2018-02-12T11:44:39.2980634Z"),
	// 		TimeModified: to.Ptr("2018-02-14T13:13:19.3381394Z"),
	// 		Type: to.Ptr(armapplicationinsights.ItemTypeQuery),
	// 		Version: to.Ptr("1.0"),
	// }}
}
Output:

func (*AnalyticsItemsClient) Put

func (client *AnalyticsItemsClient) Put(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, itemProperties ComponentAnalyticsItem, options *AnalyticsItemsClientPutOptions) (AnalyticsItemsClientPutResponse, error)

Put - Adds or Updates a specific Analytics Item within an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • scopePath - Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component.
  • itemProperties - Properties that need to be specified to create a new item and add it to an Application Insights component.
  • options - AnalyticsItemsClientPutOptions contains the optional parameters for the AnalyticsItemsClient.Put method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemPut.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAnalyticsItemsClient().Put(ctx, "my-resource-group", "my-component", armapplicationinsights.ItemScopePathAnalyticsItems, armapplicationinsights.ComponentAnalyticsItem{
		Content: to.Ptr("let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId  \n) on problemId \n| order by  count_ desc\n"),
		Name:    to.Ptr("Exceptions - New in the last 24 hours"),
		Scope:   to.Ptr(armapplicationinsights.ItemScopeShared),
		Type:    to.Ptr(armapplicationinsights.ItemTypeQuery),
	}, &armapplicationinsights.AnalyticsItemsClientPutOptions{OverrideItem: 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.ComponentAnalyticsItem = armapplicationinsights.ComponentAnalyticsItem{
	// 	Content: to.Ptr("let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId  \n) on problemId \n| order by  count_ desc\n"),
	// 	ID: to.Ptr("3466c160-4a10-4df8-afdf-0007f3f6dee5"),
	// 	Name: to.Ptr("Exceptions - New in the last 24 hours"),
	// 	Scope: to.Ptr(armapplicationinsights.ItemScopeShared),
	// 	TimeCreated: to.Ptr("2018-02-12T11:44:39.2980634Z"),
	// 	TimeModified: to.Ptr("2018-02-14T13:13:19.3381394Z"),
	// 	Type: to.Ptr(armapplicationinsights.ItemTypeQuery),
	// 	Version: to.Ptr("1.0"),
	// }
}
Output:

type AnalyticsItemsClientDeleteOptions added in v0.2.0

type AnalyticsItemsClientDeleteOptions struct {
	// The Id of a specific item defined in the Application Insights component
	ID *string

	// The name of a specific item defined in the Application Insights component
	Name *string
}

AnalyticsItemsClientDeleteOptions contains the optional parameters for the AnalyticsItemsClient.Delete method.

type AnalyticsItemsClientDeleteResponse added in v0.2.0

type AnalyticsItemsClientDeleteResponse struct {
}

AnalyticsItemsClientDeleteResponse contains the response from method AnalyticsItemsClient.Delete.

type AnalyticsItemsClientGetOptions added in v0.2.0

type AnalyticsItemsClientGetOptions struct {
	// The Id of a specific item defined in the Application Insights component
	ID *string

	// The name of a specific item defined in the Application Insights component
	Name *string
}

AnalyticsItemsClientGetOptions contains the optional parameters for the AnalyticsItemsClient.Get method.

type AnalyticsItemsClientGetResponse added in v0.2.0

type AnalyticsItemsClientGetResponse struct {
	// Properties that define an Analytics item that is associated to an Application Insights component.
	ComponentAnalyticsItem
}

AnalyticsItemsClientGetResponse contains the response from method AnalyticsItemsClient.Get.

type AnalyticsItemsClientListOptions added in v0.2.0

type AnalyticsItemsClientListOptions struct {
	// Flag indicating whether or not to return the content of each applicable item. If false, only return the item information.
	IncludeContent *bool

	// Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application
	// Insights component.
	Scope *ItemScope

	// Enum indicating the type of the Analytics item.
	Type *ItemTypeParameter
}

AnalyticsItemsClientListOptions contains the optional parameters for the AnalyticsItemsClient.List method.

type AnalyticsItemsClientListResponse added in v0.2.0

type AnalyticsItemsClientListResponse struct {
	// Array of ApplicationInsightsComponentAnalyticsItem
	ComponentAnalyticsItemArray []*ComponentAnalyticsItem
}

AnalyticsItemsClientListResponse contains the response from method AnalyticsItemsClient.List.

type AnalyticsItemsClientPutOptions added in v0.2.0

type AnalyticsItemsClientPutOptions struct {
	// Flag indicating whether or not to force save an item. This allows overriding an item if it already exists.
	OverrideItem *bool
}

AnalyticsItemsClientPutOptions contains the optional parameters for the AnalyticsItemsClient.Put method.

type AnalyticsItemsClientPutResponse added in v0.2.0

type AnalyticsItemsClientPutResponse struct {
	// Properties that define an Analytics item that is associated to an Application Insights component.
	ComponentAnalyticsItem
}

AnalyticsItemsClientPutResponse contains the response from method AnalyticsItemsClient.Put.

type Annotation

type Annotation struct {
	// Name of annotation
	AnnotationName *string

	// Category of annotation, free form
	Category *string

	// Time when event occurred
	EventTime *time.Time

	// Unique Id for annotation
	ID *string

	// Serialized JSON object for detailed properties
	Properties *string

	// Related parent annotation if any
	RelatedAnnotation *string
}

Annotation associated with an application insights resource.

func (Annotation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Annotation.

func (*Annotation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Annotation.

type AnnotationError

type AnnotationError struct {
	// Error detail code and explanation
	Code *string

	// Inner error
	Innererror *InnerError

	// Error message
	Message *string
}

AnnotationError - Error associated with trying to create annotation with Id that already exist

func (AnnotationError) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type AnnotationError.

func (*AnnotationError) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AnnotationError.

type AnnotationsClient

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

AnnotationsClient contains the methods for the Annotations group. Don't use this type directly, use NewAnnotationsClient() instead.

func NewAnnotationsClient

func NewAnnotationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AnnotationsClient, error)

NewAnnotationsClient creates a new instance of AnnotationsClient with the specified values.

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

func (*AnnotationsClient) Create

func (client *AnnotationsClient) Create(ctx context.Context, resourceGroupName string, resourceName string, annotationProperties Annotation, options *AnnotationsClientCreateOptions) (AnnotationsClientCreateResponse, error)

Create - Create an Annotation of an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • annotationProperties - Properties that need to be specified to create an annotation of a Application Insights component.
  • options - AnnotationsClientCreateOptions contains the optional parameters for the AnnotationsClient.Create method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsCreate.json

package main

import (
	"context"
	"log"

	"time"

	"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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAnnotationsClient().Create(ctx, "my-resource-group", "my-component", armapplicationinsights.Annotation{
		AnnotationName: to.Ptr("TestAnnotation"),
		Category:       to.Ptr("Text"),
		EventTime:      to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-31T13:41:38.657Z"); return t }()),
		ID:             to.Ptr("444e2c08-274a-4bbb-a89e-d77bb720f44a"),
		Properties:     to.Ptr("{\"Comments\":\"Testing\",\"Label\":\"Success\"}"),
	}, 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.AnnotationArray = []*armapplicationinsights.Annotation{
	// 	{
	// 		AnnotationName: to.Ptr("TestAnnotation"),
	// 		Category: to.Ptr("Text"),
	// 		EventTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-31T13:41:38.657Z"); return t}()),
	// 		ID: to.Ptr("444e2c08-274a-4bbb-a89e-d77bb720f44a"),
	// 		Properties: to.Ptr("{\"Comments\":\"Testing\",\"Label\":\"Success\"}"),
	// }}
}
Output:

func (*AnnotationsClient) Delete

func (client *AnnotationsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, annotationID string, options *AnnotationsClientDeleteOptions) (AnnotationsClientDeleteResponse, error)

Delete - Delete an Annotation of an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • annotationID - The unique annotation ID. This is unique within a Application Insights component.
  • options - AnnotationsClientDeleteOptions contains the optional parameters for the AnnotationsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAnnotationsClient().Delete(ctx, "my-resource-group", "my-component", "bb820f1b-3110-4a8b-ba2c-8c1129d7eb6a", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*AnnotationsClient) Get

func (client *AnnotationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, annotationID string, options *AnnotationsClientGetOptions) (AnnotationsClientGetResponse, error)

Get - Get the annotation for given id. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • annotationID - The unique annotation ID. This is unique within a Application Insights component.
  • options - AnnotationsClientGetOptions contains the optional parameters for the AnnotationsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAnnotationsClient().Get(ctx, "my-resource-group", "my-component", "444e2c08-274a-4bbb-a89e-d77bb720f44a", 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.AnnotationArray = []*armapplicationinsights.Annotation{
	// 	{
	// 		AnnotationName: to.Ptr("TestAnnotation"),
	// 		Category: to.Ptr("Text"),
	// 		EventTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-31T13:41:38.657Z"); return t}()),
	// 		ID: to.Ptr("444e2c08-274a-4bbb-a89e-d77bb720f44a"),
	// 		Properties: to.Ptr("{\"Comments\":\"Testing\",\"Label\":\"Success\"}"),
	// }}
}
Output:

func (*AnnotationsClient) NewListPager added in v0.4.0

func (client *AnnotationsClient) NewListPager(resourceGroupName string, resourceName string, start string, end string, options *AnnotationsClientListOptions) *runtime.Pager[AnnotationsClientListResponse]

NewListPager - Gets the list of annotations for a component for given time range

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • start - The start time to query from for annotations, cannot be older than 90 days from current date.
  • end - The end time to query for annotations.
  • options - AnnotationsClientListOptions contains the optional parameters for the AnnotationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAnnotationsClient().NewListPager("my-resource-group", "my-component", "2018-02-05T00%253A30%253A00.000Z", "2018-02-06T00%253A33A00.000Z", 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.AnnotationsListResult = armapplicationinsights.AnnotationsListResult{
		// }
	}
}
Output:

type AnnotationsClientCreateOptions added in v0.2.0

type AnnotationsClientCreateOptions struct {
}

AnnotationsClientCreateOptions contains the optional parameters for the AnnotationsClient.Create method.

type AnnotationsClientCreateResponse added in v0.2.0

type AnnotationsClientCreateResponse struct {
	// Array of Annotation
	AnnotationArray []*Annotation
}

AnnotationsClientCreateResponse contains the response from method AnnotationsClient.Create.

type AnnotationsClientDeleteOptions added in v0.2.0

type AnnotationsClientDeleteOptions struct {
}

AnnotationsClientDeleteOptions contains the optional parameters for the AnnotationsClient.Delete method.

type AnnotationsClientDeleteResponse added in v0.2.0

type AnnotationsClientDeleteResponse struct {
}

AnnotationsClientDeleteResponse contains the response from method AnnotationsClient.Delete.

type AnnotationsClientGetOptions added in v0.2.0

type AnnotationsClientGetOptions struct {
}

AnnotationsClientGetOptions contains the optional parameters for the AnnotationsClient.Get method.

type AnnotationsClientGetResponse added in v0.2.0

type AnnotationsClientGetResponse struct {
	// Array of Annotation
	AnnotationArray []*Annotation
}

AnnotationsClientGetResponse contains the response from method AnnotationsClient.Get.

type AnnotationsClientListOptions added in v0.2.0

type AnnotationsClientListOptions struct {
}

AnnotationsClientListOptions contains the optional parameters for the AnnotationsClient.NewListPager method.

type AnnotationsClientListResponse added in v0.2.0

type AnnotationsClientListResponse struct {
	// Annotations list result.
	AnnotationsListResult
}

AnnotationsClientListResponse contains the response from method AnnotationsClient.NewListPager.

type AnnotationsListResult

type AnnotationsListResult struct {
	// READ-ONLY; An array of annotations.
	Value []*Annotation
}

AnnotationsListResult - Annotations list result.

func (AnnotationsListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AnnotationsListResult.

func (*AnnotationsListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AnnotationsListResult.

type ApplicationType

type ApplicationType string

ApplicationType - Type of application being monitored.

const (
	ApplicationTypeOther ApplicationType = "other"
	ApplicationTypeWeb   ApplicationType = "web"
)

func PossibleApplicationTypeValues

func PossibleApplicationTypeValues() []ApplicationType

PossibleApplicationTypeValues returns the possible values for the ApplicationType const type.

type CategoryType

type CategoryType string
const (
	CategoryTypePerformance CategoryType = "performance"
	CategoryTypeRetention   CategoryType = "retention"
	CategoryTypeTSG         CategoryType = "TSG"
	CategoryTypeWorkbook    CategoryType = "workbook"
)

func PossibleCategoryTypeValues

func PossibleCategoryTypeValues() []CategoryType

PossibleCategoryTypeValues returns the possible values for the CategoryType const type.

type ClientFactory added in v1.1.0

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

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

func NewClientFactory added in v1.1.0

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

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

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

func (*ClientFactory) NewAPIKeysClient added in v1.1.0

func (c *ClientFactory) NewAPIKeysClient() *APIKeysClient

NewAPIKeysClient creates a new instance of APIKeysClient.

func (*ClientFactory) NewAnalyticsItemsClient added in v1.1.0

func (c *ClientFactory) NewAnalyticsItemsClient() *AnalyticsItemsClient

NewAnalyticsItemsClient creates a new instance of AnalyticsItemsClient.

func (*ClientFactory) NewAnnotationsClient added in v1.1.0

func (c *ClientFactory) NewAnnotationsClient() *AnnotationsClient

NewAnnotationsClient creates a new instance of AnnotationsClient.

func (*ClientFactory) NewComponentAvailableFeaturesClient added in v1.1.0

func (c *ClientFactory) NewComponentAvailableFeaturesClient() *ComponentAvailableFeaturesClient

NewComponentAvailableFeaturesClient creates a new instance of ComponentAvailableFeaturesClient.

func (*ClientFactory) NewComponentCurrentBillingFeaturesClient added in v1.1.0

func (c *ClientFactory) NewComponentCurrentBillingFeaturesClient() *ComponentCurrentBillingFeaturesClient

NewComponentCurrentBillingFeaturesClient creates a new instance of ComponentCurrentBillingFeaturesClient.

func (*ClientFactory) NewComponentFeatureCapabilitiesClient added in v1.1.0

func (c *ClientFactory) NewComponentFeatureCapabilitiesClient() *ComponentFeatureCapabilitiesClient

NewComponentFeatureCapabilitiesClient creates a new instance of ComponentFeatureCapabilitiesClient.

func (*ClientFactory) NewComponentQuotaStatusClient added in v1.1.0

func (c *ClientFactory) NewComponentQuotaStatusClient() *ComponentQuotaStatusClient

NewComponentQuotaStatusClient creates a new instance of ComponentQuotaStatusClient.

func (*ClientFactory) NewComponentsClient added in v1.1.0

func (c *ClientFactory) NewComponentsClient() *ComponentsClient

NewComponentsClient creates a new instance of ComponentsClient.

func (*ClientFactory) NewExportConfigurationsClient added in v1.1.0

func (c *ClientFactory) NewExportConfigurationsClient() *ExportConfigurationsClient

NewExportConfigurationsClient creates a new instance of ExportConfigurationsClient.

func (*ClientFactory) NewFavoritesClient added in v1.1.0

func (c *ClientFactory) NewFavoritesClient() *FavoritesClient

NewFavoritesClient creates a new instance of FavoritesClient.

func (*ClientFactory) NewMyWorkbooksClient added in v1.1.0

func (c *ClientFactory) NewMyWorkbooksClient() *MyWorkbooksClient

NewMyWorkbooksClient creates a new instance of MyWorkbooksClient.

func (*ClientFactory) NewProactiveDetectionConfigurationsClient added in v1.1.0

func (c *ClientFactory) NewProactiveDetectionConfigurationsClient() *ProactiveDetectionConfigurationsClient

NewProactiveDetectionConfigurationsClient creates a new instance of ProactiveDetectionConfigurationsClient.

func (*ClientFactory) NewWebTestLocationsClient added in v1.1.0

func (c *ClientFactory) NewWebTestLocationsClient() *WebTestLocationsClient

NewWebTestLocationsClient creates a new instance of WebTestLocationsClient.

func (*ClientFactory) NewWebTestsClient added in v1.1.0

func (c *ClientFactory) NewWebTestsClient() *WebTestsClient

NewWebTestsClient creates a new instance of WebTestsClient.

func (*ClientFactory) NewWorkItemConfigurationsClient added in v1.1.0

func (c *ClientFactory) NewWorkItemConfigurationsClient() *WorkItemConfigurationsClient

NewWorkItemConfigurationsClient creates a new instance of WorkItemConfigurationsClient.

func (*ClientFactory) NewWorkbooksClient added in v1.1.0

func (c *ClientFactory) NewWorkbooksClient() *WorkbooksClient

NewWorkbooksClient creates a new instance of WorkbooksClient.

type Component added in v0.2.0

type Component struct {
	// REQUIRED; The kind of application that this component refers to, used to customize UI. This value is a freeform string,
	// values should typically be one of the following: web, ios, other, store, java, phone.
	Kind *string

	// REQUIRED; Resource location
	Location *string

	// Resource etag
	Etag *string

	// Properties that define an Application Insights component resource.
	Properties *ComponentProperties

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; Azure resource Id
	ID *string

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

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

Component - An Application Insights component definition.

func (Component) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type Component.

func (*Component) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Component.

type ComponentAPIKey added in v0.2.0

type ComponentAPIKey struct {
	// The create date of this API key.
	CreatedDate *string

	// The read access rights of this API Key.
	LinkedReadProperties []*string

	// The write access rights of this API Key.
	LinkedWriteProperties []*string

	// The name of the API key.
	Name *string

	// READ-ONLY; The API key value. It will be only return once when the API Key was created.
	APIKey *string

	// READ-ONLY; The unique ID of the API key inside an Application Insights component. It is auto generated when the API key
	// is created.
	ID *string
}

ComponentAPIKey - Properties that define an API key of an Application Insights Component.

func (ComponentAPIKey) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentAPIKey.

func (*ComponentAPIKey) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentAPIKey.

type ComponentAPIKeyListResult added in v0.2.0

type ComponentAPIKeyListResult struct {
	// REQUIRED; List of API Key definitions.
	Value []*ComponentAPIKey
}

ComponentAPIKeyListResult - Describes the list of API Keys of an Application Insights Component.

func (ComponentAPIKeyListResult) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentAPIKeyListResult.

func (*ComponentAPIKeyListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentAPIKeyListResult.

type ComponentAnalyticsItem added in v0.2.0

type ComponentAnalyticsItem struct {
	// The content of this item
	Content *string

	// Internally assigned unique id of the item definition.
	ID *string

	// The user-defined name of the item.
	Name *string

	// A set of properties that can be defined in the context of a specific item type. Each type may have its own properties.
	Properties *ComponentAnalyticsItemProperties

	// Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application
	// Insights component.
	Scope *ItemScope

	// Enum indicating the type of the Analytics item.
	Type *ItemType

	// READ-ONLY; Date and time in UTC when this item was created.
	TimeCreated *string

	// READ-ONLY; Date and time in UTC of the last modification that was made to this item.
	TimeModified *string

	// READ-ONLY; This instance's version of the data model. This can change as new features are added.
	Version *string
}

ComponentAnalyticsItem - Properties that define an Analytics item that is associated to an Application Insights component.

func (ComponentAnalyticsItem) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentAnalyticsItem.

func (*ComponentAnalyticsItem) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentAnalyticsItem.

type ComponentAnalyticsItemProperties added in v0.2.0

type ComponentAnalyticsItemProperties struct {
	// A function alias, used when the type of the item is Function
	FunctionAlias *string
}

ComponentAnalyticsItemProperties - A set of properties that can be defined in the context of a specific item type. Each type may have its own properties.

func (ComponentAnalyticsItemProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentAnalyticsItemProperties.

func (*ComponentAnalyticsItemProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentAnalyticsItemProperties.

type ComponentAvailableFeatures added in v0.2.0

type ComponentAvailableFeatures struct {
	// READ-ONLY; A list of Application Insights component feature.
	Result []*ComponentFeature
}

ComponentAvailableFeatures - An Application Insights component available features.

func (ComponentAvailableFeatures) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentAvailableFeatures.

func (*ComponentAvailableFeatures) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentAvailableFeatures.

type ComponentAvailableFeaturesClient

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

ComponentAvailableFeaturesClient contains the methods for the ComponentAvailableFeatures group. Don't use this type directly, use NewComponentAvailableFeaturesClient() instead.

func NewComponentAvailableFeaturesClient

func NewComponentAvailableFeaturesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ComponentAvailableFeaturesClient, error)

NewComponentAvailableFeaturesClient creates a new instance of ComponentAvailableFeaturesClient with the specified values.

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

func (*ComponentAvailableFeaturesClient) Get

Get - Returns all available features of the application insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - ComponentAvailableFeaturesClientGetOptions contains the optional parameters for the ComponentAvailableFeaturesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AvailableBillingFeaturesGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewComponentAvailableFeaturesClient().Get(ctx, "my-resource-group", "my-component", 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.ComponentAvailableFeatures = armapplicationinsights.ComponentAvailableFeatures{
	// 	Result: []*armapplicationinsights.ComponentFeature{
	// 		{
	// 			Capabilities: []*armapplicationinsights.ComponentFeatureCapability{
	// 				{
	// 					Description: to.Ptr("Number of application hosts"),
	// 					Name: to.Ptr("hostnumber"),
	// 					Value: to.Ptr("Unlimited"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Included data"),
	// 					MeterID: to.Ptr("acf26b15-ee92-440d-9973-9a72d77641aa"),
	// 					MeterRateFrequency: to.Ptr("GB/month"),
	// 					Name: to.Ptr("includeddata"),
	// 					Value: to.Ptr("1"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Additional data"),
	// 					MeterID: to.Ptr("b90f8b65-6c3e-43fc-9149-bdfc73b6a5b9"),
	// 					MeterRateFrequency: to.Ptr("/GB"),
	// 					Name: to.Ptr("additionaldata"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Data retention"),
	// 					Name: to.Ptr("dataretention"),
	// 					Unit: to.Ptr("days"),
	// 					Value: to.Ptr("90"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Response time monitoring and diagnostics"),
	// 					Name: to.Ptr("responsetimemonitoring"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Failed requests monitoring and diagnostics"),
	// 					Name: to.Ptr("failedrequestsmonitoring"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Browser performance"),
	// 					Name: to.Ptr("browserperformance"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Usage analysis"),
	// 					Name: to.Ptr("usageanalysis"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Server monitoring"),
	// 					Name: to.Ptr("servermonitoring"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Alerting and notifications"),
	// 					Name: to.Ptr("alertingandnotifications"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Daily notification of failed request rate spikes"),
	// 					Name: to.Ptr("notificationfailedrequestrate"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Telemetry analyzer"),
	// 					Name: to.Ptr("telemetryanalyzer"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Search and Analytics"),
	// 					Name: to.Ptr("searchandanalytics"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Web tests (multi-step tests)"),
	// 					MeterID: to.Ptr("0aa0e0e9-3f58-4dcf-9bb0-9db7ae1d5954"),
	// 					MeterRateFrequency: to.Ptr("/test (per month)"),
	// 					Name: to.Ptr("webtests"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Live stream metrics"),
	// 					Name: to.Ptr("livestreammetrics"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Application map"),
	// 					Name: to.Ptr("applicationmap"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Daily notification for many key metrics"),
	// 					Name: to.Ptr("dailynotificationforkeymetrics"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Work item integration"),
	// 					Name: to.Ptr("workitemintegration"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("API access"),
	// 					Name: to.Ptr("apiaccess"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Power BI integration"),
	// 					Name: to.Ptr("powerbiintegration"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Bulk data import"),
	// 					Name: to.Ptr("bulkdataimport"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Automatic data evaluation"),
	// 					Name: to.Ptr("automaticdataevaluation"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Analytics integration with Azure dashboards"),
	// 					Name: to.Ptr("analyticsintegration"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Continuous export"),
	// 					MeterID: to.Ptr("90fa4d31-3ea2-4178-a894-ec4c76c712b2"),
	// 					MeterRateFrequency: to.Ptr("/GB"),
	// 					Name: to.Ptr("continuousexport"),
	// 					Value: to.Ptr("Enabled"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Default daily cap"),
	// 					Name: to.Ptr("defaultdailycap"),
	// 					Unit: to.Ptr("G"),
	// 					Value: to.Ptr("100"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Default maximum daily cap"),
	// 					Name: to.Ptr("defaultmaxdailycap"),
	// 					Unit: to.Ptr("G"),
	// 					Value: to.Ptr("1000"),
	// 			}},
	// 			FeatureName: to.Ptr("Basic"),
	// 			IsHidden: to.Ptr(true),
	// 			IsMainFeature: to.Ptr(true),
	// 			MeterID: to.Ptr("c9a05f12-4910-4527-a9ec-1db4e4dba60e"),
	// 			MeterRateFrequency: to.Ptr("/month"),
	// 			SupportedAddonFeatures: to.Ptr("Application Insights Enterprise"),
	// 			Title: to.Ptr("Application Insights Basic"),
	// 		},
	// 		{
	// 			Capabilities: []*armapplicationinsights.ComponentFeatureCapability{
	// 				{
	// 					Description: to.Ptr("Enterprise Included data"),
	// 					MeterID: to.Ptr("acf26b15-ee92-440d-9973-9a72d77641aa"),
	// 					MeterRateFrequency: to.Ptr("GB/month"),
	// 					Name: to.Ptr("enterpriseincludeddata"),
	// 					Value: to.Ptr("0.20"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Enterprise Additional data"),
	// 					MeterID: to.Ptr("3fedc88a-b68f-4936-bbf0-f290a254388c"),
	// 					MeterRateFrequency: to.Ptr("/GB"),
	// 					Name: to.Ptr("enterpriseadditionaldata"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Default daily cap"),
	// 					Name: to.Ptr("defaultdailycap"),
	// 					Unit: to.Ptr("G"),
	// 					Value: to.Ptr("100"),
	// 				},
	// 				{
	// 					Description: to.Ptr("Default maximum daily cap"),
	// 					Name: to.Ptr("defaultmaxdailycap"),
	// 					Unit: to.Ptr("G"),
	// 					Value: to.Ptr("1000"),
	// 			}},
	// 			FeatureName: to.Ptr("Application Insights Enterprise"),
	// 			IsHidden: to.Ptr(false),
	// 			IsMainFeature: to.Ptr(false),
	// 			MeterID: to.Ptr("222f32c5-a319-4787-b934-5fb95105b2c8"),
	// 			MeterRateFrequency: to.Ptr("/node/month"),
	// 			Title: to.Ptr("Enterprise"),
	// 	}},
	// }
}
Output:

type ComponentAvailableFeaturesClientGetOptions added in v0.2.0

type ComponentAvailableFeaturesClientGetOptions struct {
}

ComponentAvailableFeaturesClientGetOptions contains the optional parameters for the ComponentAvailableFeaturesClient.Get method.

type ComponentAvailableFeaturesClientGetResponse added in v0.2.0

type ComponentAvailableFeaturesClientGetResponse struct {
	// An Application Insights component available features.
	ComponentAvailableFeatures
}

ComponentAvailableFeaturesClientGetResponse contains the response from method ComponentAvailableFeaturesClient.Get.

type ComponentBillingFeatures added in v0.2.0

type ComponentBillingFeatures struct {
	// Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application
	// Insights Enterprise'.
	CurrentBillingFeatures []*string

	// An Application Insights component daily data volume cap
	DataVolumeCap *ComponentDataVolumeCap
}

ComponentBillingFeatures - An Application Insights component billing features

func (ComponentBillingFeatures) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentBillingFeatures.

func (*ComponentBillingFeatures) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentBillingFeatures.

type ComponentCurrentBillingFeaturesClient

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

ComponentCurrentBillingFeaturesClient contains the methods for the ComponentCurrentBillingFeatures group. Don't use this type directly, use NewComponentCurrentBillingFeaturesClient() instead.

func NewComponentCurrentBillingFeaturesClient

func NewComponentCurrentBillingFeaturesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ComponentCurrentBillingFeaturesClient, error)

NewComponentCurrentBillingFeaturesClient creates a new instance of ComponentCurrentBillingFeaturesClient with the specified values.

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

func (*ComponentCurrentBillingFeaturesClient) Get

Get - Returns current billing features for an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - ComponentCurrentBillingFeaturesClientGetOptions contains the optional parameters for the ComponentCurrentBillingFeaturesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/CurrentBillingFeaturesGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewComponentCurrentBillingFeaturesClient().Get(ctx, "my-resource-group", "my-component", 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.ComponentBillingFeatures = armapplicationinsights.ComponentBillingFeatures{
	// 	CurrentBillingFeatures: []*string{
	// 		to.Ptr("Basic")},
	// 		DataVolumeCap: &armapplicationinsights.ComponentDataVolumeCap{
	// 			Cap: to.Ptr[float32](500),
	// 			MaxHistoryCap: to.Ptr[float32](500),
	// 			ResetTime: to.Ptr[int32](16),
	// 			StopSendNotificationWhenHitCap: to.Ptr(false),
	// 			StopSendNotificationWhenHitThreshold: to.Ptr(false),
	// 			WarningThreshold: to.Ptr[int32](90),
	// 		},
	// 	}
}
Output:

func (*ComponentCurrentBillingFeaturesClient) Update

Update - Update current billing features for an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • billingFeaturesProperties - Properties that need to be specified to update billing features for an Application Insights component.
  • options - ComponentCurrentBillingFeaturesClientUpdateOptions contains the optional parameters for the ComponentCurrentBillingFeaturesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/CurrentBillingFeaturesUpdate.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewComponentCurrentBillingFeaturesClient().Update(ctx, "my-resource-group", "my-component", armapplicationinsights.ComponentBillingFeatures{
		CurrentBillingFeatures: []*string{
			to.Ptr("Basic"),
			to.Ptr("Application Insights Enterprise")},
		DataVolumeCap: &armapplicationinsights.ComponentDataVolumeCap{
			Cap:                            to.Ptr[float32](100),
			StopSendNotificationWhenHitCap: to.Ptr(true),
		},
	}, 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.ComponentBillingFeatures = armapplicationinsights.ComponentBillingFeatures{
	// 	CurrentBillingFeatures: []*string{
	// 		to.Ptr("Basic"),
	// 		to.Ptr("Application Insights Enterprise")},
	// 		DataVolumeCap: &armapplicationinsights.ComponentDataVolumeCap{
	// 			Cap: to.Ptr[float32](100),
	// 			MaxHistoryCap: to.Ptr[float32](500),
	// 			ResetTime: to.Ptr[int32](16),
	// 			StopSendNotificationWhenHitCap: to.Ptr(true),
	// 			StopSendNotificationWhenHitThreshold: to.Ptr(false),
	// 			WarningThreshold: to.Ptr[int32](90),
	// 		},
	// 	}
}
Output:

type ComponentCurrentBillingFeaturesClientGetOptions added in v0.2.0

type ComponentCurrentBillingFeaturesClientGetOptions struct {
}

ComponentCurrentBillingFeaturesClientGetOptions contains the optional parameters for the ComponentCurrentBillingFeaturesClient.Get method.

type ComponentCurrentBillingFeaturesClientGetResponse added in v0.2.0

type ComponentCurrentBillingFeaturesClientGetResponse struct {
	// An Application Insights component billing features
	ComponentBillingFeatures
}

ComponentCurrentBillingFeaturesClientGetResponse contains the response from method ComponentCurrentBillingFeaturesClient.Get.

type ComponentCurrentBillingFeaturesClientUpdateOptions added in v0.2.0

type ComponentCurrentBillingFeaturesClientUpdateOptions struct {
}

ComponentCurrentBillingFeaturesClientUpdateOptions contains the optional parameters for the ComponentCurrentBillingFeaturesClient.Update method.

type ComponentCurrentBillingFeaturesClientUpdateResponse added in v0.2.0

type ComponentCurrentBillingFeaturesClientUpdateResponse struct {
	// An Application Insights component billing features
	ComponentBillingFeatures
}

ComponentCurrentBillingFeaturesClientUpdateResponse contains the response from method ComponentCurrentBillingFeaturesClient.Update.

type ComponentDataVolumeCap added in v0.2.0

type ComponentDataVolumeCap struct {
	// Daily data volume cap in GB.
	Cap *float32

	// Do not send a notification email when the daily data volume cap is met.
	StopSendNotificationWhenHitCap *bool

	// Reserved, not used for now.
	StopSendNotificationWhenHitThreshold *bool

	// Reserved, not used for now.
	WarningThreshold *int32

	// READ-ONLY; Maximum daily data volume cap that the user can set for this component.
	MaxHistoryCap *float32

	// READ-ONLY; Daily data volume cap UTC reset hour.
	ResetTime *int32
}

ComponentDataVolumeCap - An Application Insights component daily data volume cap

func (ComponentDataVolumeCap) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentDataVolumeCap.

func (*ComponentDataVolumeCap) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentDataVolumeCap.

type ComponentExportConfiguration added in v0.2.0

type ComponentExportConfiguration struct {
	// Deprecated
	NotificationQueueEnabled *string

	// This comma separated list of document types that will be exported. The possible values include 'Requests', 'Event', 'Exceptions',
	// 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd',
	// 'PerformanceCounters', 'Availability', 'Messages'.
	RecordTypes *string

	// READ-ONLY; The name of the Application Insights component.
	ApplicationName *string

	// READ-ONLY; The name of the destination storage container.
	ContainerName *string

	// READ-ONLY; The name of destination account.
	DestinationAccountID *string

	// READ-ONLY; The destination account location ID.
	DestinationStorageLocationID *string

	// READ-ONLY; The destination storage account subscription ID.
	DestinationStorageSubscriptionID *string

	// READ-ONLY; The destination type.
	DestinationType *string

	// READ-ONLY; The unique ID of the export configuration inside an Application Insights component. It is auto generated when
	// the Continuous Export configuration is created.
	ExportID *string

	// READ-ONLY; This indicates current Continuous Export configuration status. The possible values are 'Preparing', 'Success',
	// 'Failure'.
	ExportStatus *string

	// READ-ONLY; The instrumentation key of the Application Insights component.
	InstrumentationKey *string

	// READ-ONLY; This will be 'true' if the Continuous Export configuration is enabled, otherwise it will be 'false'.
	IsUserEnabled *string

	// READ-ONLY; The last time the Continuous Export configuration started failing.
	LastGapTime *string

	// READ-ONLY; The last time data was successfully delivered to the destination storage container for this Continuous Export
	// configuration.
	LastSuccessTime *string

	// READ-ONLY; Last time the Continuous Export configuration was updated.
	LastUserUpdate *string

	// READ-ONLY; This is the reason the Continuous Export configuration started failing. It can be 'AzureStorageNotFound' or
	// 'AzureStorageAccessDenied'.
	PermanentErrorReason *string

	// READ-ONLY; The resource group of the Application Insights component.
	ResourceGroup *string

	// READ-ONLY; The name of the destination storage account.
	StorageName *string

	// READ-ONLY; The subscription of the Application Insights component.
	SubscriptionID *string
}

ComponentExportConfiguration - Properties that define a Continuous Export configuration.

func (ComponentExportConfiguration) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentExportConfiguration.

func (*ComponentExportConfiguration) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentExportConfiguration.

type ComponentExportRequest added in v0.2.0

type ComponentExportRequest struct {
	// The name of destination storage account.
	DestinationAccountID *string

	// The SAS URL for the destination storage container. It must grant write permission.
	DestinationAddress *string

	// The location ID of the destination storage container.
	DestinationStorageLocationID *string

	// The subscription ID of the destination storage container.
	DestinationStorageSubscriptionID *string

	// The Continuous Export destination type. This has to be 'Blob'.
	DestinationType *string

	// Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'.
	IsEnabled *string

	// Deprecated
	NotificationQueueEnabled *string

	// Deprecated
	NotificationQueueURI *string

	// The document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions',
	// 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters',
	// 'Availability', 'Messages'.
	RecordTypes *string
}

ComponentExportRequest - An Application Insights component Continuous Export configuration request definition.

func (ComponentExportRequest) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentExportRequest.

func (*ComponentExportRequest) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentExportRequest.

type ComponentFavorite added in v0.2.0

type ComponentFavorite struct {
	// Favorite category, as defined by the user at creation time.
	Category *string

	// Configuration of this particular favorite, which are driven by the Azure portal UX. Configuration data is a string containing
	// valid JSON
	Config *string

	// Enum indicating if this favorite definition is owned by a specific user or is shared between all users with access to the
	// Application Insights component.
	FavoriteType *FavoriteType

	// Flag denoting wether or not this favorite was generated from a template.
	IsGeneratedFromTemplate *bool

	// The user-defined name of the favorite.
	Name *string

	// The source of the favorite definition.
	SourceType *string

	// A list of 0 or more tags that are associated with this favorite definition
	Tags []*string

	// This instance's version of the data model. This can change as new features are added that can be marked favorite. Current
	// examples include MetricsExplorer (ME) and Search.
	Version *string

	// READ-ONLY; Internally assigned unique id of the favorite definition.
	FavoriteID *string

	// READ-ONLY; Date and time in UTC of the last modification that was made to this favorite definition.
	TimeModified *string

	// READ-ONLY; Unique user id of the specific user that owns this favorite.
	UserID *string
}

ComponentFavorite - Properties that define a favorite that is associated to an Application Insights component.

func (ComponentFavorite) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentFavorite.

func (*ComponentFavorite) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentFavorite.

type ComponentFeature added in v0.2.0

type ComponentFeature struct {
	// READ-ONLY; A list of Application Insights component feature capability.
	Capabilities []*ComponentFeatureCapability

	// READ-ONLY; The pricing feature name.
	FeatureName *string

	// READ-ONLY; Reserved, not used now.
	IsHidden *bool

	// READ-ONLY; Whether can apply addon feature on to it.
	IsMainFeature *bool

	// READ-ONLY; The meter id used for the feature.
	MeterID *string

	// READ-ONLY; The meter rate for the feature's meter.
	MeterRateFrequency *string

	// READ-ONLY; Reserved, not used now.
	ResouceID *string

	// READ-ONLY; The add on features on main feature.
	SupportedAddonFeatures *string

	// READ-ONLY; Display name of the feature.
	Title *string
}

ComponentFeature - An Application Insights component daily data volume cap status

func (ComponentFeature) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentFeature.

func (*ComponentFeature) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentFeature.

type ComponentFeatureCapabilities added in v0.2.0

type ComponentFeatureCapabilities struct {
	// READ-ONLY; Reserved, not used now.
	APIAccessLevel *string

	// READ-ONLY; Reserved, not used now.
	AnalyticsIntegration *bool

	// READ-ONLY; Reserved, not used now.
	ApplicationMap *bool

	// READ-ONLY; Reserved, not used now.
	BurstThrottlePolicy *string

	// READ-ONLY; Daily data volume cap in GB.
	DailyCap *float32

	// READ-ONLY; Daily data volume cap UTC reset hour.
	DailyCapResetTime *float32

	// READ-ONLY; Reserved, not used now.
	LiveStreamMetrics *bool

	// READ-ONLY; Reserved, not used now.
	MetadataClass *string

	// READ-ONLY; Whether allow to use multiple steps web test feature.
	MultipleStepWebTest *bool

	// READ-ONLY; Reserved, not used now.
	OpenSchema *bool

	// READ-ONLY; Reserved, not used now.
	PowerBIIntegration *bool

	// READ-ONLY; Reserved, not used now.
	ProactiveDetection *bool

	// READ-ONLY; Whether allow to use continuous export feature.
	SupportExportData *bool

	// READ-ONLY; Reserved, not used now.
	ThrottleRate *float32

	// READ-ONLY; The application insights component used tracking type.
	TrackingType *string

	// READ-ONLY; Whether allow to use work item integration feature.
	WorkItemIntegration *bool
}

ComponentFeatureCapabilities - An Application Insights component feature capabilities

func (ComponentFeatureCapabilities) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentFeatureCapabilities.

func (*ComponentFeatureCapabilities) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentFeatureCapabilities.

type ComponentFeatureCapabilitiesClient

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

ComponentFeatureCapabilitiesClient contains the methods for the ComponentFeatureCapabilities group. Don't use this type directly, use NewComponentFeatureCapabilitiesClient() instead.

func NewComponentFeatureCapabilitiesClient

func NewComponentFeatureCapabilitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ComponentFeatureCapabilitiesClient, error)

NewComponentFeatureCapabilitiesClient creates a new instance of ComponentFeatureCapabilitiesClient with the specified values.

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

func (*ComponentFeatureCapabilitiesClient) Get

Get - Returns feature capabilities of the application insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - ComponentFeatureCapabilitiesClientGetOptions contains the optional parameters for the ComponentFeatureCapabilitiesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FeatureCapabilitiesGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewComponentFeatureCapabilitiesClient().Get(ctx, "my-resource-group", "my-component", 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.ComponentFeatureCapabilities = armapplicationinsights.ComponentFeatureCapabilities{
	// 	AnalyticsIntegration: to.Ptr(true),
	// 	APIAccessLevel: to.Ptr("Premium"),
	// 	ApplicationMap: to.Ptr(true),
	// 	BurstThrottlePolicy: to.Ptr("B2"),
	// 	DailyCap: to.Ptr[float32](0.0323),
	// 	DailyCapResetTime: to.Ptr[float32](4),
	// 	LiveStreamMetrics: to.Ptr(true),
	// 	MultipleStepWebTest: to.Ptr(true),
	// 	OpenSchema: to.Ptr(true),
	// 	PowerBIIntegration: to.Ptr(true),
	// 	ProactiveDetection: to.Ptr(false),
	// 	SupportExportData: to.Ptr(true),
	// 	ThrottleRate: to.Ptr[float32](0),
	// 	TrackingType: to.Ptr("Basic"),
	// 	WorkItemIntegration: to.Ptr(true),
	// }
}
Output:

type ComponentFeatureCapabilitiesClientGetOptions added in v0.2.0

type ComponentFeatureCapabilitiesClientGetOptions struct {
}

ComponentFeatureCapabilitiesClientGetOptions contains the optional parameters for the ComponentFeatureCapabilitiesClient.Get method.

type ComponentFeatureCapabilitiesClientGetResponse added in v0.2.0

type ComponentFeatureCapabilitiesClientGetResponse struct {
	// An Application Insights component feature capabilities
	ComponentFeatureCapabilities
}

ComponentFeatureCapabilitiesClientGetResponse contains the response from method ComponentFeatureCapabilitiesClient.Get.

type ComponentFeatureCapability added in v0.2.0

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

	// READ-ONLY; The meter used for the capability.
	MeterID *string

	// READ-ONLY; The meter rate of the meter.
	MeterRateFrequency *string

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

	// READ-ONLY; The unit of the capability.
	Unit *string

	// READ-ONLY; The value of the capability.
	Value *string
}

ComponentFeatureCapability - An Application Insights component feature capability

func (ComponentFeatureCapability) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentFeatureCapability.

func (*ComponentFeatureCapability) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentFeatureCapability.

type ComponentListResult added in v0.2.0

type ComponentListResult struct {
	// REQUIRED; List of Application Insights component definitions.
	Value []*Component

	// The URI to get the next set of Application Insights component definitions if too many components where returned in the
	// result set.
	NextLink *string
}

ComponentListResult - Describes the list of Application Insights Resources.

func (ComponentListResult) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentListResult.

func (*ComponentListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentListResult.

type ComponentProactiveDetectionConfiguration added in v0.2.0

type ComponentProactiveDetectionConfiguration struct {
	// Custom email addresses for this rule notifications
	CustomEmails []*string

	// A flag that indicates whether this rule is enabled by the user
	Enabled *bool

	// The last time this rule was updated
	LastUpdatedTime *string

	// The rule name
	Name *string

	// Static definitions of the ProactiveDetection configuration rule (same values for all components).
	RuleDefinitions *ComponentProactiveDetectionConfigurationRuleDefinitions

	// A flag that indicated whether notifications on this rule should be sent to subscription owners
	SendEmailsToSubscriptionOwners *bool
}

ComponentProactiveDetectionConfiguration - Properties that define a ProactiveDetection configuration.

func (ComponentProactiveDetectionConfiguration) MarshalJSON added in v0.2.0

MarshalJSON implements the json.Marshaller interface for type ComponentProactiveDetectionConfiguration.

func (*ComponentProactiveDetectionConfiguration) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentProactiveDetectionConfiguration.

type ComponentProactiveDetectionConfigurationRuleDefinitions added in v0.2.0

type ComponentProactiveDetectionConfigurationRuleDefinitions struct {
	// The rule description
	Description *string

	// The rule name as it is displayed in UI
	DisplayName *string

	// URL which displays additional info about the proactive detection rule
	HelpURL *string

	// A flag indicating whether the rule is enabled by default
	IsEnabledByDefault *bool

	// A flag indicating whether the rule is hidden (from the UI)
	IsHidden *bool

	// A flag indicating whether the rule is in preview
	IsInPreview *bool

	// The rule name
	Name *string

	// A flag indicating whether email notifications are supported for detections for this rule
	SupportsEmailNotifications *bool
}

ComponentProactiveDetectionConfigurationRuleDefinitions - Static definitions of the ProactiveDetection configuration rule (same values for all components).

func (ComponentProactiveDetectionConfigurationRuleDefinitions) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type ComponentProactiveDetectionConfigurationRuleDefinitions.

func (*ComponentProactiveDetectionConfigurationRuleDefinitions) UnmarshalJSON added in v1.1.0

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentProactiveDetectionConfigurationRuleDefinitions.

type ComponentProperties added in v0.2.0

type ComponentProperties struct {
	// REQUIRED; Type of application being monitored.
	ApplicationType *ApplicationType

	// Disable IP masking.
	DisableIPMasking *bool

	// Disable Non-AAD based Auth.
	DisableLocalAuth *bool

	// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set
	// to 'Bluefield' when creating/updating a component via the REST API.
	FlowType *FlowType

	// Force users to create their own storage account for profiler and debugger.
	ForceCustomerStorageForProfiler *bool

	// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp.
	HockeyAppID *string

	// Purge data immediately after 30 days.
	ImmediatePurgeDataOn30Days *bool

	// Indicates the flow of the ingestion.
	IngestionMode *IngestionMode

	// The network access type for accessing Application Insights ingestion.
	PublicNetworkAccessForIngestion *PublicNetworkAccessType

	// The network access type for accessing Application Insights query.
	PublicNetworkAccessForQuery *PublicNetworkAccessType

	// Describes what tool created this Application Insights component. Customers using this API should set this to the default
	// 'rest'.
	RequestSource *RequestSource

	// Retention period in days.
	RetentionInDays *int32

	// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry.
	SamplingPercentage *float64

	// Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an application
	// with this API version. Applications from older versions will not have
	// this property.
	WorkspaceResourceID *string

	// READ-ONLY; Application Insights Unique ID for your Application.
	AppID *string

	// READ-ONLY; The unique ID of your application. This field mirrors the 'Name' field and cannot be changed.
	ApplicationID *string

	// READ-ONLY; Application Insights component connection string.
	ConnectionString *string

	// READ-ONLY; Creation Date for the Application Insights component, in ISO 8601 format.
	CreationDate *time.Time

	// READ-ONLY; Token used to authenticate communications with between Application Insights and HockeyApp.
	HockeyAppToken *string

	// READ-ONLY; Application Insights Instrumentation key. A read-only value that applications can use to identify the destination
	// for all telemetry sent to Azure Application Insights. This value will be supplied upon
	// construction of each new Application Insights component.
	InstrumentationKey *string

	// READ-ONLY; The date which the component got migrated to LA, in ISO 8601 format.
	LaMigrationDate *time.Time

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

	// READ-ONLY; List of linked private link scope resources.
	PrivateLinkScopedResources []*PrivateLinkScopedResource

	// READ-ONLY; Current state of this component: whether or not is has been provisioned within the resource group it is defined.
	// Users cannot change this value but are able to read from it. Values will include
	// Succeeded, Deploying, Canceled, and Failed.
	ProvisioningState *string

	// READ-ONLY; Azure Tenant Id.
	TenantID *string
}

ComponentProperties - Properties that define an Application Insights component resource.

func (ComponentProperties) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentProperties.

func (*ComponentProperties) UnmarshalJSON added in v0.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentProperties.

type ComponentPurgeBody

type ComponentPurgeBody struct {
	// REQUIRED; The set of columns and filters (queries) to run over them to purge the resulting data.
	Filters []*ComponentPurgeBodyFilters

	// REQUIRED; Table from which to purge data.
	Table *string
}

ComponentPurgeBody - Describes the body of a purge request for an App Insights component

func (ComponentPurgeBody) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ComponentPurgeBody.

func (*ComponentPurgeBody) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentPurgeBody.

type ComponentPurgeBodyFilters

type ComponentPurgeBodyFilters struct {
	// The column of the table over which the given query should run
	Column *string

	// When filtering over custom dimensions, this key will be used as the name of the custom dimension.
	Key *string

	// A query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <,
	// <=, between, and have the same behavior as they would in a KQL query.
	Operator *string

	// the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or
	// array of values.
	Value any
}

ComponentPurgeBodyFilters - User-defined filters to return data which will be purged from the table.

func (ComponentPurgeBodyFilters) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentPurgeBodyFilters.

func (*ComponentPurgeBodyFilters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentPurgeBodyFilters.

type ComponentPurgeResponse

type ComponentPurgeResponse struct {
	// REQUIRED; Id to use when querying for status for a particular purge operation.
	OperationID *string
}

ComponentPurgeResponse - Response containing operationId for a specific purge action.

func (ComponentPurgeResponse) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentPurgeResponse.

func (*ComponentPurgeResponse) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentPurgeResponse.

type ComponentPurgeStatusResponse

type ComponentPurgeStatusResponse struct {
	// REQUIRED; Status of the operation represented by the requested Id.
	Status *PurgeState
}

ComponentPurgeStatusResponse - Response containing status for a specific purge operation.

func (ComponentPurgeStatusResponse) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentPurgeStatusResponse.

func (*ComponentPurgeStatusResponse) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentPurgeStatusResponse.

type ComponentQuotaStatus added in v0.2.0

type ComponentQuotaStatus struct {
	// READ-ONLY; The Application ID for the Application Insights component.
	AppID *string

	// READ-ONLY; Date and time when the daily data volume cap will be reset, and data ingestion will resume.
	ExpirationTime *string

	// READ-ONLY; The daily data volume cap is met, and data ingestion will be stopped.
	ShouldBeThrottled *bool
}

ComponentQuotaStatus - An Application Insights component daily data volume cap status

func (ComponentQuotaStatus) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentQuotaStatus.

func (*ComponentQuotaStatus) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentQuotaStatus.

type ComponentQuotaStatusClient

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

ComponentQuotaStatusClient contains the methods for the ComponentQuotaStatus group. Don't use this type directly, use NewComponentQuotaStatusClient() instead.

func NewComponentQuotaStatusClient

func NewComponentQuotaStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ComponentQuotaStatusClient, error)

NewComponentQuotaStatusClient creates a new instance of ComponentQuotaStatusClient with the specified values.

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

func (*ComponentQuotaStatusClient) Get

Get - Returns daily data volume cap (quota) status for an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - ComponentQuotaStatusClientGetOptions contains the optional parameters for the ComponentQuotaStatusClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/QuotaStatusGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewComponentQuotaStatusClient().Get(ctx, "my-resource-group", "my-component", 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.ComponentQuotaStatus = armapplicationinsights.ComponentQuotaStatus{
	// 	AppID: to.Ptr("887f4bfd-b5fd-40d7-9fc3-123456789abc"),
	// 	ExpirationTime: to.Ptr("2017-08-10T05:00:00"),
	// 	ShouldBeThrottled: to.Ptr(true),
	// }
}
Output:

type ComponentQuotaStatusClientGetOptions added in v0.2.0

type ComponentQuotaStatusClientGetOptions struct {
}

ComponentQuotaStatusClientGetOptions contains the optional parameters for the ComponentQuotaStatusClient.Get method.

type ComponentQuotaStatusClientGetResponse added in v0.2.0

type ComponentQuotaStatusClientGetResponse struct {
	// An Application Insights component daily data volume cap status
	ComponentQuotaStatus
}

ComponentQuotaStatusClientGetResponse contains the response from method ComponentQuotaStatusClient.Get.

type ComponentWebTestLocation added in v0.2.0

type ComponentWebTestLocation struct {
	// READ-ONLY; The display name of the web test location.
	DisplayName *string

	// READ-ONLY; Internally defined geographic location tag.
	Tag *string
}

ComponentWebTestLocation - Properties that define a web test location available to an Application Insights Component.

func (ComponentWebTestLocation) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ComponentWebTestLocation.

func (*ComponentWebTestLocation) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentWebTestLocation.

type ComponentsClient

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

ComponentsClient contains the methods for the Components group. Don't use this type directly, use NewComponentsClient() instead.

func NewComponentsClient

func NewComponentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ComponentsClient, error)

NewComponentsClient creates a new instance of ComponentsClient with the specified values.

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

func (*ComponentsClient) CreateOrUpdate

func (client *ComponentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, insightProperties Component, options *ComponentsClientCreateOrUpdateOptions) (ComponentsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-02-02

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • insightProperties - Properties that need to be specified to create an Application Insights component.
  • options - ComponentsClientCreateOrUpdateOptions contains the optional parameters for the ComponentsClient.CreateOrUpdate method.
Example (ComponentCreate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsCreate.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewComponentsClient().CreateOrUpdate(ctx, "my-resource-group", "my-component", armapplicationinsights.Component{
		Location: to.Ptr("South Central US"),
		Kind:     to.Ptr("web"),
		Properties: &armapplicationinsights.ComponentProperties{
			ApplicationType:     to.Ptr(armapplicationinsights.ApplicationTypeWeb),
			FlowType:            to.Ptr(armapplicationinsights.FlowTypeBluefield),
			RequestSource:       to.Ptr(armapplicationinsights.RequestSourceRest),
			WorkspaceResourceID: to.Ptr("/subscriptions/subid/resourcegroups/my-resource-group/providers/microsoft.operationalinsights/workspaces/my-workspace"),
		},
	}, 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.Component = armapplicationinsights.Component{
	// 	Name: to.Ptr("my-component"),
	// 	Type: to.Ptr("Microsoft.Insights/components"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component"),
	// 	Location: to.Ptr("South Central US"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Kind: to.Ptr("web"),
	// 	Properties: &armapplicationinsights.ComponentProperties{
	// 		AppID: to.Ptr("887f4bfd-b5fd-40d7-9fc3-123456789abc"),
	// 		ApplicationID: to.Ptr("my-component"),
	// 		ApplicationType: to.Ptr(armapplicationinsights.ApplicationTypeWeb),
	// 		ConnectionString: to.Ptr("InstrumentationKey=bc095013-3cf2-45ac-ab47-123456789abc"),
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-24T01:05:38.593Z"); return t}()),
	// 		DisableIPMasking: to.Ptr(false),
	// 		FlowType: to.Ptr(armapplicationinsights.FlowTypeBluefield),
	// 		HockeyAppID: to.Ptr(""),
	// 		HockeyAppToken: to.Ptr(""),
	// 		IngestionMode: to.Ptr(armapplicationinsights.IngestionModeLogAnalytics),
	// 		InstrumentationKey: to.Ptr("bc095013-3cf2-45ac-ab47-123456789abc"),
	// 		RequestSource: to.Ptr(armapplicationinsights.RequestSourceRest),
	// 		SamplingPercentage: to.Ptr[float64](100),
	// 		TenantID: to.Ptr("f438d567-7177-4fe1-a5e3-123456789abc"),
	// 		WorkspaceResourceID: to.Ptr("/subscriptions/subid/resourcegroups/my-resource-group/providers/microsoft.operationalinsights/workspaces/my-workspace"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicNetworkAccessForIngestion: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
	// 		PublicNetworkAccessForQuery: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
	// 	},
	// }
}
Output:

Example (ComponentUpdate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsUpdate.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewComponentsClient().CreateOrUpdate(ctx, "my-resource-group", "my-component", armapplicationinsights.Component{
		Location: to.Ptr("South Central US"),
		Tags: map[string]*string{
			"ApplicationGatewayType": to.Ptr("Internal-Only"),
			"BillingEntity":          to.Ptr("Self"),
		},
		Kind: to.Ptr("web"),
	}, 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.Component = armapplicationinsights.Component{
	// 	Name: to.Ptr("my-component"),
	// 	Type: to.Ptr("Microsoft.Insights/components"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component"),
	// 	Location: to.Ptr("South Central US"),
	// 	Tags: map[string]*string{
	// 		"ApplicationGatewayType": to.Ptr("Internal-Only"),
	// 		"BillingEntity": to.Ptr("Self"),
	// 	},
	// 	Kind: to.Ptr("web"),
	// 	Properties: &armapplicationinsights.ComponentProperties{
	// 		AppID: to.Ptr("887f4bfd-b5fd-40d7-9fc3-123456789abc"),
	// 		ApplicationID: to.Ptr("my-component"),
	// 		ApplicationType: to.Ptr(armapplicationinsights.ApplicationTypeWeb),
	// 		ConnectionString: to.Ptr("InstrumentationKey=bc095013-3cf2-45ac-ab47-123456789abc"),
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-24T01:05:38.593Z"); return t}()),
	// 		DisableIPMasking: to.Ptr(false),
	// 		FlowType: to.Ptr(armapplicationinsights.FlowTypeBluefield),
	// 		HockeyAppID: to.Ptr(""),
	// 		HockeyAppToken: to.Ptr(""),
	// 		IngestionMode: to.Ptr(armapplicationinsights.IngestionModeLogAnalytics),
	// 		InstrumentationKey: to.Ptr("bc095013-3cf2-45ac-ab47-123456789abc"),
	// 		RequestSource: to.Ptr(armapplicationinsights.RequestSourceRest),
	// 		SamplingPercentage: to.Ptr[float64](100),
	// 		TenantID: to.Ptr("f438d567-7177-4fe1-a5e3-123456789abc"),
	// 		WorkspaceResourceID: to.Ptr("/subscriptions/subid/resourcegroups/my-resource-group/providers/microsoft.operationalinsights/workspaces/my-workspace"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicNetworkAccessForIngestion: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
	// 		PublicNetworkAccessForQuery: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
	// 	},
	// }
}
Output:

func (*ComponentsClient) Delete

func (client *ComponentsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, options *ComponentsClientDeleteOptions) (ComponentsClientDeleteResponse, error)

Delete - Deletes an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-02-02

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - ComponentsClientDeleteOptions contains the optional parameters for the ComponentsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

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

func (*ComponentsClient) Get

func (client *ComponentsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ComponentsClientGetOptions) (ComponentsClientGetResponse, error)

Get - Returns an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-02-02

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - ComponentsClientGetOptions contains the optional parameters for the ComponentsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewComponentsClient().Get(ctx, "my-resource-group", "my-component", 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.Component = armapplicationinsights.Component{
	// 	Name: to.Ptr("my-component"),
	// 	Type: to.Ptr("Microsoft.Insights/components"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component"),
	// 	Location: to.Ptr("South Central US"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Kind: to.Ptr("web"),
	// 	Properties: &armapplicationinsights.ComponentProperties{
	// 		AppID: to.Ptr("887f4bfd-b5fd-40d7-9fc3-123456789abc"),
	// 		ApplicationID: to.Ptr("my-component"),
	// 		ApplicationType: to.Ptr(armapplicationinsights.ApplicationTypeWeb),
	// 		ConnectionString: to.Ptr("InstrumentationKey=bc095013-3cf2-45ac-ab47-123456789abc"),
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-24T01:05:38.593Z"); return t}()),
	// 		DisableIPMasking: to.Ptr(false),
	// 		FlowType: to.Ptr(armapplicationinsights.FlowTypeBluefield),
	// 		HockeyAppID: to.Ptr(""),
	// 		HockeyAppToken: to.Ptr(""),
	// 		IngestionMode: to.Ptr(armapplicationinsights.IngestionModeLogAnalytics),
	// 		InstrumentationKey: to.Ptr("bc095013-3cf2-45ac-ab47-123456789abc"),
	// 		RequestSource: to.Ptr(armapplicationinsights.RequestSourceRest),
	// 		SamplingPercentage: to.Ptr[float64](100),
	// 		TenantID: to.Ptr("f438d567-7177-4fe1-a5e3-123456789abc"),
	// 		WorkspaceResourceID: to.Ptr("/subscriptions/subid/resourcegroups/my-resource-group/providers/microsoft.operationalinsights/workspaces/my-workspace"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicNetworkAccessForIngestion: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
	// 		PublicNetworkAccessForQuery: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
	// 	},
	// }
}
Output:

func (*ComponentsClient) GetPurgeStatus

func (client *ComponentsClient) GetPurgeStatus(ctx context.Context, resourceGroupName string, resourceName string, purgeID string, options *ComponentsClientGetPurgeStatusOptions) (ComponentsClientGetPurgeStatusResponse, error)

GetPurgeStatus - Get status for an ongoing purge operation. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-02-02

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • purgeID - In a purge status request, this is the Id of the operation the status of which is returned.
  • options - ComponentsClientGetPurgeStatusOptions contains the optional parameters for the ComponentsClient.GetPurgeStatus method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsPurgeStatus.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewComponentsClient().GetPurgeStatus(ctx, "OIAutoRest5123", "aztest5048", "purge-970318e7-b859-4edb-8903-83b1b54d0b74", 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.ComponentPurgeStatusResponse = armapplicationinsights.ComponentPurgeStatusResponse{
	// 	Status: to.Ptr(armapplicationinsights.PurgeStateCompleted),
	// }
}
Output:

func (*ComponentsClient) NewListByResourceGroupPager added in v0.4.0

func (client *ComponentsClient) NewListByResourceGroupPager(resourceGroupName string, options *ComponentsClientListByResourceGroupOptions) *runtime.Pager[ComponentsClientListByResourceGroupResponse]

NewListByResourceGroupPager - Gets a list of Application Insights components within a resource group.

Generated from API version 2020-02-02

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - ComponentsClientListByResourceGroupOptions contains the optional parameters for the ComponentsClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewComponentsClient().NewListByResourceGroupPager("my-resource-group", 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.ComponentListResult = armapplicationinsights.ComponentListResult{
		// 	Value: []*armapplicationinsights.Component{
		// 		{
		// 			Name: to.Ptr("my-component"),
		// 			Type: to.Ptr("Microsoft.Insights/components"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component"),
		// 			Location: to.Ptr("South Central US"),
		// 			Tags: map[string]*string{
		// 			},
		// 			Kind: to.Ptr("web"),
		// 			Properties: &armapplicationinsights.ComponentProperties{
		// 				AppID: to.Ptr("16526d1a-dfba-4362-a9e9-123456789abc"),
		// 				ApplicationID: to.Ptr("my-component"),
		// 				ApplicationType: to.Ptr(armapplicationinsights.ApplicationTypeWeb),
		// 				ConnectionString: to.Ptr("InstrumentationKey=dc5931c7-a7ad-4ad0-89d6-123456789abc"),
		// 				CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-14T12:24:05.004Z"); return t}()),
		// 				DisableIPMasking: to.Ptr(false),
		// 				FlowType: to.Ptr(armapplicationinsights.FlowTypeBluefield),
		// 				HockeyAppID: to.Ptr(""),
		// 				HockeyAppToken: to.Ptr(""),
		// 				IngestionMode: to.Ptr(armapplicationinsights.IngestionModeLogAnalytics),
		// 				InstrumentationKey: to.Ptr("dc5931c7-a7ad-4ad0-89d6-123456789abc"),
		// 				RequestSource: to.Ptr(armapplicationinsights.RequestSourceRest),
		// 				SamplingPercentage: to.Ptr[float64](100),
		// 				TenantID: to.Ptr("f438d567-7177-4fe1-a5e3-123456789abc"),
		// 				WorkspaceResourceID: to.Ptr("/subscriptions/subid/resourcegroups/my-resource-group/providers/microsoft.operationalinsights/workspaces/my-workspace"),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				PublicNetworkAccessForIngestion: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
		// 				PublicNetworkAccessForQuery: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("my-other-component"),
		// 			Type: to.Ptr("Microsoft.Insights/components"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/my-other-resource-group/providers/Microsoft.Insights/components/my-other-component"),
		// 			Location: to.Ptr("South Central US"),
		// 			Tags: map[string]*string{
		// 			},
		// 			Kind: to.Ptr("web"),
		// 			Properties: &armapplicationinsights.ComponentProperties{
		// 				AppID: to.Ptr("887f4bfd-b5fd-40d7-9fc3-123456789abc"),
		// 				ApplicationID: to.Ptr("my-other-component"),
		// 				ApplicationType: to.Ptr(armapplicationinsights.ApplicationTypeWeb),
		// 				ConnectionString: to.Ptr("InstrumentationKey=bc095013-3cf2-45ac-ab47-123456789abc"),
		// 				CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-24T01:05:38.593Z"); return t}()),
		// 				DisableIPMasking: to.Ptr(false),
		// 				FlowType: to.Ptr(armapplicationinsights.FlowTypeBluefield),
		// 				HockeyAppID: to.Ptr(""),
		// 				HockeyAppToken: to.Ptr(""),
		// 				IngestionMode: to.Ptr(armapplicationinsights.IngestionModeLogAnalytics),
		// 				InstrumentationKey: to.Ptr("bc095013-3cf2-45ac-ab47-123456789abc"),
		// 				RequestSource: to.Ptr(armapplicationinsights.RequestSourceRest),
		// 				SamplingPercentage: to.Ptr[float64](50),
		// 				TenantID: to.Ptr("f438d567-7177-4fe1-a5e3-123456789abc"),
		// 				WorkspaceResourceID: to.Ptr("/subscriptions/subid/resourcegroups/my-resource-group/providers/microsoft.operationalinsights/workspaces/my-workspace"),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				PublicNetworkAccessForIngestion: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
		// 				PublicNetworkAccessForQuery: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ComponentsClient) NewListPager added in v0.4.0

NewListPager - Gets a list of all Application Insights components within a subscription.

Generated from API version 2020-02-02

  • options - ComponentsClientListOptions contains the optional parameters for the ComponentsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewComponentsClient().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.ComponentListResult = armapplicationinsights.ComponentListResult{
		// 	Value: []*armapplicationinsights.Component{
		// 		{
		// 			Name: to.Ptr("my-component"),
		// 			Type: to.Ptr("Microsoft.Insights/components"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component"),
		// 			Location: to.Ptr("South Central US"),
		// 			Tags: map[string]*string{
		// 			},
		// 			Kind: to.Ptr("web"),
		// 			Properties: &armapplicationinsights.ComponentProperties{
		// 				AppID: to.Ptr("16526d1a-dfba-4362-a9e9-123456789abc"),
		// 				ApplicationID: to.Ptr("my-component"),
		// 				ApplicationType: to.Ptr(armapplicationinsights.ApplicationTypeWeb),
		// 				ConnectionString: to.Ptr("InstrumentationKey=dc5931c7-a7ad-4ad0-89d6-123456789abc"),
		// 				CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-14T12:24:05.004Z"); return t}()),
		// 				DisableIPMasking: to.Ptr(false),
		// 				FlowType: to.Ptr(armapplicationinsights.FlowTypeBluefield),
		// 				HockeyAppID: to.Ptr(""),
		// 				HockeyAppToken: to.Ptr(""),
		// 				IngestionMode: to.Ptr(armapplicationinsights.IngestionModeLogAnalytics),
		// 				InstrumentationKey: to.Ptr("dc5931c7-a7ad-4ad0-89d6-123456789abc"),
		// 				RequestSource: to.Ptr(armapplicationinsights.RequestSourceRest),
		// 				SamplingPercentage: to.Ptr[float64](75),
		// 				TenantID: to.Ptr("f438d567-7177-4fe1-a5e3-123456789abc"),
		// 				WorkspaceResourceID: to.Ptr("/subscriptions/subid/resourcegroups/my-resource-group/providers/microsoft.operationalinsights/workspaces/my-workspace"),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				PublicNetworkAccessForIngestion: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
		// 				PublicNetworkAccessForQuery: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("my-other-component"),
		// 			Type: to.Ptr("Microsoft.Insights/components"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/my-other-resource-group/providers/Microsoft.Insights/components/my-other-component"),
		// 			Location: to.Ptr("South Central US"),
		// 			Tags: map[string]*string{
		// 			},
		// 			Kind: to.Ptr("web"),
		// 			Properties: &armapplicationinsights.ComponentProperties{
		// 				AppID: to.Ptr("887f4bfd-b5fd-40d7-9fc3-123456789abc"),
		// 				ApplicationID: to.Ptr("my-other-component"),
		// 				ApplicationType: to.Ptr(armapplicationinsights.ApplicationTypeWeb),
		// 				ConnectionString: to.Ptr("InstrumentationKey=bc095013-3cf2-45ac-ab47-123456789abc"),
		// 				CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-24T01:05:38.593Z"); return t}()),
		// 				DisableIPMasking: to.Ptr(false),
		// 				FlowType: to.Ptr(armapplicationinsights.FlowTypeBluefield),
		// 				HockeyAppID: to.Ptr(""),
		// 				HockeyAppToken: to.Ptr(""),
		// 				IngestionMode: to.Ptr(armapplicationinsights.IngestionModeLogAnalytics),
		// 				InstrumentationKey: to.Ptr("bc095013-3cf2-45ac-ab47-123456789abc"),
		// 				RequestSource: to.Ptr(armapplicationinsights.RequestSourceRest),
		// 				SamplingPercentage: to.Ptr[float64](30),
		// 				TenantID: to.Ptr("f438d567-7177-4fe1-a5e3-123456789abc"),
		// 				WorkspaceResourceID: to.Ptr("/subscriptions/subid/resourcegroups/my-resource-group/providers/microsoft.operationalinsights/workspaces/my-workspace"),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				PublicNetworkAccessForIngestion: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
		// 				PublicNetworkAccessForQuery: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ComponentsClient) Purge

func (client *ComponentsClient) Purge(ctx context.Context, resourceGroupName string, resourceName string, body ComponentPurgeBody, options *ComponentsClientPurgeOptions) (ComponentsClientPurgeResponse, error)

Purge - Purges data in an Application Insights component by a set of user-defined filters. In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-02-02

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • body - Describes the body of a request to purge data in a single table of an Application Insights component
  • options - ComponentsClientPurgeOptions contains the optional parameters for the ComponentsClient.Purge method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsPurge.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewComponentsClient().Purge(ctx, "OIAutoRest5123", "aztest5048", armapplicationinsights.ComponentPurgeBody{
		Filters: []*armapplicationinsights.ComponentPurgeBodyFilters{
			{
				Column:   to.Ptr("TimeGenerated"),
				Operator: to.Ptr(">"),
				Value:    "2017-09-01T00:00:00",
			}},
		Table: to.Ptr("Heartbeat"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ComponentsClient) UpdateTags

func (client *ComponentsClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, componentTags TagsResource, options *ComponentsClientUpdateTagsOptions) (ComponentsClientUpdateTagsResponse, error)

UpdateTags - Updates an existing component's tags. To update other fields use the CreateOrUpdate method. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-02-02

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • componentTags - Updated tag information to set into the component instance.
  • options - ComponentsClientUpdateTagsOptions contains the optional parameters for the ComponentsClient.UpdateTags method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsUpdateTagsOnly.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewComponentsClient().UpdateTags(ctx, "my-resource-group", "my-component", armapplicationinsights.TagsResource{
		Tags: map[string]*string{
			"ApplicationGatewayType": to.Ptr("Internal-Only"),
			"BillingEntity":          to.Ptr("Self"),
			"Color":                  to.Ptr("AzureBlue"),
			"CustomField_01":         to.Ptr("Custom text in some random field named randomly"),
			"NodeType":               to.Ptr("Edge"),
		},
	}, 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.Component = armapplicationinsights.Component{
	// 	Name: to.Ptr("my-component"),
	// 	Type: to.Ptr("Microsoft.Insights/components"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component"),
	// 	Location: to.Ptr("South Central US"),
	// 	Tags: map[string]*string{
	// 		"ApplicationGatewayType": to.Ptr("Internal-Only"),
	// 		"BillingEntity": to.Ptr("Self"),
	// 		"Color": to.Ptr("AzureBlue"),
	// 		"CustomField_01": to.Ptr("Custom text in some random field named randomly"),
	// 		"NodeType": to.Ptr("Edge"),
	// 	},
	// 	Kind: to.Ptr("web"),
	// 	Properties: &armapplicationinsights.ComponentProperties{
	// 		AppID: to.Ptr("887f4bfd-b5fd-40d7-9fc3-123456789abc"),
	// 		ApplicationID: to.Ptr("my-component"),
	// 		ApplicationType: to.Ptr(armapplicationinsights.ApplicationTypeWeb),
	// 		ConnectionString: to.Ptr("InstrumentationKey=bc095013-3cf2-45ac-ab47-123456789abc"),
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-24T01:05:38.593Z"); return t}()),
	// 		DisableIPMasking: to.Ptr(false),
	// 		FlowType: to.Ptr(armapplicationinsights.FlowTypeBluefield),
	// 		HockeyAppID: to.Ptr(""),
	// 		HockeyAppToken: to.Ptr(""),
	// 		IngestionMode: to.Ptr(armapplicationinsights.IngestionModeLogAnalytics),
	// 		InstrumentationKey: to.Ptr("bc095013-3cf2-45ac-ab47-123456789abc"),
	// 		RequestSource: to.Ptr(armapplicationinsights.RequestSourceRest),
	// 		SamplingPercentage: to.Ptr[float64](100),
	// 		TenantID: to.Ptr("f438d567-7177-4fe1-a5e3-123456789abc"),
	// 		WorkspaceResourceID: to.Ptr("/subscriptions/subid/resourcegroups/my-resource-group/providers/microsoft.operationalinsights/workspaces/my-workspace"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicNetworkAccessForIngestion: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
	// 		PublicNetworkAccessForQuery: to.Ptr(armapplicationinsights.PublicNetworkAccessTypeEnabled),
	// 	},
	// }
}
Output:

type ComponentsClientCreateOrUpdateOptions added in v0.2.0

type ComponentsClientCreateOrUpdateOptions struct {
}

ComponentsClientCreateOrUpdateOptions contains the optional parameters for the ComponentsClient.CreateOrUpdate method.

type ComponentsClientCreateOrUpdateResponse added in v0.2.0

type ComponentsClientCreateOrUpdateResponse struct {
	// An Application Insights component definition.
	Component
}

ComponentsClientCreateOrUpdateResponse contains the response from method ComponentsClient.CreateOrUpdate.

type ComponentsClientDeleteOptions added in v0.2.0

type ComponentsClientDeleteOptions struct {
}

ComponentsClientDeleteOptions contains the optional parameters for the ComponentsClient.Delete method.

type ComponentsClientDeleteResponse added in v0.2.0

type ComponentsClientDeleteResponse struct {
}

ComponentsClientDeleteResponse contains the response from method ComponentsClient.Delete.

type ComponentsClientGetOptions added in v0.2.0

type ComponentsClientGetOptions struct {
}

ComponentsClientGetOptions contains the optional parameters for the ComponentsClient.Get method.

type ComponentsClientGetPurgeStatusOptions added in v0.2.0

type ComponentsClientGetPurgeStatusOptions struct {
}

ComponentsClientGetPurgeStatusOptions contains the optional parameters for the ComponentsClient.GetPurgeStatus method.

type ComponentsClientGetPurgeStatusResponse added in v0.2.0

type ComponentsClientGetPurgeStatusResponse struct {
	// Response containing status for a specific purge operation.
	ComponentPurgeStatusResponse
}

ComponentsClientGetPurgeStatusResponse contains the response from method ComponentsClient.GetPurgeStatus.

type ComponentsClientGetResponse added in v0.2.0

type ComponentsClientGetResponse struct {
	// An Application Insights component definition.
	Component
}

ComponentsClientGetResponse contains the response from method ComponentsClient.Get.

type ComponentsClientListByResourceGroupOptions added in v0.2.0

type ComponentsClientListByResourceGroupOptions struct {
}

ComponentsClientListByResourceGroupOptions contains the optional parameters for the ComponentsClient.NewListByResourceGroupPager method.

type ComponentsClientListByResourceGroupResponse added in v0.2.0

type ComponentsClientListByResourceGroupResponse struct {
	// Describes the list of Application Insights Resources.
	ComponentListResult
}

ComponentsClientListByResourceGroupResponse contains the response from method ComponentsClient.NewListByResourceGroupPager.

type ComponentsClientListOptions added in v0.2.0

type ComponentsClientListOptions struct {
}

ComponentsClientListOptions contains the optional parameters for the ComponentsClient.NewListPager method.

type ComponentsClientListResponse added in v0.2.0

type ComponentsClientListResponse struct {
	// Describes the list of Application Insights Resources.
	ComponentListResult
}

ComponentsClientListResponse contains the response from method ComponentsClient.NewListPager.

type ComponentsClientPurgeOptions added in v0.2.0

type ComponentsClientPurgeOptions struct {
}

ComponentsClientPurgeOptions contains the optional parameters for the ComponentsClient.Purge method.

type ComponentsClientPurgeResponse added in v0.2.0

type ComponentsClientPurgeResponse struct {
	// Response containing operationId for a specific purge action.
	ComponentPurgeResponse
}

ComponentsClientPurgeResponse contains the response from method ComponentsClient.Purge.

type ComponentsClientUpdateTagsOptions added in v0.2.0

type ComponentsClientUpdateTagsOptions struct {
}

ComponentsClientUpdateTagsOptions contains the optional parameters for the ComponentsClient.UpdateTags method.

type ComponentsClientUpdateTagsResponse added in v0.2.0

type ComponentsClientUpdateTagsResponse struct {
	// An Application Insights component definition.
	Component
}

ComponentsClientUpdateTagsResponse contains the response from method ComponentsClient.UpdateTags.

type ComponentsResource

type ComponentsResource struct {
	// REQUIRED; Resource location
	Location *string

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; Azure resource Id
	ID *string

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

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

ComponentsResource - An azure resource object

func (ComponentsResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ComponentsResource.

func (*ComponentsResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComponentsResource.

type ErrorFieldContract added in v1.0.0

type ErrorFieldContract struct {
	// Property level error code.
	Code *string

	// Human-readable representation of property-level error.
	Message *string

	// Property name.
	Target *string
}

ErrorFieldContract - Error Field contract.

func (ErrorFieldContract) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorFieldContract.

func (*ErrorFieldContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorFieldContract.

type ErrorResponse

type ErrorResponse struct {
	// Error code.
	Code *string

	// Error message indicating why the operation failed.
	Message *string
}

ErrorResponse - Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message.

func (ErrorResponse) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type ErrorResponseComponents added in v0.3.0

type ErrorResponseComponents struct {
	// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error
	// message.
	Error *ErrorResponseComponentsError
}

func (ErrorResponseComponents) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponseComponents.

func (*ErrorResponseComponents) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseComponents.

type ErrorResponseComponentsError added in v0.3.0

type ErrorResponseComponentsError struct {
	// READ-ONLY; Error code.
	Code *string

	// READ-ONLY; Error message indicating why the operation failed.
	Message *string
}

ErrorResponseComponentsError - Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message.

func (ErrorResponseComponentsError) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponseComponentsError.

func (*ErrorResponseComponentsError) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseComponentsError.

type ExportConfigurationsClient

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

ExportConfigurationsClient contains the methods for the ExportConfigurations group. Don't use this type directly, use NewExportConfigurationsClient() instead.

func NewExportConfigurationsClient

func NewExportConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExportConfigurationsClient, error)

NewExportConfigurationsClient creates a new instance of ExportConfigurationsClient with the specified values.

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

func (*ExportConfigurationsClient) Create

Create - Create a Continuous Export configuration of an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • exportProperties - Properties that need to be specified to create a Continuous Export configuration of a Application Insights component.
  • options - ExportConfigurationsClientCreateOptions contains the optional parameters for the ExportConfigurationsClient.Create method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationsPost.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewExportConfigurationsClient().Create(ctx, "my-resource-group", "my-component", armapplicationinsights.ComponentExportRequest{
		DestinationAccountID:             to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.ClassicStorage/storageAccounts/mystorageblob"),
		DestinationAddress:               to.Ptr("https://mystorageblob.blob.core.windows.net/testexport?sv=2015-04-05&sr=c&sig=token"),
		DestinationStorageLocationID:     to.Ptr("eastus"),
		DestinationStorageSubscriptionID: to.Ptr("subid"),
		DestinationType:                  to.Ptr("Blob"),
		IsEnabled:                        to.Ptr("true"),
		NotificationQueueEnabled:         to.Ptr("false"),
		NotificationQueueURI:             to.Ptr(""),
		RecordTypes:                      to.Ptr("Requests, Event, Exceptions, Metrics, PageViews, PageViewPerformance, Rdd, PerformanceCounters, Availability"),
	}, 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.ComponentExportConfigurationArray = []*armapplicationinsights.ComponentExportConfiguration{
	// 	{
	// 		ApplicationName: to.Ptr("my-component"),
	// 		ContainerName: to.Ptr("mystorageblob"),
	// 		DestinationAccountID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Storage/storageAccounts/mystorageblob"),
	// 		DestinationStorageLocationID: to.Ptr("eastasia"),
	// 		DestinationStorageSubscriptionID: to.Ptr("subidc"),
	// 		DestinationType: to.Ptr("Blob"),
	// 		ExportID: to.Ptr("uGOoki0jQsyEs3IdQ83Q4QsNr4="),
	// 		ExportStatus: to.Ptr("Preparing"),
	// 		InstrumentationKey: to.Ptr("8330b4a4-0b8e-40cf-a643-bbaf60d375c9"),
	// 		IsUserEnabled: to.Ptr("False"),
	// 		LastGapTime: to.Ptr("9999-12-31T23:59:59.999Z"),
	// 		LastSuccessTime: to.Ptr("9999-12-31T23:59:59.999Z"),
	// 		LastUserUpdate: to.Ptr("2017-06-05T06:34:26.957Z"),
	// 		NotificationQueueEnabled: to.Ptr("False"),
	// 		PermanentErrorReason: to.Ptr("None"),
	// 		RecordTypes: to.Ptr("Requests, Event, Exceptions, Metrics, PageViews, PageViewPerformance, Rdd, PerformanceCounters, Availability"),
	// 		ResourceGroup: to.Ptr("2"),
	// 		StorageName: to.Ptr("mystorageblob"),
	// 		SubscriptionID: to.Ptr("subid"),
	// }}
}
Output:

func (*ExportConfigurationsClient) Delete

Delete - Delete a Continuous Export configuration of an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • exportID - The Continuous Export configuration ID. This is unique within a Application Insights component.
  • options - ExportConfigurationsClientDeleteOptions contains the optional parameters for the ExportConfigurationsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewExportConfigurationsClient().Delete(ctx, "my-resource-group", "my-component", "uGOoki0jQsyEs3IdQ83Q4QsNr4=", 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.ComponentExportConfiguration = armapplicationinsights.ComponentExportConfiguration{
	// 	ApplicationName: to.Ptr("my-component"),
	// 	ContainerName: to.Ptr("mystorageblob"),
	// 	DestinationAccountID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Storage/storageAccounts/mystorageblob"),
	// 	DestinationStorageLocationID: to.Ptr("eastasia"),
	// 	DestinationStorageSubscriptionID: to.Ptr("subidc"),
	// 	DestinationType: to.Ptr("Blob"),
	// 	ExportID: to.Ptr("uGOoki0jQsyEs3IdQ83Q4QsNr4="),
	// 	ExportStatus: to.Ptr("Preparing"),
	// 	InstrumentationKey: to.Ptr("8330b4a4-0b8e-40cf-a643-bbaf60d375c9"),
	// 	IsUserEnabled: to.Ptr("False"),
	// 	LastGapTime: to.Ptr("9999-12-31T23:59:59.999Z"),
	// 	LastSuccessTime: to.Ptr("9999-12-31T23:59:59.999Z"),
	// 	LastUserUpdate: to.Ptr("2017-06-05T06:34:26.957Z"),
	// 	NotificationQueueEnabled: to.Ptr("False"),
	// 	PermanentErrorReason: to.Ptr("None"),
	// 	RecordTypes: to.Ptr("Requests, Event, Exceptions, Metrics, PageViews, PageViewPerformance, Rdd, PerformanceCounters, Availability"),
	// 	ResourceGroup: to.Ptr("2"),
	// 	StorageName: to.Ptr("mystorageblob"),
	// 	SubscriptionID: to.Ptr("subid"),
	// }
}
Output:

func (*ExportConfigurationsClient) Get

Get - Get the Continuous Export configuration for this export id. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • exportID - The Continuous Export configuration ID. This is unique within a Application Insights component.
  • options - ExportConfigurationsClientGetOptions contains the optional parameters for the ExportConfigurationsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewExportConfigurationsClient().Get(ctx, "my-resource-group", "my-component", "uGOoki0jQsyEs3IdQ83Q4QsNr4=", 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.ComponentExportConfiguration = armapplicationinsights.ComponentExportConfiguration{
	// 	ApplicationName: to.Ptr("my-component"),
	// 	ContainerName: to.Ptr("mystorageblob"),
	// 	DestinationAccountID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Storage/storageAccounts/mystorageblob"),
	// 	DestinationStorageLocationID: to.Ptr("eastasia"),
	// 	DestinationStorageSubscriptionID: to.Ptr("subidc"),
	// 	DestinationType: to.Ptr("Blob"),
	// 	ExportID: to.Ptr("uGOoki0jQsyEs3IdQ83Q4QsNr4="),
	// 	ExportStatus: to.Ptr("Preparing"),
	// 	InstrumentationKey: to.Ptr("8330b4a4-0b8e-40cf-a643-bbaf60d375c9"),
	// 	IsUserEnabled: to.Ptr("False"),
	// 	LastGapTime: to.Ptr("9999-12-31T23:59:59.999Z"),
	// 	LastSuccessTime: to.Ptr("9999-12-31T23:59:59.999Z"),
	// 	LastUserUpdate: to.Ptr("2017-06-05T06:34:26.957Z"),
	// 	NotificationQueueEnabled: to.Ptr("False"),
	// 	PermanentErrorReason: to.Ptr("None"),
	// 	RecordTypes: to.Ptr("Requests, Event, Exceptions, Metrics, PageViews, PageViewPerformance, Rdd, PerformanceCounters, Availability"),
	// 	ResourceGroup: to.Ptr("2"),
	// 	StorageName: to.Ptr("mystorageblob"),
	// 	SubscriptionID: to.Ptr("subid"),
	// }
}
Output:

func (*ExportConfigurationsClient) List

List - Gets a list of Continuous Export configuration of an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - ExportConfigurationsClientListOptions contains the optional parameters for the ExportConfigurationsClient.List method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewExportConfigurationsClient().List(ctx, "my-resource-group", "my-component", 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.ComponentExportConfigurationArray = []*armapplicationinsights.ComponentExportConfiguration{
	// 	{
	// 		ApplicationName: to.Ptr("my-component"),
	// 		ContainerName: to.Ptr("mystorageblob"),
	// 		DestinationAccountID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Storage/storageAccounts/mystorageblob"),
	// 		DestinationStorageLocationID: to.Ptr("eastasia"),
	// 		DestinationStorageSubscriptionID: to.Ptr("subidc"),
	// 		DestinationType: to.Ptr("Blob"),
	// 		ExportID: to.Ptr("uGOoki0jQsyEs3IdQ83Q4QsNr4="),
	// 		ExportStatus: to.Ptr("Preparing"),
	// 		InstrumentationKey: to.Ptr("8330b4a4-0b8e-40cf-a643-bbaf60d375c9"),
	// 		IsUserEnabled: to.Ptr("False"),
	// 		LastGapTime: to.Ptr("9999-12-31T23:59:59.999Z"),
	// 		LastSuccessTime: to.Ptr("9999-12-31T23:59:59.999Z"),
	// 		LastUserUpdate: to.Ptr("2017-06-05T06:34:26.957Z"),
	// 		NotificationQueueEnabled: to.Ptr("False"),
	// 		PermanentErrorReason: to.Ptr("None"),
	// 		RecordTypes: to.Ptr("Requests, Event, Exceptions, Metrics, PageViews, PageViewPerformance, Rdd, PerformanceCounters, Availability"),
	// 		ResourceGroup: to.Ptr("2"),
	// 		StorageName: to.Ptr("mystorageblob"),
	// 		SubscriptionID: to.Ptr("subid"),
	// }}
}
Output:

func (*ExportConfigurationsClient) Update

func (client *ExportConfigurationsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, exportID string, exportProperties ComponentExportRequest, options *ExportConfigurationsClientUpdateOptions) (ExportConfigurationsClientUpdateResponse, error)

Update - Update the Continuous Export configuration for this export id. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • exportID - The Continuous Export configuration ID. This is unique within a Application Insights component.
  • exportProperties - Properties that need to be specified to update the Continuous Export configuration.
  • options - ExportConfigurationsClientUpdateOptions contains the optional parameters for the ExportConfigurationsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationUpdate.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewExportConfigurationsClient().Update(ctx, "my-resource-group", "my-component", "uGOoki0jQsyEs3IdQ83Q4QsNr4=", armapplicationinsights.ComponentExportRequest{
		DestinationAccountID:             to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.ClassicStorage/storageAccounts/mystorageblob"),
		DestinationAddress:               to.Ptr("https://mystorageblob.blob.core.windows.net/fchentest?sv=2015-04-05&sr=c&sig=token"),
		DestinationStorageLocationID:     to.Ptr("eastus"),
		DestinationStorageSubscriptionID: to.Ptr("subid"),
		DestinationType:                  to.Ptr("Blob"),
		IsEnabled:                        to.Ptr("true"),
		NotificationQueueEnabled:         to.Ptr("false"),
		NotificationQueueURI:             to.Ptr(""),
		RecordTypes:                      to.Ptr("Requests, Event, Exceptions, Metrics, PageViews, PageViewPerformance, Rdd, PerformanceCounters, Availability"),
	}, 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.ComponentExportConfiguration = armapplicationinsights.ComponentExportConfiguration{
	// 	ApplicationName: to.Ptr("my-component"),
	// 	ContainerName: to.Ptr("mystorageblob"),
	// 	DestinationAccountID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Storage/storageAccounts/mystorageblob"),
	// 	DestinationStorageLocationID: to.Ptr("eastasia"),
	// 	DestinationStorageSubscriptionID: to.Ptr("subidc"),
	// 	DestinationType: to.Ptr("Blob"),
	// 	ExportID: to.Ptr("uGOoki0jQsyEs3IdQ83Q4QsNr4="),
	// 	ExportStatus: to.Ptr("Preparing"),
	// 	InstrumentationKey: to.Ptr("8330b4a4-0b8e-40cf-a643-bbaf60d375c9"),
	// 	IsUserEnabled: to.Ptr("False"),
	// 	LastGapTime: to.Ptr("9999-12-31T23:59:59.999Z"),
	// 	LastSuccessTime: to.Ptr("9999-12-31T23:59:59.999Z"),
	// 	LastUserUpdate: to.Ptr("2017-06-05T06:34:26.957Z"),
	// 	NotificationQueueEnabled: to.Ptr("False"),
	// 	PermanentErrorReason: to.Ptr("None"),
	// 	RecordTypes: to.Ptr("Requests, Event, Exceptions, Metrics, PageViews, PageViewPerformance, Rdd, PerformanceCounters, Availability"),
	// 	ResourceGroup: to.Ptr("2"),
	// 	StorageName: to.Ptr("mystorageblob"),
	// 	SubscriptionID: to.Ptr("subid"),
	// }
}
Output:

type ExportConfigurationsClientCreateOptions added in v0.2.0

type ExportConfigurationsClientCreateOptions struct {
}

ExportConfigurationsClientCreateOptions contains the optional parameters for the ExportConfigurationsClient.Create method.

type ExportConfigurationsClientCreateResponse added in v0.2.0

type ExportConfigurationsClientCreateResponse struct {
	// A list of Continuous Export configurations.
	ComponentExportConfigurationArray []*ComponentExportConfiguration
}

ExportConfigurationsClientCreateResponse contains the response from method ExportConfigurationsClient.Create.

type ExportConfigurationsClientDeleteOptions added in v0.2.0

type ExportConfigurationsClientDeleteOptions struct {
}

ExportConfigurationsClientDeleteOptions contains the optional parameters for the ExportConfigurationsClient.Delete method.

type ExportConfigurationsClientDeleteResponse added in v0.2.0

type ExportConfigurationsClientDeleteResponse struct {
	// Properties that define a Continuous Export configuration.
	ComponentExportConfiguration
}

ExportConfigurationsClientDeleteResponse contains the response from method ExportConfigurationsClient.Delete.

type ExportConfigurationsClientGetOptions added in v0.2.0

type ExportConfigurationsClientGetOptions struct {
}

ExportConfigurationsClientGetOptions contains the optional parameters for the ExportConfigurationsClient.Get method.

type ExportConfigurationsClientGetResponse added in v0.2.0

type ExportConfigurationsClientGetResponse struct {
	// Properties that define a Continuous Export configuration.
	ComponentExportConfiguration
}

ExportConfigurationsClientGetResponse contains the response from method ExportConfigurationsClient.Get.

type ExportConfigurationsClientListOptions added in v0.2.0

type ExportConfigurationsClientListOptions struct {
}

ExportConfigurationsClientListOptions contains the optional parameters for the ExportConfigurationsClient.List method.

type ExportConfigurationsClientListResponse added in v0.2.0

type ExportConfigurationsClientListResponse struct {
	// A list of Continuous Export configurations.
	ComponentExportConfigurationArray []*ComponentExportConfiguration
}

ExportConfigurationsClientListResponse contains the response from method ExportConfigurationsClient.List.

type ExportConfigurationsClientUpdateOptions added in v0.2.0

type ExportConfigurationsClientUpdateOptions struct {
}

ExportConfigurationsClientUpdateOptions contains the optional parameters for the ExportConfigurationsClient.Update method.

type ExportConfigurationsClientUpdateResponse added in v0.2.0

type ExportConfigurationsClientUpdateResponse struct {
	// Properties that define a Continuous Export configuration.
	ComponentExportConfiguration
}

ExportConfigurationsClientUpdateResponse contains the response from method ExportConfigurationsClient.Update.

type FavoriteSourceType

type FavoriteSourceType string
const (
	FavoriteSourceTypeEvents       FavoriteSourceType = "events"
	FavoriteSourceTypeFunnel       FavoriteSourceType = "funnel"
	FavoriteSourceTypeImpact       FavoriteSourceType = "impact"
	FavoriteSourceTypeNotebook     FavoriteSourceType = "notebook"
	FavoriteSourceTypeRetention    FavoriteSourceType = "retention"
	FavoriteSourceTypeSegmentation FavoriteSourceType = "segmentation"
	FavoriteSourceTypeSessions     FavoriteSourceType = "sessions"
	FavoriteSourceTypeUserflows    FavoriteSourceType = "userflows"
)

func PossibleFavoriteSourceTypeValues

func PossibleFavoriteSourceTypeValues() []FavoriteSourceType

PossibleFavoriteSourceTypeValues returns the possible values for the FavoriteSourceType const type.

type FavoriteType

type FavoriteType string

FavoriteType - Enum indicating if this favorite definition is owned by a specific user or is shared between all users with access to the Application Insights component.

const (
	FavoriteTypeShared FavoriteType = "shared"
	FavoriteTypeUser   FavoriteType = "user"
)

func PossibleFavoriteTypeValues

func PossibleFavoriteTypeValues() []FavoriteType

PossibleFavoriteTypeValues returns the possible values for the FavoriteType const type.

type FavoritesClient

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

FavoritesClient contains the methods for the Favorites group. Don't use this type directly, use NewFavoritesClient() instead.

func NewFavoritesClient

func NewFavoritesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FavoritesClient, error)

NewFavoritesClient creates a new instance of FavoritesClient with the specified values.

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

func (*FavoritesClient) Add

func (client *FavoritesClient) Add(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, favoriteProperties ComponentFavorite, options *FavoritesClientAddOptions) (FavoritesClientAddResponse, error)

Add - Adds a new favorites to an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • favoriteID - The Id of a specific favorite defined in the Application Insights component
  • favoriteProperties - Properties that need to be specified to create a new favorite and add it to an Application Insights component.
  • options - FavoritesClientAddOptions contains the optional parameters for the FavoritesClient.Add method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteAdd.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewFavoritesClient().Add(ctx, "my-resource-group", "my-ai-component", "deadb33f-8bee-4d3b-a059-9be8dac93960", armapplicationinsights.ComponentFavorite{
		Config:                  to.Ptr("{\"MEDataModelRawJSON\":\"{\\n  \\\"version\\\": \\\"1.4.1\\\",\\n  \\\"isCustomDataModel\\\": true,\\n  \\\"items\\\": [\\n    {\\n      \\\"id\\\": \\\"90a7134d-9a38-4c25-88d3-a495209873eb\\\",\\n      \\\"chartType\\\": \\\"Area\\\",\\n      \\\"chartHeight\\\": 4,\\n      \\\"metrics\\\": [\\n        {\\n          \\\"id\\\": \\\"preview/requests/count\\\",\\n          \\\"metricAggregation\\\": \\\"Sum\\\",\\n          \\\"color\\\": \\\"msportalfx-bgcolor-d0\\\"\\n        }\\n      ],\\n      \\\"priorPeriod\\\": false,\\n      \\\"clickAction\\\": {\\n        \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n      },\\n      \\\"horizontalBars\\\": true,\\n      \\\"showOther\\\": true,\\n      \\\"aggregation\\\": \\\"Sum\\\",\\n      \\\"percentage\\\": false,\\n      \\\"palette\\\": \\\"fail\\\",\\n      \\\"yAxisOption\\\": 0,\\n      \\\"title\\\": \\\"\\\"\\n    },\\n    {\\n      \\\"id\\\": \\\"0c289098-88e8-4010-b212-546815cddf70\\\",\\n      \\\"chartType\\\": \\\"Area\\\",\\n      \\\"chartHeight\\\": 2,\\n      \\\"metrics\\\": [\\n        {\\n          \\\"id\\\": \\\"preview/requests/duration\\\",\\n          \\\"metricAggregation\\\": \\\"Avg\\\",\\n          \\\"color\\\": \\\"msportalfx-bgcolor-j1\\\"\\n        }\\n      ],\\n      \\\"priorPeriod\\\": false,\\n      \\\"clickAction\\\": {\\n        \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n      },\\n      \\\"horizontalBars\\\": true,\\n      \\\"showOther\\\": true,\\n      \\\"aggregation\\\": \\\"Avg\\\",\\n      \\\"percentage\\\": false,\\n      \\\"palette\\\": \\\"greenHues\\\",\\n      \\\"yAxisOption\\\": 0,\\n      \\\"title\\\": \\\"\\\"\\n    },\\n    {\\n      \\\"id\\\": \\\"cbdaab6f-a808-4f71-aca5-b3976cbb7345\\\",\\n      \\\"chartType\\\": \\\"Bar\\\",\\n      \\\"chartHeight\\\": 4,\\n      \\\"metrics\\\": [\\n        {\\n          \\\"id\\\": \\\"preview/requests/duration\\\",\\n          \\\"metricAggregation\\\": \\\"Avg\\\",\\n          \\\"color\\\": \\\"msportalfx-bgcolor-d0\\\"\\n        }\\n      ],\\n      \\\"priorPeriod\\\": false,\\n      \\\"clickAction\\\": {\\n        \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n      },\\n      \\\"horizontalBars\\\": true,\\n      \\\"showOther\\\": true,\\n      \\\"aggregation\\\": \\\"Avg\\\",\\n      \\\"percentage\\\": false,\\n      \\\"palette\\\": \\\"magentaHues\\\",\\n      \\\"yAxisOption\\\": 0,\\n      \\\"title\\\": \\\"\\\"\\n    },\\n    {\\n      \\\"id\\\": \\\"1d5a6a3a-9fa1-4099-9cf9-05eff72d1b02\\\",\\n      \\\"grouping\\\": {\\n        \\\"kind\\\": \\\"ByDimension\\\",\\n        \\\"dimension\\\": \\\"context.application.version\\\"\\n      },\\n      \\\"chartType\\\": \\\"Grid\\\",\\n      \\\"chartHeight\\\": 1,\\n      \\\"metrics\\\": [\\n        {\\n          \\\"id\\\": \\\"basicException.count\\\",\\n          \\\"metricAggregation\\\": \\\"Sum\\\",\\n          \\\"color\\\": \\\"msportalfx-bgcolor-g0\\\"\\n        },\\n        {\\n          \\\"id\\\": \\\"requestFailed.count\\\",\\n          \\\"metricAggregation\\\": \\\"Sum\\\",\\n          \\\"color\\\": \\\"msportalfx-bgcolor-f0s2\\\"\\n        }\\n      ],\\n      \\\"priorPeriod\\\": true,\\n      \\\"clickAction\\\": {\\n        \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n      },\\n      \\\"horizontalBars\\\": true,\\n      \\\"showOther\\\": true,\\n      \\\"percentage\\\": false,\\n      \\\"palette\\\": \\\"blueHues\\\",\\n      \\\"yAxisOption\\\": 0,\\n      \\\"title\\\": \\\"\\\"\\n    }\\n  ],\\n  \\\"currentFilter\\\": {\\n    \\\"eventTypes\\\": [\\n      1,\\n      2\\n    ],\\n    \\\"typeFacets\\\": {},\\n    \\\"isPermissive\\\": false\\n  },\\n  \\\"timeContext\\\": {\\n    \\\"durationMs\\\": 75600000,\\n    \\\"endTime\\\": \\\"2018-01-31T20:30:00.000Z\\\",\\n    \\\"createdTime\\\": \\\"2018-01-31T23:54:26.280Z\\\",\\n    \\\"isInitialTime\\\": false,\\n    \\\"grain\\\": 1,\\n    \\\"useDashboardTimeRange\\\": false\\n  },\\n  \\\"jsonUri\\\": \\\"Favorite_BlankChart\\\",\\n  \\\"timeSource\\\": 0\\n}\"}"),
		FavoriteID:              to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
		FavoriteType:            to.Ptr(armapplicationinsights.FavoriteTypeShared),
		IsGeneratedFromTemplate: to.Ptr(false),
		Name:                    to.Ptr("Blah Blah Blah"),
		Tags: []*string{
			to.Ptr("TagSample01"),
			to.Ptr("TagSample02")},
		Version: to.Ptr("ME"),
	}, 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.ComponentFavorite = armapplicationinsights.ComponentFavorite{
	// 	Category: to.Ptr(""),
	// 	Config: to.Ptr("{\"MEDataModelRawJSON\":{\n  \"version\": \"1.4.1\",\n  \"isCustomDataModel\": true,\n  \"items\": [\n    {\n      \"id\": \"90a7134d-9a38-4c25-88d3-a495209873eb\",\n      \"chartType\": \"Area\",\n \"chartHeight\": 4,\n      \"metrics\": [\n        {\n          \"id\": \"preview/requests/count\",\n          \"metricAggregation\": \"Sum\",\n          \"color\": \"msportalfx-bgcolor-d0\"\n        }\n],\n      \"priorPeriod\": false,\n      \"clickAction\": {\n        \"defaultBlade\": \"SearchBlade\"\n      },\n      \"horizontalBars\": true,\n      \"showOther\": true,\n      \"aggregation\": \"Sum\",\n \"percentage\": false,\n      \"palette\": \"fail\",\n      \"yAxisOption\": 0,\n      \"title\": \"\"\n    },\n    {\n      \"id\": \"0c289098-88e8-4010-b212-546815cddf70\",\n      \"chartType\": \"Area\",\n      \"chartHeight\": 2,\n      \"metrics\": [\n        {\n          \"id\": \"preview/requests/duration\",\n          \"metricAggregation\": \"Avg\",\n          \"color\": \"msportalfx-bgcolor-j1\"\n        }\n      ],\n      \"priorPeriod\": false,\n      \"clickAction\": {\n        \"defaultBlade\": \"SearchBlade\"\n      },\n      \"horizontalBars\": true,\n \"showOther\": true,\n      \"aggregation\": \"Avg\",\n      \"percentage\": false,\n      \"palette\": \"greenHues\",\n      \"yAxisOption\": 0,\n      \"title\": \"\"\n    },\n    {\n      \"id\": \"cbdaab6f-a808-4f71-aca5-b3976cbb7345\",\n      \"chartType\": \"Bar\",\n      \"chartHeight\": 4,\n      \"metrics\": [\n        {\n          \"id\": \"preview/requests/duration\",\n \"metricAggregation\": \"Avg\",\n          \"color\": \"msportalfx-bgcolor-d0\"\n        }\n      ],\n      \"priorPeriod\": false,\n      \"clickAction\": {\n        \"defaultBlade\": \"SearchBlade\"\n },\n      \"horizontalBars\": true,\n      \"showOther\": true,\n      \"aggregation\": \"Avg\",\n      \"percentage\": false,\n      \"palette\": \"magentaHues\",\n      \"yAxisOption\": 0,\n      \"title\": \"\"\n    },\n    {\n      \"id\": \"1d5a6a3a-9fa1-4099-9cf9-05eff72d1b02\",\n      \"grouping\": {\n        \"kind\": \"ByDimension\",\n        \"dimension\": \"context.application.version\"\n      },\n \"chartType\": \"Grid\",\n      \"chartHeight\": 1,\n      \"metrics\": [\n        {\n          \"id\": \"basicException.count\",\n          \"metricAggregation\": \"Sum\",\n          \"color\": \"msportalfx-bgcolor-g0\"\n        },\n        {\n          \"id\": \"requestFailed.count\",\n          \"metricAggregation\": \"Sum\",\n          \"color\": \"msportalfx-bgcolor-f0s2\"\n        }\n      ],\n \"priorPeriod\": true,\n      \"clickAction\": {\n        \"defaultBlade\": \"SearchBlade\"\n      },\n      \"horizontalBars\": true,\n      \"showOther\": true,\n      \"percentage\": false,\n \"palette\": \"blueHues\",\n      \"yAxisOption\": 0,\n      \"title\": \"\"\n    }\n  ],\n  \"currentFilter\": {\n    \"eventTypes\": [\n      1,\n      2\n    ],\n    \"typeFacets\": {},\n \"isPermissive\": false\n  },\n  \"timeContext\": {\n    \"durationMs\": 75600000,\n    \"endTime\": \"2018-01-31T20:30:00.000Z\",\n    \"createdTime\": \"2018-01-31T23:54:26.280Z\",\n    \"isInitialTime\": false,\n    \"grain\": 1,\n    \"useDashboardTimeRange\": false\n  },\n  \"jsonUri\": \"Favorite_BlankChart\",\n  \"timeSource\": 0\n}\"}"),
	// 	FavoriteID: to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
	// 	FavoriteType: to.Ptr(armapplicationinsights.FavoriteTypeShared),
	// 	IsGeneratedFromTemplate: to.Ptr(false),
	// 	Name: to.Ptr("Blah Blah Blah"),
	// 	SourceType: to.Ptr(""),
	// 	Tags: []*string{
	// 		to.Ptr("TagSample01"),
	// 		to.Ptr("TagSample02")},
	// 		TimeModified: to.Ptr("2018-02-02T23:18:32.1850959Z"),
	// 		Version: to.Ptr("ME"),
	// 	}
}
Output:

func (*FavoritesClient) Delete

func (client *FavoritesClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, options *FavoritesClientDeleteOptions) (FavoritesClientDeleteResponse, error)

Delete - Remove a favorite that is associated to an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • favoriteID - The Id of a specific favorite defined in the Application Insights component
  • options - FavoritesClientDeleteOptions contains the optional parameters for the FavoritesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewFavoritesClient().Delete(ctx, "my-resource-group", "my-ai-component", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*FavoritesClient) Get

func (client *FavoritesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, options *FavoritesClientGetOptions) (FavoritesClientGetResponse, error)

Get - Get a single favorite by its FavoriteId, defined within an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • favoriteID - The Id of a specific favorite defined in the Application Insights component
  • options - FavoritesClientGetOptions contains the optional parameters for the FavoritesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewFavoritesClient().Get(ctx, "my-resource-group", "my-ai-component", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", 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.ComponentFavorite = armapplicationinsights.ComponentFavorite{
	// 	Config: to.Ptr("{\"TimeSelection\":{\"durationMs\":1800000,\"endTime\":\"2018-01-31T23:56:15.493Z\",\"createdTime\":\"Wed Jan 31 2018 15:58:36 GMT-0800 (Pacific Standard Time)\",\"isInitialTime\":false,\"grain\":1,\"useDashboardTimeRange\":false},\"SearchFilter\":{\"eventTypes\":[1,2],\"typeFacets\":{},\"isPermissive\":false},\"QueryText\":\"*\",\"partId\":\"99e33a16-1b00-4a7d-b98f-a3c1bb3a4df8\"}"),
	// 	FavoriteID: to.Ptr("deadb33f-5e0d-4064-8ebb-1a4ed0313eb2"),
	// 	FavoriteType: to.Ptr(armapplicationinsights.FavoriteTypeShared),
	// 	IsGeneratedFromTemplate: to.Ptr(false),
	// 	Name: to.Ptr("Example Search Blade Favorite"),
	// 	Tags: []*string{
	// 		to.Ptr("SampleTag1"),
	// 		to.Ptr("SampleTag2")},
	// 		TimeModified: to.Ptr("2018-01-31T23:59:25.4594264Z"),
	// 		Version: to.Ptr("Search"),
	// 	}
}
Output:

func (*FavoritesClient) List

func (client *FavoritesClient) List(ctx context.Context, resourceGroupName string, resourceName string, options *FavoritesClientListOptions) (FavoritesClientListResponse, error)

List - Gets a list of favorites defined within an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - FavoritesClientListOptions contains the optional parameters for the FavoritesClient.List method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoritesList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewFavoritesClient().List(ctx, "my-resource-group", "my-ai-component", &armapplicationinsights.FavoritesClientListOptions{FavoriteType: nil,
		SourceType:      nil,
		CanFetchContent: nil,
		Tags:            []string{},
	})
	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.ComponentFavoriteArray = []*armapplicationinsights.ComponentFavorite{
	// 	{
	// 		Config: to.Ptr("blah blah"),
	// 		FavoriteID: to.Ptr("c0deea5e-3344-40f2-96f8-6f8e1c3b5722"),
	// 		FavoriteType: to.Ptr(armapplicationinsights.FavoriteTypeShared),
	// 		IsGeneratedFromTemplate: to.Ptr(false),
	// 		Name: to.Ptr("Example Metric Chart Favorite"),
	// 		Tags: []*string{
	// 		},
	// 		TimeModified: to.Ptr("2018-01-31T23:56:16.008902Z"),
	// 		Version: to.Ptr("ME"),
	// 	},
	// 	{
	// 		Config: to.Ptr("{\"TimeSelection\":{\"durationMs\":1800000,\"endTime\":\"2018-01-31T23:56:15.493Z\",\"createdTime\":\"Wed Jan 31 2018 15:58:36 GMT-0800 (Pacific Standard Time)\",\"isInitialTime\":false,\"grain\":1,\"useDashboardTimeRange\":false},\"SearchFilter\":{\"eventTypes\":[1,2],\"typeFacets\":{},\"isPermissive\":false},\"QueryText\":\"*\",\"partId\":\"99e33a16-1b00-4a7d-b98f-a3c1bb3a4df8\"}"),
	// 		FavoriteID: to.Ptr("deadb33f-5e0d-4064-8ebb-1a4ed0313eb2"),
	// 		FavoriteType: to.Ptr(armapplicationinsights.FavoriteTypeShared),
	// 		IsGeneratedFromTemplate: to.Ptr(false),
	// 		Name: to.Ptr("Example Search Blade Favorite"),
	// 		Tags: []*string{
	// 			to.Ptr("SampleTag01"),
	// 			to.Ptr("SampleTag2")},
	// 			TimeModified: to.Ptr("2018-01-31T23:59:25.4594264Z"),
	// 			Version: to.Ptr("Search"),
	// 	}}
}
Output:

func (*FavoritesClient) Update

func (client *FavoritesClient) Update(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, favoriteProperties ComponentFavorite, options *FavoritesClientUpdateOptions) (FavoritesClientUpdateResponse, error)

Update - Updates a favorite that has already been added to an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • favoriteID - The Id of a specific favorite defined in the Application Insights component
  • favoriteProperties - Properties that need to be specified to update the existing favorite.
  • options - FavoritesClientUpdateOptions contains the optional parameters for the FavoritesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteUpdate.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewFavoritesClient().Update(ctx, "my-resource-group", "my-ai-component", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", armapplicationinsights.ComponentFavorite{
		Config:                  to.Ptr("{\"MEDataModelRawJSON\":\"{\\\"version\\\": \\\"1.4.1\\\",\\\"isCustomDataModel\\\": true,\\\"items\\\": [{\\\"id\\\": \\\"90a7134d-9a38-4c25-88d3-a495209873eb\\\",\\\"chartType\\\": \\\"Area\\\",\\\"chartHeight\\\": 4,\\\"metrics\\\": [{\\\"id\\\": \\\"preview/requests/count\\\",\\\"metricAggregation\\\": \\\"Sum\\\",\\\"color\\\": \\\"msportalfx-bgcolor-d0\\\"}],\\\"priorPeriod\\\": false,\\\"clickAction\\\": {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\": true,\\\"showOther\\\": true,\\\"aggregation\\\": \\\"Sum\\\",\\\"percentage\\\": false,\\\"palette\\\": \\\"fail\\\",\\\"yAxisOption\\\": 0,\\\"title\\\": \\\"\\\"},{\\\"id\\\": \\\"0c289098-88e8-4010-b212-546815cddf70\\\",\\\"chartType\\\": \\\"Area\\\",\\\"chartHeight\\\": 2,\\\"metrics\\\": [{\\\"id\\\": \\\"preview/requests/duration\\\",\\\"metricAggregation\\\": \\\"Avg\\\",\\\"color\\\": \\\"msportalfx-bgcolor-j1\\\"}],\\\"priorPeriod\\\": false,\\\"clickAction\\\": {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\": true,\\\"showOther\\\": true,\\\"aggregation\\\": \\\"Avg\\\",\\\"percentage\\\": false,\\\"palette\\\": \\\"greenHues\\\",\\\"yAxisOption\\\": 0,\\\"title\\\": \\\"\\\"},{\\\"id\\\": \\\"cbdaab6f-a808-4f71-aca5-b3976cbb7345\\\",\\\"chartType\\\": \\\"Bar\\\",\\\"chartHeight\\\": 4,\\\"metrics\\\": [{\\\"id\\\": \\\"preview/requests/duration\\\",\\\"metricAggregation\\\": \\\"Avg\\\",\\\"color\\\": \\\"msportalfx-bgcolor-d0\\\"}],\\\"priorPeriod\\\": false,\\\"clickAction\\\": {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\": true,\\\"showOther\\\": true,\\\"aggregation\\\": \\\"Avg\\\",\\\"percentage\\\": false,\\\"palette\\\": \\\"magentaHues\\\",\\\"yAxisOption\\\": 0,\\\"title\\\": \\\"\\\"},{\\\"id\\\": \\\"1d5a6a3a-9fa1-4099-9cf9-05eff72d1b02\\\",\\\"grouping\\\": {\\\"kind\\\": \\\"ByDimension\\\",\\\"dimension\\\": \\\"context.application.version\\\"},\\\"chartType\\\": \\\"Grid\\\",\\\"chartHeight\\\": 1,\\\"metrics\\\": [{\\\"id\\\": \\\"basicException.count\\\",\\\"metricAggregation\\\": \\\"Sum\\\",\\\"color\\\": \\\"msportalfx-bgcolor-g0\\\"},{\\\"id\\\": \\\"requestFailed.count\\\",\\\"metricAggregation\\\": \\\"Sum\\\",\\\"color\\\": \\\"msportalfx-bgcolor-f0s2\\\"}],\\\"priorPeriod\\\": true,\\\"clickAction\\\": {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\": true,\\\"showOther\\\": true,\\\"percentage\\\": false,\\\"palette\\\": \\\"blueHues\\\",\\\"yAxisOption\\\": 0,\\\"title\\\": \\\"\\\"}],\\\"currentFilter\\\": {\\\"eventTypes\\\": [1,2],\\\"typeFacets\\\": {},\\\"isPermissive\\\": false},\\\"timeContext\\\": {\\\"durationMs\\\": 75600000,\\\"endTime\\\": \\\"2018-01-31T20:30:00.000Z\\\",\\\"createdTime\\\": \\\"2018-01-31T23:54:26.280Z\\\",\\\"isInitialTime\\\": false,\\\"grain\\\": 1,\\\"useDashboardTimeRange\\\": false},\\\"jsonUri\\\": \\\"Favorite_BlankChart\\\",\\\"timeSource\\\": 0}\"}"),
		FavoriteID:              to.Ptr("deadb33f-5e0d-4064-8ebb-1a4ed0313eb2"),
		FavoriteType:            to.Ptr(armapplicationinsights.FavoriteTypeShared),
		IsGeneratedFromTemplate: to.Ptr(false),
		Name:                    to.Ptr("Derek Changed This"),
		Tags: []*string{
			to.Ptr("TagSample01"),
			to.Ptr("TagSample02"),
			to.Ptr("TagSample03")},
		TimeModified: to.Ptr("2018-02-02T18:39:11.6569686Z"),
		Version:      to.Ptr("ME"),
	}, 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.ComponentFavorite = armapplicationinsights.ComponentFavorite{
	// 	Config: to.Ptr("{\"MEDataModelRawJSON\":\"{\\\"version\\\": \\\"1.4.1\\\",\\\"isCustomDataModel\\\": true,\\\"items\\\": [{\\\"id\\\": \\\"90a7134d-9a38-4c25-88d3-a495209873eb\\\",\\\"chartType\\\": \\\"Area\\\",\\\"chartHeight\\\": 4,\\\"metrics\\\": [{\\\"id\\\": \\\"preview/requests/count\\\",\\\"metricAggregation\\\": \\\"Sum\\\",\\\"color\\\": \\\"msportalfx-bgcolor-d0\\\"}],\\\"priorPeriod\\\": false,\\\"clickAction\\\": {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\": true,\\\"showOther\\\": true,\\\"aggregation\\\": \\\"Sum\\\",\\\"percentage\\\": false,\\\"palette\\\": \\\"fail\\\",\\\"yAxisOption\\\": 0,\\\"title\\\": \\\"\\\"},{\\\"id\\\": \\\"0c289098-88e8-4010-b212-546815cddf70\\\",\\\"chartType\\\": \\\"Area\\\",\\\"chartHeight\\\": 2,\\\"metrics\\\": [{\\\"id\\\": \\\"preview/requests/duration\\\",\\\"metricAggregation\\\": \\\"Avg\\\",\\\"color\\\": \\\"msportalfx-bgcolor-j1\\\"}],\\\"priorPeriod\\\": false,\\\"clickAction\\\": {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\": true,\\\"showOther\\\": true,\\\"aggregation\\\": \\\"Avg\\\",\\\"percentage\\\": false,\\\"palette\\\": \\\"greenHues\\\",\\\"yAxisOption\\\": 0,\\\"title\\\": \\\"\\\"},{\\\"id\\\": \\\"cbdaab6f-a808-4f71-aca5-b3976cbb7345\\\",\\\"chartType\\\": \\\"Bar\\\",\\\"chartHeight\\\": 4,\\\"metrics\\\": [{\\\"id\\\": \\\"preview/requests/duration\\\",\\\"metricAggregation\\\": \\\"Avg\\\",\\\"color\\\": \\\"msportalfx-bgcolor-d0\\\"}],\\\"priorPeriod\\\": false,\\\"clickAction\\\": {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\": true,\\\"showOther\\\": true,\\\"aggregation\\\": \\\"Avg\\\",\\\"percentage\\\": false,\\\"palette\\\": \\\"magentaHues\\\",\\\"yAxisOption\\\": 0,\\\"title\\\": \\\"\\\"},{\\\"id\\\": \\\"1d5a6a3a-9fa1-4099-9cf9-05eff72d1b02\\\",\\\"grouping\\\": {\\\"kind\\\": \\\"ByDimension\\\",\\\"dimension\\\": \\\"context.application.version\\\"},\\\"chartType\\\": \\\"Grid\\\",\\\"chartHeight\\\": 1,\\\"metrics\\\": [{\\\"id\\\": \\\"basicException.count\\\",\\\"metricAggregation\\\": \\\"Sum\\\",\\\"color\\\": \\\"msportalfx-bgcolor-g0\\\"},{\\\"id\\\": \\\"requestFailed.count\\\",\\\"metricAggregation\\\": \\\"Sum\\\",\\\"color\\\": \\\"msportalfx-bgcolor-f0s2\\\"}],\\\"priorPeriod\\\": true,\\\"clickAction\\\": {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\": true,\\\"showOther\\\": true,\\\"percentage\\\": false,\\\"palette\\\": \\\"blueHues\\\",\\\"yAxisOption\\\": 0,\\\"title\\\": \\\"\\\"}],\\\"currentFilter\\\": {\\\"eventTypes\\\": [1,2],\\\"typeFacets\\\": {},\\\"isPermissive\\\": false},\\\"timeContext\\\": {\\\"durationMs\\\": 75600000,\\\"endTime\\\": \\\"2018-01-31T20:30:00.000Z\\\",\\\"createdTime\\\": \\\"2018-01-31T23:54:26.280Z\\\",\\\"isInitialTime\\\": false,\\\"grain\\\": 1,\\\"useDashboardTimeRange\\\": false},\\\"jsonUri\\\": \\\"Favorite_BlankChart\\\",\\\"timeSource\\\": 0}\"}"),
	// 	FavoriteID: to.Ptr("deadb33f-5e0d-4064-8ebb-1a4ed0313eb2"),
	// 	FavoriteType: to.Ptr(armapplicationinsights.FavoriteTypeShared),
	// 	IsGeneratedFromTemplate: to.Ptr(false),
	// 	Name: to.Ptr("Derek Changed This"),
	// 	Tags: []*string{
	// 		to.Ptr("TagSample01"),
	// 		to.Ptr("TagSample02"),
	// 		to.Ptr("TagSample03")},
	// 		TimeModified: to.Ptr("2018-02-02T18:39:11.6569686Z"),
	// 		Version: to.Ptr("ME"),
	// 	}
}
Output:

type FavoritesClientAddOptions added in v0.2.0

type FavoritesClientAddOptions struct {
}

FavoritesClientAddOptions contains the optional parameters for the FavoritesClient.Add method.

type FavoritesClientAddResponse added in v0.2.0

type FavoritesClientAddResponse struct {
	// Properties that define a favorite that is associated to an Application Insights component.
	ComponentFavorite
}

FavoritesClientAddResponse contains the response from method FavoritesClient.Add.

type FavoritesClientDeleteOptions added in v0.2.0

type FavoritesClientDeleteOptions struct {
}

FavoritesClientDeleteOptions contains the optional parameters for the FavoritesClient.Delete method.

type FavoritesClientDeleteResponse added in v0.2.0

type FavoritesClientDeleteResponse struct {
}

FavoritesClientDeleteResponse contains the response from method FavoritesClient.Delete.

type FavoritesClientGetOptions added in v0.2.0

type FavoritesClientGetOptions struct {
}

FavoritesClientGetOptions contains the optional parameters for the FavoritesClient.Get method.

type FavoritesClientGetResponse added in v0.2.0

type FavoritesClientGetResponse struct {
	// Properties that define a favorite that is associated to an Application Insights component.
	ComponentFavorite
}

FavoritesClientGetResponse contains the response from method FavoritesClient.Get.

type FavoritesClientListOptions added in v0.2.0

type FavoritesClientListOptions struct {
	// Flag indicating whether or not to return the full content for each applicable favorite. If false, only return summary content
	// for favorites.
	CanFetchContent *bool

	// The type of favorite. Value can be either shared or user.
	FavoriteType *FavoriteType

	// Source type of favorite to return. When left out, the source type defaults to 'other' (not present in this enum).
	SourceType *FavoriteSourceType

	// Tags that must be present on each favorite returned.
	Tags []string
}

FavoritesClientListOptions contains the optional parameters for the FavoritesClient.List method.

type FavoritesClientListResponse added in v0.2.0

type FavoritesClientListResponse struct {
	// Array of ApplicationInsightsComponentFavorite
	ComponentFavoriteArray []*ComponentFavorite
}

FavoritesClientListResponse contains the response from method FavoritesClient.List.

type FavoritesClientUpdateOptions added in v0.2.0

type FavoritesClientUpdateOptions struct {
}

FavoritesClientUpdateOptions contains the optional parameters for the FavoritesClient.Update method.

type FavoritesClientUpdateResponse added in v0.2.0

type FavoritesClientUpdateResponse struct {
	// Properties that define a favorite that is associated to an Application Insights component.
	ComponentFavorite
}

FavoritesClientUpdateResponse contains the response from method FavoritesClient.Update.

type FlowType

type FlowType string

FlowType - Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API.

const (
	FlowTypeBluefield FlowType = "Bluefield"
)

func PossibleFlowTypeValues

func PossibleFlowTypeValues() []FlowType

PossibleFlowTypeValues returns the possible values for the FlowType const type.

type IngestionMode

type IngestionMode string

IngestionMode - Indicates the flow of the ingestion.

const (
	IngestionModeApplicationInsights                       IngestionMode = "ApplicationInsights"
	IngestionModeApplicationInsightsWithDiagnosticSettings IngestionMode = "ApplicationInsightsWithDiagnosticSettings"
	IngestionModeLogAnalytics                              IngestionMode = "LogAnalytics"
)

func PossibleIngestionModeValues

func PossibleIngestionModeValues() []IngestionMode

PossibleIngestionModeValues returns the possible values for the IngestionMode const type.

type InnerError

type InnerError struct {
	// Provides correlation for request
	Diagnosticcontext *string

	// Request time
	Time *time.Time
}

InnerError - Inner error

func (InnerError) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type InnerError.

func (*InnerError) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type InnerError.

type ItemScope

type ItemScope string

ItemScope - Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component.

const (
	ItemScopeShared ItemScope = "shared"
	ItemScopeUser   ItemScope = "user"
)

func PossibleItemScopeValues

func PossibleItemScopeValues() []ItemScope

PossibleItemScopeValues returns the possible values for the ItemScope const type.

type ItemScopePath

type ItemScopePath string
const (
	ItemScopePathAnalyticsItems   ItemScopePath = "analyticsItems"
	ItemScopePathMyanalyticsItems ItemScopePath = "myanalyticsItems"
)

func PossibleItemScopePathValues

func PossibleItemScopePathValues() []ItemScopePath

PossibleItemScopePathValues returns the possible values for the ItemScopePath const type.

type ItemType

type ItemType string

ItemType - Enum indicating the type of the Analytics item.

const (
	ItemTypeFunction ItemType = "function"
	ItemTypeNone     ItemType = "none"
	ItemTypeQuery    ItemType = "query"
	ItemTypeRecent   ItemType = "recent"
)

func PossibleItemTypeValues

func PossibleItemTypeValues() []ItemType

PossibleItemTypeValues returns the possible values for the ItemType const type.

type ItemTypeParameter

type ItemTypeParameter string
const (
	ItemTypeParameterFolder   ItemTypeParameter = "folder"
	ItemTypeParameterFunction ItemTypeParameter = "function"
	ItemTypeParameterNone     ItemTypeParameter = "none"
	ItemTypeParameterQuery    ItemTypeParameter = "query"
	ItemTypeParameterRecent   ItemTypeParameter = "recent"
)

func PossibleItemTypeParameterValues

func PossibleItemTypeParameterValues() []ItemTypeParameter

PossibleItemTypeParameterValues returns the possible values for the ItemTypeParameter const type.

type LinkProperties added in v1.0.0

type LinkProperties struct {
	// The category of workbook
	Category *string

	// The source Azure resource id
	SourceID *string

	// The workbook Azure resource id
	TargetID *string
}

LinkProperties - Contains a sourceId and workbook resource id to link two resources.

func (LinkProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type LinkProperties.

func (*LinkProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LinkProperties.

type MyWorkbook

type MyWorkbook struct {
	// Azure resource Id
	ID *string

	// The kind of workbook. Choices are user and shared.
	Kind *SharedTypeKind

	// Resource location
	Location *string

	// Azure resource name
	Name *string

	// Metadata describing a workbook for an Azure resource.
	Properties *MyWorkbookProperties

	// Resource tags
	Tags map[string]*string

	// Azure resource type
	Type *string
}

MyWorkbook - An Application Insights private workbook definition.

func (MyWorkbook) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MyWorkbook.

func (*MyWorkbook) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type MyWorkbook.

type MyWorkbookError

type MyWorkbookError struct {
	// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
	Code *string

	// The list of invalid fields send in request, in case of validation error.
	Details []*ErrorFieldContract

	// Human-readable representation of the error.
	Message *string
}

MyWorkbookError - Error message body that will indicate why the operation failed.

func (MyWorkbookError) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type MyWorkbookError.

func (*MyWorkbookError) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type MyWorkbookError.

type MyWorkbookProperties

type MyWorkbookProperties struct {
	// REQUIRED; Workbook category, as defined by the user at creation time.
	Category *string

	// REQUIRED; The user-defined name of the private workbook.
	DisplayName *string

	// REQUIRED; Configuration of this particular private workbook. Configuration data is a string containing valid JSON
	SerializedData *string

	// Optional resourceId for a source resource.
	SourceID *string

	// A list of 0 or more tags that are associated with this private workbook definition
	Tags []*string

	// This instance's version of the data model. This can change as new features are added that can be marked private workbook.
	Version *string

	// READ-ONLY; Date and time in UTC of the last modification that was made to this private workbook definition.
	TimeModified *string

	// READ-ONLY; Unique user id of the specific user that owns this private workbook.
	UserID *string
}

MyWorkbookProperties - Properties that contain a private workbook.

func (MyWorkbookProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MyWorkbookProperties.

func (*MyWorkbookProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type MyWorkbookProperties.

type MyWorkbookResource

type MyWorkbookResource struct {
	// Azure resource Id
	ID *string

	// Resource location
	Location *string

	// Azure resource name
	Name *string

	// Resource tags
	Tags map[string]*string

	// Azure resource type
	Type *string
}

MyWorkbookResource - An azure resource object

func (MyWorkbookResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MyWorkbookResource.

func (*MyWorkbookResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type MyWorkbookResource.

type MyWorkbooksClient

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

MyWorkbooksClient contains the methods for the MyWorkbooks group. Don't use this type directly, use NewMyWorkbooksClient() instead.

func NewMyWorkbooksClient

func NewMyWorkbooksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MyWorkbooksClient, error)

NewMyWorkbooksClient creates a new instance of MyWorkbooksClient with the specified values.

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

func (*MyWorkbooksClient) CreateOrUpdate

func (client *MyWorkbooksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, workbookProperties MyWorkbook, options *MyWorkbooksClientCreateOrUpdateOptions) (MyWorkbooksClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create a new private workbook. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • workbookProperties - Properties that need to be specified to create a new private workbook.
  • options - MyWorkbooksClientCreateOrUpdateOptions contains the optional parameters for the MyWorkbooksClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/MyWorkbookAdd.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewMyWorkbooksClient().CreateOrUpdate(ctx, "my-resource-group", "deadb33f-8bee-4d3b-a059-9be8dac93960", armapplicationinsights.MyWorkbook{
		Name:     to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
		ID:       to.Ptr("c0deea5e-3344-40f2-96f8-6f8e1c3b5722"),
		Location: to.Ptr("west us"),
		Tags: map[string]*string{
			"0": to.Ptr("TagSample01"),
			"1": to.Ptr("TagSample02"),
		},
		Kind: to.Ptr(armapplicationinsights.SharedTypeKindUser),
		Properties: &armapplicationinsights.MyWorkbookProperties{
			Category:       to.Ptr("workbook"),
			DisplayName:    to.Ptr("Blah Blah Blah"),
			SerializedData: to.Ptr("{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook.  This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}"),
			SourceID:       to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens"),
		},
	}, 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.MyWorkbook = armapplicationinsights.MyWorkbook{
	// 	Name: to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
	// 	Type: to.Ptr("microsoft.insights/myworkbooks"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/my-resource-group/providers/microsoft.insights/myworkbooks/deadb33f-8bee-4d3b-a059-9be8dac93960"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"0": to.Ptr("TagSample01"),
	// 		"1": to.Ptr("TagSample02"),
	// 	},
	// 	Kind: to.Ptr(armapplicationinsights.SharedTypeKindUser),
	// 	Properties: &armapplicationinsights.MyWorkbookProperties{
	// 		Category: to.Ptr("workbook"),
	// 		DisplayName: to.Ptr("Blah Blah Blah"),
	// 		SerializedData: to.Ptr("{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook.  This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}"),
	// 		SourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens"),
	// 		Version: to.Ptr("ME"),
	// 	},
	// }
}
Output:

func (*MyWorkbooksClient) Delete

func (client *MyWorkbooksClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, options *MyWorkbooksClientDeleteOptions) (MyWorkbooksClientDeleteResponse, error)

Delete - Delete a private workbook. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - MyWorkbooksClientDeleteOptions contains the optional parameters for the MyWorkbooksClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/MyWorkbookDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewMyWorkbooksClient().Delete(ctx, "my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*MyWorkbooksClient) Get

func (client *MyWorkbooksClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *MyWorkbooksClientGetOptions) (MyWorkbooksClientGetResponse, error)

Get - Get a single private workbook by its resourceName. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - MyWorkbooksClientGetOptions contains the optional parameters for the MyWorkbooksClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/MyWorkbookGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewMyWorkbooksClient().Get(ctx, "my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", 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.MyWorkbook = armapplicationinsights.MyWorkbook{
	// 	Name: to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
	// 	Type: to.Ptr("microsoft.insights/myworkbooks"),
	// 	ID: to.Ptr("/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourceGroups/my-resource-group/providers/microsoft.insights/myworkbooks/deadb33f-8bee-4d3b-a059-9be8dac93960"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"0": to.Ptr("TagSample01"),
	// 		"1": to.Ptr("TagSample02"),
	// 	},
	// 	Kind: to.Ptr(armapplicationinsights.SharedTypeKindUser),
	// 	Properties: &armapplicationinsights.MyWorkbookProperties{
	// 		Category: to.Ptr("workbook"),
	// 		DisplayName: to.Ptr("My New Workbook"),
	// 		SerializedData: to.Ptr("{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook.  This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}"),
	// 		SourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens"),
	// 		UserID: to.Ptr("userId"),
	// 		Version: to.Ptr("ME"),
	// 	},
	// }
}
Output:

func (*MyWorkbooksClient) NewListByResourceGroupPager added in v0.4.0

func (client *MyWorkbooksClient) NewListByResourceGroupPager(resourceGroupName string, category CategoryType, options *MyWorkbooksClientListByResourceGroupOptions) *runtime.Pager[MyWorkbooksClientListByResourceGroupResponse]

NewListByResourceGroupPager - Get all private workbooks defined within a specified resource group and category.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • category - Category of workbook to return.
  • options - MyWorkbooksClientListByResourceGroupOptions contains the optional parameters for the MyWorkbooksClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/MyWorkbooksList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewMyWorkbooksClient().NewListByResourceGroupPager("my-resource-group", armapplicationinsights.CategoryTypeWorkbook, &armapplicationinsights.MyWorkbooksClientListByResourceGroupOptions{Tags: []string{},
		CanFetchContent: 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.MyWorkbooksListResult = armapplicationinsights.MyWorkbooksListResult{
		// }
	}
}
Output:

func (*MyWorkbooksClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - Get all private workbooks defined within a specified subscription and category.

Generated from API version 2015-05-01

  • category - Category of workbook to return.
  • options - MyWorkbooksClientListBySubscriptionOptions contains the optional parameters for the MyWorkbooksClient.NewListBySubscriptionPager method.

func (*MyWorkbooksClient) Update

func (client *MyWorkbooksClient) Update(ctx context.Context, resourceGroupName string, resourceName string, workbookProperties MyWorkbook, options *MyWorkbooksClientUpdateOptions) (MyWorkbooksClientUpdateResponse, error)

Update - Updates a private workbook that has already been added. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • workbookProperties - Properties that need to be specified to create a new private workbook.
  • options - MyWorkbooksClientUpdateOptions contains the optional parameters for the MyWorkbooksClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/MyWorkbookUpdate.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewMyWorkbooksClient().Update(ctx, "my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", armapplicationinsights.MyWorkbook{
		Name:     to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
		Location: to.Ptr("west us"),
		Tags: map[string]*string{
			"0": to.Ptr("TagSample01"),
			"1": to.Ptr("TagSample02"),
		},
		Kind: to.Ptr(armapplicationinsights.SharedTypeKindUser),
		Properties: &armapplicationinsights.MyWorkbookProperties{
			Category:       to.Ptr("workbook"),
			DisplayName:    to.Ptr("Blah Blah Blah"),
			SerializedData: to.Ptr("{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook.  This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}"),
			SourceID:       to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens"),
			Version:        to.Ptr("ME"),
		},
	}, 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.MyWorkbook = armapplicationinsights.MyWorkbook{
	// 	Name: to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
	// 	Type: to.Ptr("microsoft.insights/myworkbooks"),
	// 	ID: to.Ptr("c0deea5e-3344-40f2-96f8-6f8e1c3b5722"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"0": to.Ptr("TagSample01"),
	// 		"1": to.Ptr("TagSample02"),
	// 	},
	// 	Kind: to.Ptr(armapplicationinsights.SharedTypeKindUser),
	// 	Properties: &armapplicationinsights.MyWorkbookProperties{
	// 		Category: to.Ptr("workbook"),
	// 		DisplayName: to.Ptr("Blah Blah Blah"),
	// 		SerializedData: to.Ptr("{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook.  This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}"),
	// 		SourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens"),
	// 		Version: to.Ptr("ME"),
	// 	},
	// }
}
Output:

type MyWorkbooksClientCreateOrUpdateOptions added in v0.2.0

type MyWorkbooksClientCreateOrUpdateOptions struct {
}

MyWorkbooksClientCreateOrUpdateOptions contains the optional parameters for the MyWorkbooksClient.CreateOrUpdate method.

type MyWorkbooksClientCreateOrUpdateResponse added in v0.2.0

type MyWorkbooksClientCreateOrUpdateResponse struct {
	// An Application Insights private workbook definition.
	MyWorkbook
}

MyWorkbooksClientCreateOrUpdateResponse contains the response from method MyWorkbooksClient.CreateOrUpdate.

type MyWorkbooksClientDeleteOptions added in v0.2.0

type MyWorkbooksClientDeleteOptions struct {
}

MyWorkbooksClientDeleteOptions contains the optional parameters for the MyWorkbooksClient.Delete method.

type MyWorkbooksClientDeleteResponse added in v0.2.0

type MyWorkbooksClientDeleteResponse struct {
}

MyWorkbooksClientDeleteResponse contains the response from method MyWorkbooksClient.Delete.

type MyWorkbooksClientGetOptions added in v0.2.0

type MyWorkbooksClientGetOptions struct {
}

MyWorkbooksClientGetOptions contains the optional parameters for the MyWorkbooksClient.Get method.

type MyWorkbooksClientGetResponse added in v0.2.0

type MyWorkbooksClientGetResponse struct {
	// An Application Insights private workbook definition.
	MyWorkbook
}

MyWorkbooksClientGetResponse contains the response from method MyWorkbooksClient.Get.

type MyWorkbooksClientListByResourceGroupOptions added in v0.2.0

type MyWorkbooksClientListByResourceGroupOptions struct {
	// Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content
	// for workbooks.
	CanFetchContent *bool

	// Tags presents on each workbook returned.
	Tags []string
}

MyWorkbooksClientListByResourceGroupOptions contains the optional parameters for the MyWorkbooksClient.NewListByResourceGroupPager method.

type MyWorkbooksClientListByResourceGroupResponse added in v0.2.0

type MyWorkbooksClientListByResourceGroupResponse struct {
	// Workbook list result.
	MyWorkbooksListResult
}

MyWorkbooksClientListByResourceGroupResponse contains the response from method MyWorkbooksClient.NewListByResourceGroupPager.

type MyWorkbooksClientListBySubscriptionOptions added in v0.2.0

type MyWorkbooksClientListBySubscriptionOptions struct {
	// Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content
	// for workbooks.
	CanFetchContent *bool

	// Tags presents on each workbook returned.
	Tags []string
}

MyWorkbooksClientListBySubscriptionOptions contains the optional parameters for the MyWorkbooksClient.NewListBySubscriptionPager method.

type MyWorkbooksClientListBySubscriptionResponse added in v0.2.0

type MyWorkbooksClientListBySubscriptionResponse struct {
	// Workbook list result.
	MyWorkbooksListResult
}

MyWorkbooksClientListBySubscriptionResponse contains the response from method MyWorkbooksClient.NewListBySubscriptionPager.

type MyWorkbooksClientUpdateOptions added in v0.2.0

type MyWorkbooksClientUpdateOptions struct {
}

MyWorkbooksClientUpdateOptions contains the optional parameters for the MyWorkbooksClient.Update method.

type MyWorkbooksClientUpdateResponse added in v0.2.0

type MyWorkbooksClientUpdateResponse struct {
	// An Application Insights private workbook definition.
	MyWorkbook
}

MyWorkbooksClientUpdateResponse contains the response from method MyWorkbooksClient.Update.

type MyWorkbooksListResult

type MyWorkbooksListResult struct {
	// READ-ONLY; An array of private workbooks.
	Value []*MyWorkbook
}

MyWorkbooksListResult - Workbook list result.

func (MyWorkbooksListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MyWorkbooksListResult.

func (*MyWorkbooksListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type MyWorkbooksListResult.

type Operation

type Operation struct {
	// The object that represents the operation.
	Display *OperationDisplay

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

Operation - CDN REST API operation

func (Operation) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// Operation type: Read, write, delete, etc.
	Operation *string

	// Service provider: Microsoft.Cdn
	Provider *string

	// Resource on which the operation is performed: Profile, endpoint, etc.
	Resource *string
}

OperationDisplay - The object that represents the operation.

func (OperationDisplay) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v1.1.0

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 CDN operations supported by the CDN resource provider.
	Value []*Operation
}

OperationListResult - Result of the request to list CDN 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 added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type PrivateLinkScopedResource

type PrivateLinkScopedResource struct {
	// The full resource Id of the private link scope resource.
	ResourceID *string

	// The private link scope unique Identifier.
	ScopeID *string
}

PrivateLinkScopedResource - The private link scope resource reference.

func (PrivateLinkScopedResource) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type PrivateLinkScopedResource.

func (*PrivateLinkScopedResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkScopedResource.

type ProactiveDetectionConfigurationsClient

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

ProactiveDetectionConfigurationsClient contains the methods for the ProactiveDetectionConfigurations group. Don't use this type directly, use NewProactiveDetectionConfigurationsClient() instead.

func NewProactiveDetectionConfigurationsClient

func NewProactiveDetectionConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProactiveDetectionConfigurationsClient, error)

NewProactiveDetectionConfigurationsClient creates a new instance of ProactiveDetectionConfigurationsClient with the specified values.

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

func (*ProactiveDetectionConfigurationsClient) Get

Get - Get the ProactiveDetection configuration for this configuration id. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • configurationID - The ProactiveDetection configuration ID. This is unique within a Application Insights component.
  • options - ProactiveDetectionConfigurationsClientGetOptions contains the optional parameters for the ProactiveDetectionConfigurationsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ProactiveDetectionConfigurationGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProactiveDetectionConfigurationsClient().Get(ctx, "my-resource-group", "my-component", "slowpageloadtime", 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.ComponentProactiveDetectionConfiguration = armapplicationinsights.ComponentProactiveDetectionConfiguration{
	// 	CustomEmails: []*string{
	// 		to.Ptr("foo@microsoft.com"),
	// 		to.Ptr("foo2@microsoft.com")},
	// 		Enabled: to.Ptr(true),
	// 		Name: to.Ptr("slowpageloadtime"),
	// 		RuleDefinitions: &armapplicationinsights.ComponentProactiveDetectionConfigurationRuleDefinitions{
	// 			Description: to.Ptr("Smart Detection rules notify you of performance anomaly issues."),
	// 			DisplayName: to.Ptr("Slow page load time"),
	// 			HelpURL: to.Ptr("https://docs.microsoft.com/en-us/azure/application-insights/app-insights-proactive-performance-diagnostics"),
	// 			IsEnabledByDefault: to.Ptr(true),
	// 			IsHidden: to.Ptr(false),
	// 			IsInPreview: to.Ptr(false),
	// 			Name: to.Ptr("slowpageloadtime"),
	// 			SupportsEmailNotifications: to.Ptr(true),
	// 		},
	// 		SendEmailsToSubscriptionOwners: to.Ptr(true),
	// 	}
}
Output:

func (*ProactiveDetectionConfigurationsClient) List

List - Gets a list of ProactiveDetection configurations of an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - ProactiveDetectionConfigurationsClientListOptions contains the optional parameters for the ProactiveDetectionConfigurationsClient.List method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ProactiveDetectionConfigurationsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProactiveDetectionConfigurationsClient().List(ctx, "my-resource-group", "my-component", 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.ComponentProactiveDetectionConfigurationArray = []*armapplicationinsights.ComponentProactiveDetectionConfiguration{
	// 	{
	// 		CustomEmails: []*string{
	// 			to.Ptr("foo@microsoft.com"),
	// 			to.Ptr("foo2@microsoft.com")},
	// 			Enabled: to.Ptr(true),
	// 			Name: to.Ptr("slowpageloadtime"),
	// 			RuleDefinitions: &armapplicationinsights.ComponentProactiveDetectionConfigurationRuleDefinitions{
	// 				Description: to.Ptr("Smart Detection rules notify you of performance anomaly issues."),
	// 				DisplayName: to.Ptr("Slow page load time"),
	// 				HelpURL: to.Ptr("https://docs.microsoft.com/en-us/azure/application-insights/app-insights-proactive-performance-diagnostics"),
	// 				IsEnabledByDefault: to.Ptr(true),
	// 				IsHidden: to.Ptr(false),
	// 				IsInPreview: to.Ptr(false),
	// 				Name: to.Ptr("slowpageloadtime"),
	// 				SupportsEmailNotifications: to.Ptr(true),
	// 			},
	// 			SendEmailsToSubscriptionOwners: to.Ptr(true),
	// 		},
	// 		{
	// 			CustomEmails: []*string{
	// 			},
	// 			Enabled: to.Ptr(true),
	// 			Name: to.Ptr("slowpageloadtime"),
	// 			RuleDefinitions: &armapplicationinsights.ComponentProactiveDetectionConfigurationRuleDefinitions{
	// 				Description: to.Ptr("Smart Detection rules notify you of performance anomaly issues."),
	// 				DisplayName: to.Ptr("Slow server response time"),
	// 				HelpURL: to.Ptr("https://docs.microsoft.com/en-us/azure/application-insights/app-insights-proactive-performance-diagnostics"),
	// 				IsEnabledByDefault: to.Ptr(true),
	// 				IsHidden: to.Ptr(false),
	// 				IsInPreview: to.Ptr(false),
	// 				Name: to.Ptr("slowserverresponsetime"),
	// 				SupportsEmailNotifications: to.Ptr(true),
	// 			},
	// 			SendEmailsToSubscriptionOwners: to.Ptr(true),
	// 	}}
}
Output:

func (*ProactiveDetectionConfigurationsClient) Update

Update - Update the ProactiveDetection configuration for this configuration id. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • configurationID - The ProactiveDetection configuration ID. This is unique within a Application Insights component.
  • proactiveDetectionProperties - Properties that need to be specified to update the ProactiveDetection configuration.
  • options - ProactiveDetectionConfigurationsClientUpdateOptions contains the optional parameters for the ProactiveDetectionConfigurationsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ProactiveDetectionConfigurationUpdate.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProactiveDetectionConfigurationsClient().Update(ctx, "my-resource-group", "my-component", "slowpageloadtime", armapplicationinsights.ComponentProactiveDetectionConfiguration{
		CustomEmails: []*string{
			to.Ptr("foo@microsoft.com"),
			to.Ptr("foo2@microsoft.com")},
		Enabled: to.Ptr(true),
		Name:    to.Ptr("slowpageloadtime"),
		RuleDefinitions: &armapplicationinsights.ComponentProactiveDetectionConfigurationRuleDefinitions{
			Description:                to.Ptr("Smart Detection rules notify you of performance anomaly issues."),
			DisplayName:                to.Ptr("Slow page load time"),
			HelpURL:                    to.Ptr("https://docs.microsoft.com/en-us/azure/application-insights/app-insights-proactive-performance-diagnostics"),
			IsEnabledByDefault:         to.Ptr(true),
			IsHidden:                   to.Ptr(false),
			IsInPreview:                to.Ptr(false),
			Name:                       to.Ptr("slowpageloadtime"),
			SupportsEmailNotifications: to.Ptr(true),
		},
		SendEmailsToSubscriptionOwners: to.Ptr(true),
	}, 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.ComponentProactiveDetectionConfiguration = armapplicationinsights.ComponentProactiveDetectionConfiguration{
	// 	CustomEmails: []*string{
	// 		to.Ptr("foo@microsoft.com"),
	// 		to.Ptr("foo2@microsoft.com")},
	// 		Enabled: to.Ptr(true),
	// 		Name: to.Ptr("slowpageloadtime"),
	// 		RuleDefinitions: &armapplicationinsights.ComponentProactiveDetectionConfigurationRuleDefinitions{
	// 			Description: to.Ptr("Smart Detection rules notify you of performance anomaly issues."),
	// 			DisplayName: to.Ptr("Slow page load time"),
	// 			HelpURL: to.Ptr("https://docs.microsoft.com/en-us/azure/application-insights/app-insights-proactive-performance-diagnostics"),
	// 			IsEnabledByDefault: to.Ptr(true),
	// 			IsHidden: to.Ptr(false),
	// 			IsInPreview: to.Ptr(false),
	// 			Name: to.Ptr("slowpageloadtime"),
	// 			SupportsEmailNotifications: to.Ptr(true),
	// 		},
	// 		SendEmailsToSubscriptionOwners: to.Ptr(true),
	// 	}
}
Output:

type ProactiveDetectionConfigurationsClientGetOptions added in v0.2.0

type ProactiveDetectionConfigurationsClientGetOptions struct {
}

ProactiveDetectionConfigurationsClientGetOptions contains the optional parameters for the ProactiveDetectionConfigurationsClient.Get method.

type ProactiveDetectionConfigurationsClientGetResponse added in v0.2.0

type ProactiveDetectionConfigurationsClientGetResponse struct {
	// Properties that define a ProactiveDetection configuration.
	ComponentProactiveDetectionConfiguration
}

ProactiveDetectionConfigurationsClientGetResponse contains the response from method ProactiveDetectionConfigurationsClient.Get.

type ProactiveDetectionConfigurationsClientListOptions added in v0.2.0

type ProactiveDetectionConfigurationsClientListOptions struct {
}

ProactiveDetectionConfigurationsClientListOptions contains the optional parameters for the ProactiveDetectionConfigurationsClient.List method.

type ProactiveDetectionConfigurationsClientListResponse added in v0.2.0

type ProactiveDetectionConfigurationsClientListResponse struct {
	// A list of ProactiveDetection configurations.
	ComponentProactiveDetectionConfigurationArray []*ComponentProactiveDetectionConfiguration
}

ProactiveDetectionConfigurationsClientListResponse contains the response from method ProactiveDetectionConfigurationsClient.List.

type ProactiveDetectionConfigurationsClientUpdateOptions added in v0.2.0

type ProactiveDetectionConfigurationsClientUpdateOptions struct {
}

ProactiveDetectionConfigurationsClientUpdateOptions contains the optional parameters for the ProactiveDetectionConfigurationsClient.Update method.

type ProactiveDetectionConfigurationsClientUpdateResponse added in v0.2.0

type ProactiveDetectionConfigurationsClientUpdateResponse struct {
	// Properties that define a ProactiveDetection configuration.
	ComponentProactiveDetectionConfiguration
}

ProactiveDetectionConfigurationsClientUpdateResponse contains the response from method ProactiveDetectionConfigurationsClient.Update.

type PublicNetworkAccessType

type PublicNetworkAccessType string

PublicNetworkAccessType - The network access type for operating on the Application Insights Component. By default it is Enabled

const (
	// PublicNetworkAccessTypeDisabled - Disables public connectivity to Application Insights through public DNS.
	PublicNetworkAccessTypeDisabled PublicNetworkAccessType = "Disabled"
	// PublicNetworkAccessTypeEnabled - Enables connectivity to Application Insights through public DNS.
	PublicNetworkAccessTypeEnabled PublicNetworkAccessType = "Enabled"
)

func PossiblePublicNetworkAccessTypeValues

func PossiblePublicNetworkAccessTypeValues() []PublicNetworkAccessType

PossiblePublicNetworkAccessTypeValues returns the possible values for the PublicNetworkAccessType const type.

type PurgeState

type PurgeState string

PurgeState - Status of the operation represented by the requested Id.

const (
	PurgeStateCompleted PurgeState = "completed"
	PurgeStatePending   PurgeState = "pending"
)

func PossiblePurgeStateValues

func PossiblePurgeStateValues() []PurgeState

PossiblePurgeStateValues returns the possible values for the PurgeState const type.

type RequestSource

type RequestSource string

RequestSource - Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'.

const (
	RequestSourceRest RequestSource = "rest"
)

func PossibleRequestSourceValues

func PossibleRequestSourceValues() []RequestSource

PossibleRequestSourceValues returns the possible values for the RequestSource const type.

type SharedTypeKind

type SharedTypeKind string

SharedTypeKind - The kind of workbook. Choices are user and shared.

const (
	SharedTypeKindShared SharedTypeKind = "shared"
	SharedTypeKindUser   SharedTypeKind = "user"
)

func PossibleSharedTypeKindValues

func PossibleSharedTypeKindValues() []SharedTypeKind

PossibleSharedTypeKindValues returns the possible values for the SharedTypeKind const type.

type TagsResource

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

TagsResource - A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance.

func (TagsResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TagsResource.

func (*TagsResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagsResource.

type WebTest

type WebTest struct {
	// REQUIRED; Resource location
	Location *string

	// The kind of web test that this web test watches. Choices are ping and multistep.
	Kind *WebTestKind

	// Metadata describing a web test for an Azure resource.
	Properties *WebTestProperties

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; Azure resource Id
	ID *string

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

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

WebTest - An Application Insights web test definition.

func (WebTest) MarshalJSON

func (w WebTest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WebTest.

func (*WebTest) UnmarshalJSON added in v1.1.0

func (w *WebTest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WebTest.

type WebTestGeolocation

type WebTestGeolocation struct {
	// Location ID for the webtest to run from.
	Location *string
}

WebTestGeolocation - Geo-physical location to run a web test from. You must specify one or more locations for the test to run from.

func (WebTestGeolocation) MarshalJSON added in v1.1.0

func (w WebTestGeolocation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WebTestGeolocation.

func (*WebTestGeolocation) UnmarshalJSON added in v1.1.0

func (w *WebTestGeolocation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WebTestGeolocation.

type WebTestKind

type WebTestKind string

WebTestKind - The kind of web test that this web test watches. Choices are ping and multistep.

const (
	WebTestKindMultistep WebTestKind = "multistep"
	WebTestKindPing      WebTestKind = "ping"
)

func PossibleWebTestKindValues

func PossibleWebTestKindValues() []WebTestKind

PossibleWebTestKindValues returns the possible values for the WebTestKind const type.

type WebTestListResult

type WebTestListResult struct {
	// REQUIRED; Set of Application Insights web test definitions.
	Value []*WebTest

	// The link to get the next part of the returned list of web tests, should the return set be too large for a single request.
	// May be null.
	NextLink *string
}

WebTestListResult - A list of 0 or more Application Insights web test definitions.

func (WebTestListResult) MarshalJSON

func (w WebTestListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WebTestListResult.

func (*WebTestListResult) UnmarshalJSON added in v1.1.0

func (w *WebTestListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WebTestListResult.

type WebTestLocationsClient

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

WebTestLocationsClient contains the methods for the WebTestLocations group. Don't use this type directly, use NewWebTestLocationsClient() instead.

func NewWebTestLocationsClient

func NewWebTestLocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WebTestLocationsClient, error)

NewWebTestLocationsClient creates a new instance of WebTestLocationsClient with the specified values.

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

func (*WebTestLocationsClient) NewListPager added in v0.4.0

func (client *WebTestLocationsClient) NewListPager(resourceGroupName string, resourceName string, options *WebTestLocationsClientListOptions) *runtime.Pager[WebTestLocationsClientListResponse]

NewListPager - Gets a list of web test locations available to this Application Insights component.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - WebTestLocationsClientListOptions contains the optional parameters for the WebTestLocationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestLocationsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewWebTestLocationsClient().NewListPager("my-resource-group", "my-component", 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.WebTestLocationsListResult = armapplicationinsights.WebTestLocationsListResult{
		// }
	}
}
Output:

type WebTestLocationsClientListOptions added in v0.2.0

type WebTestLocationsClientListOptions struct {
}

WebTestLocationsClientListOptions contains the optional parameters for the WebTestLocationsClient.NewListPager method.

type WebTestLocationsClientListResponse added in v0.2.0

type WebTestLocationsClientListResponse struct {
	// Describes the list of web test locations available to an Application Insights Component.
	WebTestLocationsListResult
}

WebTestLocationsClientListResponse contains the response from method WebTestLocationsClient.NewListPager.

type WebTestLocationsListResult

type WebTestLocationsListResult struct {
	// REQUIRED; List of web test locations.
	Value []*ComponentWebTestLocation
}

WebTestLocationsListResult - Describes the list of web test locations available to an Application Insights Component.

func (WebTestLocationsListResult) MarshalJSON added in v0.2.0

func (w WebTestLocationsListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WebTestLocationsListResult.

func (*WebTestLocationsListResult) UnmarshalJSON added in v1.1.0

func (w *WebTestLocationsListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WebTestLocationsListResult.

type WebTestProperties

type WebTestProperties struct {
	// REQUIRED; A list of where to physically run the tests from to give global coverage for accessibility of your application.
	Locations []*WebTestGeolocation

	// REQUIRED; Unique ID of this WebTest. This is typically the same value as the Name field.
	SyntheticMonitorID *string

	// REQUIRED; The kind of web test this is, valid choices are ping and multistep.
	WebTestKind *WebTestKind

	// REQUIRED; User defined name if this WebTest.
	WebTestName *string

	// An XML configuration specification for a WebTest.
	Configuration *WebTestPropertiesConfiguration

	// Purpose/user defined descriptive test for this WebTest.
	Description *string

	// Is the test actively being monitored.
	Enabled *bool

	// Interval in seconds between test runs for this WebTest. Default value is 300.
	Frequency *int32

	// Allow for retries should this WebTest fail.
	RetryEnabled *bool

	// Seconds until this WebTest will timeout and fail. Default value is 30.
	Timeout *int32

	// READ-ONLY; Current state of this component, whether or not is has been provisioned within the resource group it is defined.
	// Users cannot change this value but are able to read from it. Values will include
	// Succeeded, Deploying, Canceled, and Failed.
	ProvisioningState *string
}

WebTestProperties - Metadata describing a web test for an Azure resource.

func (WebTestProperties) MarshalJSON

func (w WebTestProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WebTestProperties.

func (*WebTestProperties) UnmarshalJSON added in v1.1.0

func (w *WebTestProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WebTestProperties.

type WebTestPropertiesConfiguration

type WebTestPropertiesConfiguration struct {
	// The XML specification of a WebTest to run against an application.
	WebTest *string
}

WebTestPropertiesConfiguration - An XML configuration specification for a WebTest.

func (WebTestPropertiesConfiguration) MarshalJSON added in v1.1.0

func (w WebTestPropertiesConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WebTestPropertiesConfiguration.

func (*WebTestPropertiesConfiguration) UnmarshalJSON added in v1.1.0

func (w *WebTestPropertiesConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WebTestPropertiesConfiguration.

type WebTestsClient

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

WebTestsClient contains the methods for the WebTests group. Don't use this type directly, use NewWebTestsClient() instead.

func NewWebTestsClient

func NewWebTestsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WebTestsClient, error)

NewWebTestsClient creates a new instance of WebTestsClient with the specified values.

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

func (*WebTestsClient) CreateOrUpdate

func (client *WebTestsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, webTestName string, webTestDefinition WebTest, options *WebTestsClientCreateOrUpdateOptions) (WebTestsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates an Application Insights web test definition. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • webTestName - The name of the Application Insights webtest resource.
  • webTestDefinition - Properties that need to be specified to create or update an Application Insights web test definition.
  • options - WebTestsClientCreateOrUpdateOptions contains the optional parameters for the WebTestsClient.CreateOrUpdate method.
Example (WebTestCreate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestCreate.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWebTestsClient().CreateOrUpdate(ctx, "my-resource-group", "my-webtest-my-component", armapplicationinsights.WebTest{
		Location: to.Ptr("South Central US"),
		Kind:     to.Ptr(armapplicationinsights.WebTestKindPing),
		Properties: &armapplicationinsights.WebTestProperties{
			Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{
				WebTest: to.Ptr("<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"120\" WorkItemIds=\"\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\" Description=\"\" CredentialUserName=\"\" CredentialPassword=\"\" PreAuthenticate=\"True\" Proxy=\"default\" StopOnError=\"False\" RecordedResultFile=\"\" ResultsLocale=\"\" ><Items><Request Method=\"GET\" Guid=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"120\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>"),
			},
			Description: to.Ptr("Ping web test alert for mytestwebapp"),
			Enabled:     to.Ptr(true),
			Frequency:   to.Ptr[int32](900),
			WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing),
			Locations: []*armapplicationinsights.WebTestGeolocation{
				{
					Location: to.Ptr("us-fl-mia-edge"),
				}},
			WebTestName:        to.Ptr("my-webtest-my-component"),
			RetryEnabled:       to.Ptr(true),
			SyntheticMonitorID: to.Ptr("my-webtest-my-component"),
			Timeout:            to.Ptr[int32](120),
		},
	}, 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.WebTest = armapplicationinsights.WebTest{
	// 	Name: to.Ptr("my-webtest-my-component"),
	// 	Type: to.Ptr("Microsoft.Insights/webtests"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component"),
	// 	Location: to.Ptr("southcentralus"),
	// 	Tags: map[string]*string{
	// 		"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component": to.Ptr("Resource"),
	// 		"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Web/sites/mytestwebapp": to.Ptr("Resource"),
	// 	},
	// 	Kind: to.Ptr(armapplicationinsights.WebTestKindPing),
	// 	Properties: &armapplicationinsights.WebTestProperties{
	// 		Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{
	// 			WebTest: to.Ptr("<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"120\" WorkItemIds=\"\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\" Description=\"\" CredentialUserName=\"\" CredentialPassword=\"\" PreAuthenticate=\"True\" Proxy=\"default\" StopOnError=\"False\" RecordedResultFile=\"\" ResultsLocale=\"\" ><Items><Request Method=\"GET\" Guid=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"120\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>"),
	// 		},
	// 		Description: to.Ptr("Ping web test alert for mytestwebapp"),
	// 		Enabled: to.Ptr(true),
	// 		Frequency: to.Ptr[int32](900),
	// 		WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing),
	// 		Locations: []*armapplicationinsights.WebTestGeolocation{
	// 			{
	// 				Location: to.Ptr("us-fl-mia-edge"),
	// 		}},
	// 		WebTestName: to.Ptr("my-webtest-my-component"),
	// 		RetryEnabled: to.Ptr(true),
	// 		SyntheticMonitorID: to.Ptr("my-webtest-my-component"),
	// 		Timeout: to.Ptr[int32](120),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 	},
	// }
}
Output:

Example (WebTestUpdate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestUpdate.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWebTestsClient().CreateOrUpdate(ctx, "my-resource-group", "my-webtest-my-component", armapplicationinsights.WebTest{
		Location: to.Ptr("South Central US"),
		Kind:     to.Ptr(armapplicationinsights.WebTestKindPing),
		Properties: &armapplicationinsights.WebTestProperties{
			Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{
				WebTest: to.Ptr("<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"30\" WorkItemIds=\"\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\" Description=\"\" CredentialUserName=\"\" CredentialPassword=\"\" PreAuthenticate=\"True\" Proxy=\"default\" StopOnError=\"False\" RecordedResultFile=\"\" ResultsLocale=\"\" ><Items><Request Method=\"GET\" Guid=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"30\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>"),
			},
			Frequency:   to.Ptr[int32](600),
			WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing),
			Locations: []*armapplicationinsights.WebTestGeolocation{
				{
					Location: to.Ptr("us-fl-mia-edge"),
				},
				{
					Location: to.Ptr("apac-hk-hkn-azr"),
				}},
			WebTestName:        to.Ptr("my-webtest-my-component"),
			SyntheticMonitorID: to.Ptr("my-webtest-my-component"),
			Timeout:            to.Ptr[int32](30),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.WebTest = armapplicationinsights.WebTest{
	// 	Name: to.Ptr("my-webtest-my-component"),
	// 	Type: to.Ptr("Microsoft.Insights/webtests"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component"),
	// 	Location: to.Ptr("southcentralus"),
	// 	Tags: map[string]*string{
	// 		"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component": to.Ptr("Resource"),
	// 		"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Web/sites/mytestwebapp": to.Ptr("Resource"),
	// 	},
	// 	Kind: to.Ptr(armapplicationinsights.WebTestKindPing),
	// 	Properties: &armapplicationinsights.WebTestProperties{
	// 		Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{
	// 			WebTest: to.Ptr("<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"30\" WorkItemIds=\"\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\" Description=\"\" CredentialUserName=\"\" CredentialPassword=\"\" PreAuthenticate=\"True\" Proxy=\"default\" StopOnError=\"False\" RecordedResultFile=\"\" ResultsLocale=\"\" ><Items><Request Method=\"GET\" Guid=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"30\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>"),
	// 		},
	// 		Description: to.Ptr("Ping web test alert for mytestwebapp"),
	// 		Enabled: to.Ptr(true),
	// 		Frequency: to.Ptr[int32](600),
	// 		WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing),
	// 		Locations: []*armapplicationinsights.WebTestGeolocation{
	// 			{
	// 				Location: to.Ptr("us-fl-mia-edge"),
	// 			},
	// 			{
	// 				Location: to.Ptr("apac-hk-hkn-azr"),
	// 		}},
	// 		WebTestName: to.Ptr("my-webtest-my-component"),
	// 		RetryEnabled: to.Ptr(true),
	// 		SyntheticMonitorID: to.Ptr("my-webtest-my-component"),
	// 		Timeout: to.Ptr[int32](30),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 	},
	// }
}
Output:

func (*WebTestsClient) Delete

func (client *WebTestsClient) Delete(ctx context.Context, resourceGroupName string, webTestName string, options *WebTestsClientDeleteOptions) (WebTestsClientDeleteResponse, error)

Delete - Deletes an Application Insights web test. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • webTestName - The name of the Application Insights webtest resource.
  • options - WebTestsClientDeleteOptions contains the optional parameters for the WebTestsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

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

func (*WebTestsClient) Get

func (client *WebTestsClient) Get(ctx context.Context, resourceGroupName string, webTestName string, options *WebTestsClientGetOptions) (WebTestsClientGetResponse, error)

Get - Get a specific Application Insights web test definition. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • webTestName - The name of the Application Insights webtest resource.
  • options - WebTestsClientGetOptions contains the optional parameters for the WebTestsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWebTestsClient().Get(ctx, "my-resource-group", "my-webtest-01-mywebservice", 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.WebTest = armapplicationinsights.WebTest{
	// 	Name: to.Ptr("my-webtest-01-mywebservice"),
	// 	Type: to.Ptr("Microsoft.Insights/webtests"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/my-test-resources/providers/Microsoft.Insights/webtests/my-webtest-01-mywebservice"),
	// 	Location: to.Ptr("southcentralus"),
	// 	Tags: map[string]*string{
	// 		"hidden-link:/subscriptions/subid/resourceGroups/my-test-resources/providers/Microsoft.Insights/components/mytester": to.Ptr("Resource"),
	// 		"hidden-link:/subscriptions/subid/resourceGroups/my-test-resources/providers/Microsoft.Web/sites/mytester": to.Ptr("Resource"),
	// 	},
	// 	Kind: to.Ptr(armapplicationinsights.WebTestKindPing),
	// 	Properties: &armapplicationinsights.WebTestProperties{
	// 		Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{
	// 			WebTest: to.Ptr("<WebTest Name=\"mytest-webtest-01\" Id=\"0317d26b-8672-4370-bd6b-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"30\" WorkItemIds=\"\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\" Description=\"\" CredentialUserName=\"\" CredentialPassword=\"\" PreAuthenticate=\"True\" Proxy=\"default\" StopOnError=\"False\" RecordedResultFile=\"\" ResultsLocale=\"\"><Items><Request Method=\"GET\" Guid=\"a55ce143-4f1e-a7e6-b69e-123456789abc\" Version=\"1.1\" Url=\"http://mytester.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"30\" ParseDependentRequests=\"False\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>"),
	// 		},
	// 		Description: to.Ptr(""),
	// 		Enabled: to.Ptr(false),
	// 		Frequency: to.Ptr[int32](900),
	// 		WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing),
	// 		Locations: []*armapplicationinsights.WebTestGeolocation{
	// 			{
	// 				Location: to.Ptr("us-fl-mia-edge"),
	// 			},
	// 			{
	// 				Location: to.Ptr("apac-hk-hkn-azr"),
	// 		}},
	// 		WebTestName: to.Ptr("mytest-webtest-01"),
	// 		RetryEnabled: to.Ptr(true),
	// 		SyntheticMonitorID: to.Ptr("my-webtest-01-mywebservice"),
	// 		Timeout: to.Ptr[int32](30),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 	},
	// }
}
Output:

func (*WebTestsClient) NewListByComponentPager added in v0.4.0

func (client *WebTestsClient) NewListByComponentPager(componentName string, resourceGroupName string, options *WebTestsClientListByComponentOptions) *runtime.Pager[WebTestsClientListByComponentResponse]

NewListByComponentPager - Get all Application Insights web tests defined for the specified component.

Generated from API version 2015-05-01

  • componentName - The name of the Application Insights component resource.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - WebTestsClientListByComponentOptions contains the optional parameters for the WebTestsClient.NewListByComponentPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestListByComponent.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewWebTestsClient().NewListByComponentPager("my-component", "my-resource-group", 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.WebTestListResult = armapplicationinsights.WebTestListResult{
		// 	Value: []*armapplicationinsights.WebTest{
		// 		{
		// 			Name: to.Ptr("my-webtest-my-component"),
		// 			Type: to.Ptr("Microsoft.Insights/webtests"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component"),
		// 			Location: to.Ptr("southcentralus"),
		// 			Tags: map[string]*string{
		// 				"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component": to.Ptr("Resource"),
		// 				"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Web/sites/mytestwebapp": to.Ptr("Resource"),
		// 			},
		// 			Kind: to.Ptr(armapplicationinsights.WebTestKindPing),
		// 			Properties: &armapplicationinsights.WebTestProperties{
		// 				Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{
		// 					WebTest: to.Ptr("<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"120\" WorkItemIds=\"\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\" Description=\"\" CredentialUserName=\"\" CredentialPassword=\"\" PreAuthenticate=\"True\" Proxy=\"default\" StopOnError=\"False\" RecordedResultFile=\"\" ResultsLocale=\"\"><Items><Request Method=\"GET\" Guid=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"120\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>"),
		// 				},
		// 				Description: to.Ptr(""),
		// 				Enabled: to.Ptr(false),
		// 				Frequency: to.Ptr[int32](900),
		// 				WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing),
		// 				Locations: []*armapplicationinsights.WebTestGeolocation{
		// 					{
		// 						Location: to.Ptr("apac-hk-hkn-azr"),
		// 				}},
		// 				WebTestName: to.Ptr("my-webtest"),
		// 				RetryEnabled: to.Ptr(true),
		// 				SyntheticMonitorID: to.Ptr("my-webtest-my-component"),
		// 				Timeout: to.Ptr[int32](120),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*WebTestsClient) NewListByResourceGroupPager added in v0.4.0

func (client *WebTestsClient) NewListByResourceGroupPager(resourceGroupName string, options *WebTestsClientListByResourceGroupOptions) *runtime.Pager[WebTestsClientListByResourceGroupResponse]

NewListByResourceGroupPager - Get all Application Insights web tests defined within a specified resource group.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - WebTestsClientListByResourceGroupOptions contains the optional parameters for the WebTestsClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewWebTestsClient().NewListByResourceGroupPager("my-resource-group", 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.WebTestListResult = armapplicationinsights.WebTestListResult{
		// 	Value: []*armapplicationinsights.WebTest{
		// 		{
		// 			Name: to.Ptr("my-webtest-my-component"),
		// 			Type: to.Ptr("Microsoft.Insights/webtests"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component"),
		// 			Location: to.Ptr("southcentralus"),
		// 			Tags: map[string]*string{
		// 				"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component": to.Ptr("Resource"),
		// 				"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Web/sites/mytestwebapp": to.Ptr("Resource"),
		// 			},
		// 			Kind: to.Ptr(armapplicationinsights.WebTestKindPing),
		// 			Properties: &armapplicationinsights.WebTestProperties{
		// 				Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{
		// 					WebTest: to.Ptr("<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"120\" WorkItemIds=\"\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\" Description=\"\" CredentialUserName=\"\" CredentialPassword=\"\" PreAuthenticate=\"True\" Proxy=\"default\" StopOnError=\"False\" RecordedResultFile=\"\" ResultsLocale=\"\"><Items><Request Method=\"GET\" Guid=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"120\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>"),
		// 				},
		// 				Description: to.Ptr(""),
		// 				Enabled: to.Ptr(false),
		// 				Frequency: to.Ptr[int32](900),
		// 				WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing),
		// 				Locations: []*armapplicationinsights.WebTestGeolocation{
		// 					{
		// 						Location: to.Ptr("apac-hk-hkn-azr"),
		// 				}},
		// 				WebTestName: to.Ptr("my-webtest"),
		// 				RetryEnabled: to.Ptr(true),
		// 				SyntheticMonitorID: to.Ptr("my-webtest-my-component"),
		// 				Timeout: to.Ptr[int32](120),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("my-webtest-my-other-component"),
		// 			Type: to.Ptr("Microsoft.Insights/webtests"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-other-component"),
		// 			Location: to.Ptr("southcentralus"),
		// 			Tags: map[string]*string{
		// 				"Test": to.Ptr("You can delete this synthetic monitor anytime"),
		// 				"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-other-component": to.Ptr("Resource"),
		// 			},
		// 			Kind: to.Ptr(armapplicationinsights.WebTestKindPing),
		// 			Properties: &armapplicationinsights.WebTestProperties{
		// 				Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{
		// 					WebTest: to.Ptr("<WebTest Name=\"342bccf4-722f-496d-b064-123456789abc\" Id=\"00a15cc1-c903-4f97-9af4-123456789abc\" Enabled=\"False\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"120\" WorkItemIds=\"\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\" Description=\"\" CredentialUserName=\"\" CredentialPassword=\"\" PreAuthenticate=\"True\" Proxy=\"default\" StopOnError=\"False\" RecordedResultFile=\"\" ResultsLocale=\"\"><Items><Request Method=\"GET\" Guid=\"347e1924-9899-4c6e-ad78-123456789abc\" Version=\"1.1\" Url=\"http://my-other-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"120\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>"),
		// 				},
		// 				Description: to.Ptr(""),
		// 				Enabled: to.Ptr(false),
		// 				Frequency: to.Ptr[int32](300),
		// 				WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing),
		// 				Locations: []*armapplicationinsights.WebTestGeolocation{
		// 					{
		// 						Location: to.Ptr("us-fl-mia-edge"),
		// 				}},
		// 				WebTestName: to.Ptr("342bccf4-722f-496d-b064-123456789abc"),
		// 				RetryEnabled: to.Ptr(false),
		// 				SyntheticMonitorID: to.Ptr("my-webtest-my-other-component"),
		// 				Timeout: to.Ptr[int32](90),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*WebTestsClient) NewListPager added in v0.4.0

NewListPager - Get all Application Insights web test alerts definitions within a subscription.

Generated from API version 2015-05-01

  • options - WebTestsClientListOptions contains the optional parameters for the WebTestsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewWebTestsClient().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.WebTestListResult = armapplicationinsights.WebTestListResult{
		// 	Value: []*armapplicationinsights.WebTest{
		// 		{
		// 			Name: to.Ptr("my-webtest-my-component"),
		// 			Type: to.Ptr("Microsoft.Insights/webtests"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component"),
		// 			Location: to.Ptr("southcentralus"),
		// 			Tags: map[string]*string{
		// 				"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component": to.Ptr("Resource"),
		// 				"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Web/sites/mytestwebapp": to.Ptr("Resource"),
		// 			},
		// 			Kind: to.Ptr(armapplicationinsights.WebTestKindPing),
		// 			Properties: &armapplicationinsights.WebTestProperties{
		// 				Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{
		// 					WebTest: to.Ptr("<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"120\" WorkItemIds=\"\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\" Description=\"\" CredentialUserName=\"\" CredentialPassword=\"\" PreAuthenticate=\"True\" Proxy=\"default\" StopOnError=\"False\" RecordedResultFile=\"\" ResultsLocale=\"\"><Items><Request Method=\"GET\" Guid=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"120\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>"),
		// 				},
		// 				Description: to.Ptr(""),
		// 				Enabled: to.Ptr(false),
		// 				Frequency: to.Ptr[int32](900),
		// 				WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing),
		// 				Locations: []*armapplicationinsights.WebTestGeolocation{
		// 				},
		// 				WebTestName: to.Ptr("my-webtest"),
		// 				RetryEnabled: to.Ptr(true),
		// 				SyntheticMonitorID: to.Ptr("my-webtest-my-component"),
		// 				Timeout: to.Ptr[int32](120),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("my-webtest-my-other-component"),
		// 			Type: to.Ptr("Microsoft.Insights/webtests"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/my-other-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-other-component"),
		// 			Location: to.Ptr("southcentralus"),
		// 			Tags: map[string]*string{
		// 				"Test": to.Ptr("You can delete this synthetic monitor anytime"),
		// 				"hidden-link:/subscriptions/subid/resourceGroups/my-other-resource-group/providers/Microsoft.Insights/components/my-other-component": to.Ptr("Resource"),
		// 			},
		// 			Kind: to.Ptr(armapplicationinsights.WebTestKindPing),
		// 			Properties: &armapplicationinsights.WebTestProperties{
		// 				Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{
		// 					WebTest: to.Ptr("<WebTest Name=\"342bccf4-722f-496d-b064-123456789abc\" Id=\"00a15cc1-c903-4f97-9af4-123456789abc\" Enabled=\"False\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"120\" WorkItemIds=\"\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\" Description=\"\" CredentialUserName=\"\" CredentialPassword=\"\" PreAuthenticate=\"True\" Proxy=\"default\" StopOnError=\"False\" RecordedResultFile=\"\" ResultsLocale=\"\"><Items><Request Method=\"GET\" Guid=\"347e1924-9899-4c6e-ad78-123456789abc\" Version=\"1.1\" Url=\"http://my-other-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"120\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>"),
		// 				},
		// 				Description: to.Ptr(""),
		// 				Enabled: to.Ptr(false),
		// 				Frequency: to.Ptr[int32](900),
		// 				WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing),
		// 				Locations: []*armapplicationinsights.WebTestGeolocation{
		// 				},
		// 				WebTestName: to.Ptr("342bccf4-722f-496d-b064-123456789abc"),
		// 				RetryEnabled: to.Ptr(false),
		// 				SyntheticMonitorID: to.Ptr("my-webtest-my-other-component"),
		// 				Timeout: to.Ptr[int32](120),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*WebTestsClient) UpdateTags

func (client *WebTestsClient) UpdateTags(ctx context.Context, resourceGroupName string, webTestName string, webTestTags TagsResource, options *WebTestsClientUpdateTagsOptions) (WebTestsClientUpdateTagsResponse, error)

UpdateTags - Creates or updates an Application Insights web test definition. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • webTestName - The name of the Application Insights webtest resource.
  • webTestTags - Updated tag information to set into the web test instance.
  • options - WebTestsClientUpdateTagsOptions contains the optional parameters for the WebTestsClient.UpdateTags method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestUpdateTagsOnly.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWebTestsClient().UpdateTags(ctx, "my-resource-group", "my-webtest-my-component", armapplicationinsights.TagsResource{
		Tags: map[string]*string{
			"Color":          to.Ptr("AzureBlue"),
			"CustomField-01": to.Ptr("This is a random value"),
			"SystemType":     to.Ptr("A08"),
			"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component": to.Ptr("Resource"),
			"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Web/sites/mytestwebapp":           to.Ptr("Resource"),
		},
	}, 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.WebTest = armapplicationinsights.WebTest{
	// 	Name: to.Ptr("my-webtest-my-component"),
	// 	Type: to.Ptr("Microsoft.Insights/webtests"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component"),
	// 	Location: to.Ptr("southcentralus"),
	// 	Tags: map[string]*string{
	// 		"Color": to.Ptr("AzureBlue"),
	// 		"CustomField-01": to.Ptr("This is a random value"),
	// 		"SystemType": to.Ptr("A08"),
	// 		"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component": to.Ptr("Resource"),
	// 		"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Web/sites/mytestwebapp": to.Ptr("Resource"),
	// 	},
	// 	Kind: to.Ptr(armapplicationinsights.WebTestKindPing),
	// 	Properties: &armapplicationinsights.WebTestProperties{
	// 		Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{
	// 			WebTest: to.Ptr("<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"30\" WorkItemIds=\"\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\" Description=\"\" CredentialUserName=\"\" CredentialPassword=\"\" PreAuthenticate=\"True\" Proxy=\"default\" StopOnError=\"False\" RecordedResultFile=\"\" ResultsLocale=\"\" ><Items><Request Method=\"GET\" Guid=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"30\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>"),
	// 		},
	// 		Description: to.Ptr("Ping web test alert for mytestwebapp"),
	// 		Enabled: to.Ptr(true),
	// 		Frequency: to.Ptr[int32](600),
	// 		WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing),
	// 		Locations: []*armapplicationinsights.WebTestGeolocation{
	// 			{
	// 				Location: to.Ptr("us-fl-mia-edge"),
	// 			},
	// 			{
	// 				Location: to.Ptr("apac-hk-hkn-azr"),
	// 		}},
	// 		WebTestName: to.Ptr("my-webtest-my-component"),
	// 		RetryEnabled: to.Ptr(true),
	// 		SyntheticMonitorID: to.Ptr("my-webtest-my-component"),
	// 		Timeout: to.Ptr[int32](30),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 	},
	// }
}
Output:

type WebTestsClientCreateOrUpdateOptions added in v0.2.0

type WebTestsClientCreateOrUpdateOptions struct {
}

WebTestsClientCreateOrUpdateOptions contains the optional parameters for the WebTestsClient.CreateOrUpdate method.

type WebTestsClientCreateOrUpdateResponse added in v0.2.0

type WebTestsClientCreateOrUpdateResponse struct {
	// An Application Insights web test definition.
	WebTest
}

WebTestsClientCreateOrUpdateResponse contains the response from method WebTestsClient.CreateOrUpdate.

type WebTestsClientDeleteOptions added in v0.2.0

type WebTestsClientDeleteOptions struct {
}

WebTestsClientDeleteOptions contains the optional parameters for the WebTestsClient.Delete method.

type WebTestsClientDeleteResponse added in v0.2.0

type WebTestsClientDeleteResponse struct {
}

WebTestsClientDeleteResponse contains the response from method WebTestsClient.Delete.

type WebTestsClientGetOptions added in v0.2.0

type WebTestsClientGetOptions struct {
}

WebTestsClientGetOptions contains the optional parameters for the WebTestsClient.Get method.

type WebTestsClientGetResponse added in v0.2.0

type WebTestsClientGetResponse struct {
	// An Application Insights web test definition.
	WebTest
}

WebTestsClientGetResponse contains the response from method WebTestsClient.Get.

type WebTestsClientListByComponentOptions added in v0.2.0

type WebTestsClientListByComponentOptions struct {
}

WebTestsClientListByComponentOptions contains the optional parameters for the WebTestsClient.NewListByComponentPager method.

type WebTestsClientListByComponentResponse added in v0.2.0

type WebTestsClientListByComponentResponse struct {
	// A list of 0 or more Application Insights web test definitions.
	WebTestListResult
}

WebTestsClientListByComponentResponse contains the response from method WebTestsClient.NewListByComponentPager.

type WebTestsClientListByResourceGroupOptions added in v0.2.0

type WebTestsClientListByResourceGroupOptions struct {
}

WebTestsClientListByResourceGroupOptions contains the optional parameters for the WebTestsClient.NewListByResourceGroupPager method.

type WebTestsClientListByResourceGroupResponse added in v0.2.0

type WebTestsClientListByResourceGroupResponse struct {
	// A list of 0 or more Application Insights web test definitions.
	WebTestListResult
}

WebTestsClientListByResourceGroupResponse contains the response from method WebTestsClient.NewListByResourceGroupPager.

type WebTestsClientListOptions added in v0.2.0

type WebTestsClientListOptions struct {
}

WebTestsClientListOptions contains the optional parameters for the WebTestsClient.NewListPager method.

type WebTestsClientListResponse added in v0.2.0

type WebTestsClientListResponse struct {
	// A list of 0 or more Application Insights web test definitions.
	WebTestListResult
}

WebTestsClientListResponse contains the response from method WebTestsClient.NewListPager.

type WebTestsClientUpdateTagsOptions added in v0.2.0

type WebTestsClientUpdateTagsOptions struct {
}

WebTestsClientUpdateTagsOptions contains the optional parameters for the WebTestsClient.UpdateTags method.

type WebTestsClientUpdateTagsResponse added in v0.2.0

type WebTestsClientUpdateTagsResponse struct {
	// An Application Insights web test definition.
	WebTest
}

WebTestsClientUpdateTagsResponse contains the response from method WebTestsClient.UpdateTags.

type WebtestsResource

type WebtestsResource struct {
	// REQUIRED; Resource location
	Location *string

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; Azure resource Id
	ID *string

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

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

WebtestsResource - An azure resource object

func (WebtestsResource) MarshalJSON

func (w WebtestsResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WebtestsResource.

func (*WebtestsResource) UnmarshalJSON added in v1.1.0

func (w *WebtestsResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WebtestsResource.

type WorkItemConfiguration

type WorkItemConfiguration struct {
	// Configuration friendly name
	ConfigDisplayName *string

	// Serialized JSON object for detailed properties
	ConfigProperties *string

	// Connector identifier where work item is created
	ConnectorID *string

	// Unique Id for work item
	ID *string

	// Boolean value indicating whether configuration is default
	IsDefault *bool
}

WorkItemConfiguration - Work item configuration associated with an application insights resource.

func (WorkItemConfiguration) MarshalJSON added in v1.1.0

func (w WorkItemConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WorkItemConfiguration.

func (*WorkItemConfiguration) UnmarshalJSON added in v1.1.0

func (w *WorkItemConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WorkItemConfiguration.

type WorkItemConfigurationError

type WorkItemConfigurationError struct {
	// Error detail code and explanation
	Code *string

	// Inner error
	Innererror *InnerError

	// Error message
	Message *string
}

WorkItemConfigurationError - Error associated with trying to get work item configuration or configurations

func (WorkItemConfigurationError) MarshalJSON added in v1.1.0

func (w WorkItemConfigurationError) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WorkItemConfigurationError.

func (*WorkItemConfigurationError) UnmarshalJSON added in v1.1.0

func (w *WorkItemConfigurationError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WorkItemConfigurationError.

type WorkItemConfigurationsClient

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

WorkItemConfigurationsClient contains the methods for the WorkItemConfigurations group. Don't use this type directly, use NewWorkItemConfigurationsClient() instead.

func NewWorkItemConfigurationsClient

func NewWorkItemConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkItemConfigurationsClient, error)

NewWorkItemConfigurationsClient creates a new instance of WorkItemConfigurationsClient with the specified values.

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

func (*WorkItemConfigurationsClient) Create

func (client *WorkItemConfigurationsClient) Create(ctx context.Context, resourceGroupName string, resourceName string, workItemConfigurationProperties WorkItemCreateConfiguration, options *WorkItemConfigurationsClientCreateOptions) (WorkItemConfigurationsClientCreateResponse, error)

Create - Create a work item configuration for an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • workItemConfigurationProperties - Properties that need to be specified to create a work item configuration of a Application Insights component.
  • options - WorkItemConfigurationsClientCreateOptions contains the optional parameters for the WorkItemConfigurationsClient.Create method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigCreate.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWorkItemConfigurationsClient().Create(ctx, "my-resource-group", "my-component", armapplicationinsights.WorkItemCreateConfiguration{
		ConnectorDataConfiguration: to.Ptr("{\"VSOAccountBaseUrl\":\"https://testtodelete.visualstudio.com\",\"ProjectCollection\":\"DefaultCollection\",\"Project\":\"todeletefirst\",\"ResourceId\":\"d0662b05-439a-4a1b-840b-33a7f8b42ebf\",\"Custom\":\"{\\\"/fields/System.WorkItemType\\\":\\\"Bug\\\",\\\"/fields/System.AreaPath\\\":\\\"todeletefirst\\\",\\\"/fields/System.AssignedTo\\\":\\\"\\\"}\"}"),
		ConnectorID:                to.Ptr("d334e2a4-6733-488e-8645-a9fdc1694f41"),
		ValidateOnly:               to.Ptr(true),
		WorkItemProperties: map[string]*string{
			"0": to.Ptr("[object Object]"),
			"1": to.Ptr("[object Object]"),
		},
	}, 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.WorkItemConfiguration = armapplicationinsights.WorkItemConfiguration{
	// }
}
Output:

func (*WorkItemConfigurationsClient) Delete

func (client *WorkItemConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, workItemConfigID string, options *WorkItemConfigurationsClientDeleteOptions) (WorkItemConfigurationsClientDeleteResponse, error)

Delete - Delete a work item configuration of an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • workItemConfigID - The unique work item configuration Id. This can be either friendly name of connector as defined in connector configuration
  • options - WorkItemConfigurationsClientDeleteOptions contains the optional parameters for the WorkItemConfigurationsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewWorkItemConfigurationsClient().Delete(ctx, "my-resource-group", "my-component", "Visual Studio Team Services", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*WorkItemConfigurationsClient) GetDefault

GetDefault - Gets default work item configurations that exist for the application If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - WorkItemConfigurationsClientGetDefaultOptions contains the optional parameters for the WorkItemConfigurationsClient.GetDefault method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigDefaultGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWorkItemConfigurationsClient().GetDefault(ctx, "my-resource-group", "my-component", 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.WorkItemConfiguration = armapplicationinsights.WorkItemConfiguration{
	// 	ConfigDisplayName: to.Ptr("Visual Studio Team Services"),
	// 	ConfigProperties: to.Ptr("{\"VSOAccountBaseUrl\":\"https://testtodelete.visualstudio.com\",\"ProjectCollection\":\"DefaultCollection\",\"Project\":\"todeletefirst\",\"ResourceId\":\"d0662b05-439a-4a1b-840b-33a7f8b42ebf\",\"ConfigurationType\":\"Standard\",\"WorkItemType\":\"Bug\",\"AreaPath\":\"todeletefirst\",\"AssignedTo\":\"\"}"),
	// 	ConnectorID: to.Ptr("d334e2a4-6733-488e-8645-a9fdc1694f41"),
	// 	ID: to.Ptr("Visual Studio Team Services"),
	// 	IsDefault: to.Ptr(true),
	// }
}
Output:

func (*WorkItemConfigurationsClient) GetItem

func (client *WorkItemConfigurationsClient) GetItem(ctx context.Context, resourceGroupName string, resourceName string, workItemConfigID string, options *WorkItemConfigurationsClientGetItemOptions) (WorkItemConfigurationsClientGetItemResponse, error)

GetItem - Gets specified work item configuration for an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • workItemConfigID - The unique work item configuration Id. This can be either friendly name of connector as defined in connector configuration
  • options - WorkItemConfigurationsClientGetItemOptions contains the optional parameters for the WorkItemConfigurationsClient.GetItem method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWorkItemConfigurationsClient().GetItem(ctx, "my-resource-group", "my-component", "Visual Studio Team Services", 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.WorkItemConfiguration = armapplicationinsights.WorkItemConfiguration{
	// 	ConfigDisplayName: to.Ptr("Visual Studio Team Services"),
	// 	ConfigProperties: to.Ptr("{\"VSOAccountBaseUrl\":\"https://testtodelete.visualstudio.com\",\"ProjectCollection\":\"DefaultCollection\",\"Project\":\"todeletefirst\",\"ResourceId\":\"d0662b05-439a-4a1b-840b-33a7f8b42ebf\",\"ConfigurationType\":\"Standard\",\"WorkItemType\":\"Bug\",\"AreaPath\":\"todeletefirst\",\"AssignedTo\":\"\"}"),
	// 	ConnectorID: to.Ptr("d334e2a4-6733-488e-8645-a9fdc1694f41"),
	// 	ID: to.Ptr("Visual Studio Team Services"),
	// 	IsDefault: to.Ptr(true),
	// }
}
Output:

func (*WorkItemConfigurationsClient) NewListPager added in v0.4.0

NewListPager - Gets the list work item configurations that exist for the application

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - WorkItemConfigurationsClientListOptions contains the optional parameters for the WorkItemConfigurationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewWorkItemConfigurationsClient().NewListPager("my-resource-group", "my-component", 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.WorkItemConfigurationsListResult = armapplicationinsights.WorkItemConfigurationsListResult{
		// }
	}
}
Output:

func (*WorkItemConfigurationsClient) UpdateItem

func (client *WorkItemConfigurationsClient) UpdateItem(ctx context.Context, resourceGroupName string, resourceName string, workItemConfigID string, workItemConfigurationProperties WorkItemCreateConfiguration, options *WorkItemConfigurationsClientUpdateItemOptions) (WorkItemConfigurationsClientUpdateItemResponse, error)

UpdateItem - Update a work item configuration for an Application Insights component. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • workItemConfigID - The unique work item configuration Id. This can be either friendly name of connector as defined in connector configuration
  • workItemConfigurationProperties - Properties that need to be specified to update a work item configuration for this Application Insights component.
  • options - WorkItemConfigurationsClientUpdateItemOptions contains the optional parameters for the WorkItemConfigurationsClient.UpdateItem method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigUpdate.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWorkItemConfigurationsClient().UpdateItem(ctx, "my-resource-group", "my-component", "Visual Studio Team Services", armapplicationinsights.WorkItemCreateConfiguration{
		ConnectorDataConfiguration: to.Ptr("{\"VSOAccountBaseUrl\":\"https://testtodelete.visualstudio.com\",\"ProjectCollection\":\"DefaultCollection\",\"Project\":\"todeletefirst\",\"ResourceId\":\"d0662b05-439a-4a1b-840b-33a7f8b42ebf\",\"Custom\":\"{\\\"/fields/System.WorkItemType\\\":\\\"Bug\\\",\\\"/fields/System.AreaPath\\\":\\\"todeletefirst\\\",\\\"/fields/System.AssignedTo\\\":\\\"\\\"}\"}"),
		ConnectorID:                to.Ptr("d334e2a4-6733-488e-8645-a9fdc1694f41"),
		ValidateOnly:               to.Ptr(true),
		WorkItemProperties: map[string]*string{
			"0": to.Ptr("[object Object]"),
			"1": to.Ptr("[object Object]"),
		},
	}, 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.WorkItemConfiguration = armapplicationinsights.WorkItemConfiguration{
	// 	ConfigDisplayName: to.Ptr("Visual Studio Team Services"),
	// 	ConfigProperties: to.Ptr("{\"VSOAccountBaseUrl\":\"https://testtodelete.visualstudio.com\",\"ProjectCollection\":\"DefaultCollection\",\"Project\":\"todeletefirst\",\"ResourceId\":\"d0662b05-439a-4a1b-840b-33a7f8b42ebf\",\"ConfigurationType\":\"Standard\",\"WorkItemType\":\"Bug\",\"AreaPath\":\"todeletefirst\",\"AssignedTo\":\"\"}"),
	// 	ConnectorID: to.Ptr("d334e2a4-6733-488e-8645-a9fdc1694f41"),
	// 	ID: to.Ptr("Visual Studio Team Services"),
	// 	IsDefault: to.Ptr(true),
	// }
}
Output:

type WorkItemConfigurationsClientCreateOptions added in v0.2.0

type WorkItemConfigurationsClientCreateOptions struct {
}

WorkItemConfigurationsClientCreateOptions contains the optional parameters for the WorkItemConfigurationsClient.Create method.

type WorkItemConfigurationsClientCreateResponse added in v0.2.0

type WorkItemConfigurationsClientCreateResponse struct {
	// Work item configuration associated with an application insights resource.
	WorkItemConfiguration
}

WorkItemConfigurationsClientCreateResponse contains the response from method WorkItemConfigurationsClient.Create.

type WorkItemConfigurationsClientDeleteOptions added in v0.2.0

type WorkItemConfigurationsClientDeleteOptions struct {
}

WorkItemConfigurationsClientDeleteOptions contains the optional parameters for the WorkItemConfigurationsClient.Delete method.

type WorkItemConfigurationsClientDeleteResponse added in v0.2.0

type WorkItemConfigurationsClientDeleteResponse struct {
}

WorkItemConfigurationsClientDeleteResponse contains the response from method WorkItemConfigurationsClient.Delete.

type WorkItemConfigurationsClientGetDefaultOptions added in v0.2.0

type WorkItemConfigurationsClientGetDefaultOptions struct {
}

WorkItemConfigurationsClientGetDefaultOptions contains the optional parameters for the WorkItemConfigurationsClient.GetDefault method.

type WorkItemConfigurationsClientGetDefaultResponse added in v0.2.0

type WorkItemConfigurationsClientGetDefaultResponse struct {
	// Work item configuration associated with an application insights resource.
	WorkItemConfiguration
}

WorkItemConfigurationsClientGetDefaultResponse contains the response from method WorkItemConfigurationsClient.GetDefault.

type WorkItemConfigurationsClientGetItemOptions added in v0.2.0

type WorkItemConfigurationsClientGetItemOptions struct {
}

WorkItemConfigurationsClientGetItemOptions contains the optional parameters for the WorkItemConfigurationsClient.GetItem method.

type WorkItemConfigurationsClientGetItemResponse added in v0.2.0

type WorkItemConfigurationsClientGetItemResponse struct {
	// Work item configuration associated with an application insights resource.
	WorkItemConfiguration
}

WorkItemConfigurationsClientGetItemResponse contains the response from method WorkItemConfigurationsClient.GetItem.

type WorkItemConfigurationsClientListOptions added in v0.2.0

type WorkItemConfigurationsClientListOptions struct {
}

WorkItemConfigurationsClientListOptions contains the optional parameters for the WorkItemConfigurationsClient.NewListPager method.

type WorkItemConfigurationsClientListResponse added in v0.2.0

type WorkItemConfigurationsClientListResponse struct {
	// Work item configuration list result.
	WorkItemConfigurationsListResult
}

WorkItemConfigurationsClientListResponse contains the response from method WorkItemConfigurationsClient.NewListPager.

type WorkItemConfigurationsClientUpdateItemOptions added in v0.2.0

type WorkItemConfigurationsClientUpdateItemOptions struct {
}

WorkItemConfigurationsClientUpdateItemOptions contains the optional parameters for the WorkItemConfigurationsClient.UpdateItem method.

type WorkItemConfigurationsClientUpdateItemResponse added in v0.2.0

type WorkItemConfigurationsClientUpdateItemResponse struct {
	// Work item configuration associated with an application insights resource.
	WorkItemConfiguration
}

WorkItemConfigurationsClientUpdateItemResponse contains the response from method WorkItemConfigurationsClient.UpdateItem.

type WorkItemConfigurationsListResult

type WorkItemConfigurationsListResult struct {
	// READ-ONLY; An array of work item configurations.
	Value []*WorkItemConfiguration
}

WorkItemConfigurationsListResult - Work item configuration list result.

func (WorkItemConfigurationsListResult) MarshalJSON

func (w WorkItemConfigurationsListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WorkItemConfigurationsListResult.

func (*WorkItemConfigurationsListResult) UnmarshalJSON added in v1.1.0

func (w *WorkItemConfigurationsListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WorkItemConfigurationsListResult.

type WorkItemCreateConfiguration

type WorkItemCreateConfiguration struct {
	// Serialized JSON object for detailed properties
	ConnectorDataConfiguration *string

	// Unique connector id
	ConnectorID *string

	// Boolean indicating validate only
	ValidateOnly *bool

	// Custom work item properties
	WorkItemProperties map[string]*string
}

WorkItemCreateConfiguration - Work item configuration creation payload

func (WorkItemCreateConfiguration) MarshalJSON

func (w WorkItemCreateConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WorkItemCreateConfiguration.

func (*WorkItemCreateConfiguration) UnmarshalJSON added in v1.1.0

func (w *WorkItemCreateConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WorkItemCreateConfiguration.

type Workbook

type Workbook struct {
	// The kind of workbook. Choices are user and shared.
	Kind *SharedTypeKind

	// Resource location
	Location *string

	// Metadata describing a web test for an Azure resource.
	Properties *WorkbookProperties

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; Azure resource Id
	ID *string

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

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

Workbook - An Application Insights workbook definition.

func (Workbook) MarshalJSON

func (w Workbook) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Workbook.

func (*Workbook) UnmarshalJSON added in v1.1.0

func (w *Workbook) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Workbook.

type WorkbookError

type WorkbookError struct {
	// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
	Code *string

	// The list of invalid fields send in request, in case of validation error.
	Details []*ErrorFieldContract

	// Human-readable representation of the error.
	Message *string
}

WorkbookError - Error message body that will indicate why the operation failed.

func (WorkbookError) MarshalJSON added in v1.1.0

func (w WorkbookError) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WorkbookError.

func (*WorkbookError) UnmarshalJSON added in v1.1.0

func (w *WorkbookError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookError.

type WorkbookProperties

type WorkbookProperties struct {
	// REQUIRED; Workbook category, as defined by the user at creation time.
	Category *string

	// REQUIRED; The user-defined name of the workbook.
	Name *string

	// REQUIRED; Configuration of this particular workbook. Configuration data is a string containing valid JSON
	SerializedData *string

	// REQUIRED; Enum indicating if this workbook definition is owned by a specific user or is shared between all users with access
	// to the Application Insights component.
	SharedTypeKind *SharedTypeKind

	// REQUIRED; Unique user id of the specific user that owns this workbook.
	UserID *string

	// REQUIRED; Internally assigned unique id of the workbook definition.
	WorkbookID *string

	// Optional resourceId for a source resource.
	SourceResourceID *string

	// A list of 0 or more tags that are associated with this workbook definition
	Tags []*string

	// This instance's version of the data model. This can change as new features are added that can be marked workbook.
	Version *string

	// READ-ONLY; Date and time in UTC of the last modification that was made to this workbook definition.
	TimeModified *string
}

WorkbookProperties - Properties that contain a workbook.

func (WorkbookProperties) MarshalJSON

func (w WorkbookProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WorkbookProperties.

func (*WorkbookProperties) UnmarshalJSON

func (w *WorkbookProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookProperties.

type WorkbookResource

type WorkbookResource struct {
	// Resource location
	Location *string

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; Azure resource Id
	ID *string

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

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

WorkbookResource - An azure resource object

func (WorkbookResource) MarshalJSON

func (w WorkbookResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WorkbookResource.

func (*WorkbookResource) UnmarshalJSON added in v1.1.0

func (w *WorkbookResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookResource.

type WorkbooksClient

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

WorkbooksClient contains the methods for the Workbooks group. Don't use this type directly, use NewWorkbooksClient() instead.

func NewWorkbooksClient

func NewWorkbooksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkbooksClient, error)

NewWorkbooksClient creates a new instance of WorkbooksClient with the specified values.

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

func (*WorkbooksClient) CreateOrUpdate

func (client *WorkbooksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, workbookProperties Workbook, options *WorkbooksClientCreateOrUpdateOptions) (WorkbooksClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create a new workbook. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • workbookProperties - Properties that need to be specified to create a new workbook.
  • options - WorkbooksClientCreateOrUpdateOptions contains the optional parameters for the WorkbooksClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbookAdd.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWorkbooksClient().CreateOrUpdate(ctx, "my-resource-group", "deadb33f-8bee-4d3b-a059-9be8dac93960", armapplicationinsights.Workbook{
		Name:     to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
		ID:       to.Ptr("c0deea5e-3344-40f2-96f8-6f8e1c3b5722"),
		Location: to.Ptr("west us"),
		Tags: map[string]*string{
			"0": to.Ptr("TagSample01"),
			"1": to.Ptr("TagSample02"),
		},
		Properties: &armapplicationinsights.WorkbookProperties{
			Name:             to.Ptr("Blah Blah Blah"),
			Category:         to.Ptr("workbook"),
			SharedTypeKind:   to.Ptr(armapplicationinsights.SharedTypeKindShared),
			SerializedData:   to.Ptr("{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook.  This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}"),
			SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens"),
			UserID:           to.Ptr("userId"),
			WorkbookID:       to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
		},
	}, 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.Workbook = armapplicationinsights.Workbook{
	// 	Name: to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
	// 	Type: to.Ptr(""),
	// 	ID: to.Ptr("c0deea5e-3344-40f2-96f8-6f8e1c3b5722"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"0": to.Ptr("TagSample01"),
	// 		"1": to.Ptr("TagSample02"),
	// 	},
	// 	Properties: &armapplicationinsights.WorkbookProperties{
	// 		Name: to.Ptr("Blah Blah Blah"),
	// 		Category: to.Ptr("workbook"),
	// 		SharedTypeKind: to.Ptr(armapplicationinsights.SharedTypeKindShared),
	// 		SerializedData: to.Ptr("{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook.  This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}"),
	// 		UserID: to.Ptr("userId"),
	// 		Version: to.Ptr("ME"),
	// 		WorkbookID: to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
	// 	},
	// }
}
Output:

func (*WorkbooksClient) Delete

func (client *WorkbooksClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, options *WorkbooksClientDeleteOptions) (WorkbooksClientDeleteResponse, error)

Delete - Delete a workbook. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - WorkbooksClientDeleteOptions contains the optional parameters for the WorkbooksClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbookDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewWorkbooksClient().Delete(ctx, "my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*WorkbooksClient) Get

func (client *WorkbooksClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *WorkbooksClientGetOptions) (WorkbooksClientGetResponse, error)

Get - Get a single workbook by its resourceName. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • options - WorkbooksClientGetOptions contains the optional parameters for the WorkbooksClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbookGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWorkbooksClient().Get(ctx, "my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", 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.Workbook = armapplicationinsights.Workbook{
	// 	Name: to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
	// 	Type: to.Ptr(""),
	// 	ID: to.Ptr("c0deea5e-3344-40f2-96f8-6f8e1c3b5722"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"0": to.Ptr("TagSample01"),
	// 		"1": to.Ptr("TagSample02"),
	// 	},
	// 	Properties: &armapplicationinsights.WorkbookProperties{
	// 		Name: to.Ptr("My New Workbook"),
	// 		Category: to.Ptr("workbook"),
	// 		SharedTypeKind: to.Ptr(armapplicationinsights.SharedTypeKindShared),
	// 		SerializedData: to.Ptr("{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook.  This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}"),
	// 		UserID: to.Ptr("userId"),
	// 		Version: to.Ptr("ME"),
	// 		WorkbookID: to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
	// 	},
	// }
}
Output:

func (*WorkbooksClient) NewListByResourceGroupPager added in v0.4.0

func (client *WorkbooksClient) NewListByResourceGroupPager(resourceGroupName string, category CategoryType, options *WorkbooksClientListByResourceGroupOptions) *runtime.Pager[WorkbooksClientListByResourceGroupResponse]

NewListByResourceGroupPager - Get all Workbooks defined within a specified resource group and category.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • category - Category of workbook to return.
  • options - WorkbooksClientListByResourceGroupOptions contains the optional parameters for the WorkbooksClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbooksList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewWorkbooksClient().NewListByResourceGroupPager("my-resource-group", armapplicationinsights.CategoryTypeWorkbook, &armapplicationinsights.WorkbooksClientListByResourceGroupOptions{Tags: []string{},
		CanFetchContent: 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.WorkbooksListResult = armapplicationinsights.WorkbooksListResult{
		// }
	}
}
Output:

func (*WorkbooksClient) Update

func (client *WorkbooksClient) Update(ctx context.Context, resourceGroupName string, resourceName string, workbookProperties Workbook, options *WorkbooksClientUpdateOptions) (WorkbooksClientUpdateResponse, error)

Update - Updates a workbook that has already been added. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-05-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The name of the Application Insights component resource.
  • workbookProperties - Properties that need to be specified to create a new workbook.
  • options - WorkbooksClientUpdateOptions contains the optional parameters for the WorkbooksClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbookUpdate.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/applicationinsights/armapplicationinsights"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWorkbooksClient().Update(ctx, "my-resource-group", "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", armapplicationinsights.Workbook{
		Name:     to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
		Location: to.Ptr("west us"),
		Tags: map[string]*string{
			"0": to.Ptr("TagSample01"),
			"1": to.Ptr("TagSample02"),
		},
		Properties: &armapplicationinsights.WorkbookProperties{
			Name:           to.Ptr("Blah Blah Blah"),
			Category:       to.Ptr("workbook"),
			SharedTypeKind: to.Ptr(armapplicationinsights.SharedTypeKindShared),
			SerializedData: to.Ptr("{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook.  This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}"),
			UserID:         to.Ptr("userId"),
			Version:        to.Ptr("ME"),
			WorkbookID:     to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
		},
	}, 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.Workbook = armapplicationinsights.Workbook{
	// 	Name: to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
	// 	Type: to.Ptr(""),
	// 	ID: to.Ptr("c0deea5e-3344-40f2-96f8-6f8e1c3b5722"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"0": to.Ptr("TagSample01"),
	// 		"1": to.Ptr("TagSample02"),
	// 	},
	// 	Properties: &armapplicationinsights.WorkbookProperties{
	// 		Name: to.Ptr("Blah Blah Blah"),
	// 		Category: to.Ptr("workbook"),
	// 		SharedTypeKind: to.Ptr(armapplicationinsights.SharedTypeKindShared),
	// 		SerializedData: to.Ptr("{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook.  This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}"),
	// 		UserID: to.Ptr("userId"),
	// 		Version: to.Ptr("ME"),
	// 		WorkbookID: to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"),
	// 	},
	// }
}
Output:

type WorkbooksClientCreateOrUpdateOptions added in v0.2.0

type WorkbooksClientCreateOrUpdateOptions struct {
}

WorkbooksClientCreateOrUpdateOptions contains the optional parameters for the WorkbooksClient.CreateOrUpdate method.

type WorkbooksClientCreateOrUpdateResponse added in v0.2.0

type WorkbooksClientCreateOrUpdateResponse struct {
	// An Application Insights workbook definition.
	Workbook
}

WorkbooksClientCreateOrUpdateResponse contains the response from method WorkbooksClient.CreateOrUpdate.

type WorkbooksClientDeleteOptions added in v0.2.0

type WorkbooksClientDeleteOptions struct {
}

WorkbooksClientDeleteOptions contains the optional parameters for the WorkbooksClient.Delete method.

type WorkbooksClientDeleteResponse added in v0.2.0

type WorkbooksClientDeleteResponse struct {
}

WorkbooksClientDeleteResponse contains the response from method WorkbooksClient.Delete.

type WorkbooksClientGetOptions added in v0.2.0

type WorkbooksClientGetOptions struct {
}

WorkbooksClientGetOptions contains the optional parameters for the WorkbooksClient.Get method.

type WorkbooksClientGetResponse added in v0.2.0

type WorkbooksClientGetResponse struct {
	// An Application Insights workbook definition.
	Workbook
}

WorkbooksClientGetResponse contains the response from method WorkbooksClient.Get.

type WorkbooksClientListByResourceGroupOptions added in v0.2.0

type WorkbooksClientListByResourceGroupOptions struct {
	// Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content
	// for workbooks.
	CanFetchContent *bool

	// Tags presents on each workbook returned.
	Tags []string
}

WorkbooksClientListByResourceGroupOptions contains the optional parameters for the WorkbooksClient.NewListByResourceGroupPager method.

type WorkbooksClientListByResourceGroupResponse added in v0.2.0

type WorkbooksClientListByResourceGroupResponse struct {
	// Workbook list result.
	WorkbooksListResult
}

WorkbooksClientListByResourceGroupResponse contains the response from method WorkbooksClient.NewListByResourceGroupPager.

type WorkbooksClientUpdateOptions added in v0.2.0

type WorkbooksClientUpdateOptions struct {
}

WorkbooksClientUpdateOptions contains the optional parameters for the WorkbooksClient.Update method.

type WorkbooksClientUpdateResponse added in v0.2.0

type WorkbooksClientUpdateResponse struct {
	// An Application Insights workbook definition.
	Workbook
}

WorkbooksClientUpdateResponse contains the response from method WorkbooksClient.Update.

type WorkbooksListResult

type WorkbooksListResult struct {
	// READ-ONLY; An array of workbooks.
	Value []*Workbook
}

WorkbooksListResult - Workbook list result.

func (WorkbooksListResult) MarshalJSON

func (w WorkbooksListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WorkbooksListResult.

func (*WorkbooksListResult) UnmarshalJSON added in v1.1.0

func (w *WorkbooksListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WorkbooksListResult.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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