armoperationsmanagement

package module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 12 Imported by: 1

README

Azure Operations Management Module for Go

PkgGoDev

The armoperationsmanagement module provides operations for working with Azure Operations Management.

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 Operations Management module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationsmanagement/armoperationsmanagement

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Operations Management. 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 Operations Management 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 := armoperationsmanagement.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 := armoperationsmanagement.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.NewManagementConfigurationsClient()

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 Operations Management 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 ArmTemplateParameter

type ArmTemplateParameter struct {
	// name of the parameter.
	Name *string

	// value for the parameter. In Jtoken
	Value *string
}

ArmTemplateParameter - Parameter to pass to ARM template

func (ArmTemplateParameter) MarshalJSON added in v0.7.0

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

MarshalJSON implements the json.Marshaller interface for type ArmTemplateParameter.

func (*ArmTemplateParameter) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ArmTemplateParameter.

type ClientFactory added in v0.7.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 v0.7.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 - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewManagementAssociationsClient added in v0.7.0

func (c *ClientFactory) NewManagementAssociationsClient() *ManagementAssociationsClient

NewManagementAssociationsClient creates a new instance of ManagementAssociationsClient.

func (*ClientFactory) NewManagementConfigurationsClient added in v0.7.0

func (c *ClientFactory) NewManagementConfigurationsClient() *ManagementConfigurationsClient

NewManagementConfigurationsClient creates a new instance of ManagementConfigurationsClient.

func (*ClientFactory) NewOperationsClient added in v0.7.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewSolutionsClient added in v0.7.0

func (c *ClientFactory) NewSolutionsClient() *SolutionsClient

NewSolutionsClient creates a new instance of SolutionsClient.

type CodeMessageError

type CodeMessageError struct {
	// The error details for a failed request.
	Error *CodeMessageErrorError
}

CodeMessageError - The error body contract.

func (CodeMessageError) MarshalJSON added in v0.7.0

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

MarshalJSON implements the json.Marshaller interface for type CodeMessageError.

func (*CodeMessageError) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CodeMessageError.

type CodeMessageErrorError

type CodeMessageErrorError struct {
	// The error type.
	Code *string

	// The error message.
	Message *string
}

CodeMessageErrorError - The error details for a failed request.

func (CodeMessageErrorError) MarshalJSON added in v0.7.0

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

MarshalJSON implements the json.Marshaller interface for type CodeMessageErrorError.

func (*CodeMessageErrorError) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CodeMessageErrorError.

type ManagementAssociation

type ManagementAssociation struct {
	// Resource location
	Location *string

	// Properties for ManagementAssociation object supported by the OperationsManagement resource provider.
	Properties *ManagementAssociationProperties

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

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

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

ManagementAssociation - The container for solution.

func (ManagementAssociation) MarshalJSON added in v0.7.0

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

MarshalJSON implements the json.Marshaller interface for type ManagementAssociation.

func (*ManagementAssociation) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagementAssociation.

type ManagementAssociationProperties

type ManagementAssociationProperties struct {
	// REQUIRED; The applicationId of the appliance for this association.
	ApplicationID *string
}

ManagementAssociationProperties - ManagementAssociation properties supported by the OperationsManagement resource provider.

func (ManagementAssociationProperties) MarshalJSON added in v0.7.0

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

MarshalJSON implements the json.Marshaller interface for type ManagementAssociationProperties.

func (*ManagementAssociationProperties) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagementAssociationProperties.

type ManagementAssociationPropertiesList

type ManagementAssociationPropertiesList struct {
	// List of Management Association properties within the subscription.
	Value []*ManagementAssociation
}

ManagementAssociationPropertiesList - the list of ManagementAssociation response

func (ManagementAssociationPropertiesList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagementAssociationPropertiesList.

func (*ManagementAssociationPropertiesList) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagementAssociationPropertiesList.

type ManagementAssociationsClient

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

ManagementAssociationsClient contains the methods for the ManagementAssociations group. Don't use this type directly, use NewManagementAssociationsClient() instead.

func NewManagementAssociationsClient

func NewManagementAssociationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementAssociationsClient, error)

NewManagementAssociationsClient creates a new instance of ManagementAssociationsClient with the specified values.

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

func (*ManagementAssociationsClient) CreateOrUpdate

func (client *ManagementAssociationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, managementAssociationName string, parameters ManagementAssociation, options *ManagementAssociationsClientCreateOrUpdateOptions) (ManagementAssociationsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates the ManagementAssociation. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-11-01-preview

  • resourceGroupName - The name of the resource group to get. The name is case insensitive.
  • providerName - Provider name for the parent resource.
  • resourceType - Resource type for the parent resource
  • resourceName - Parent resource name.
  • managementAssociationName - User ManagementAssociation Name.
  • parameters - The parameters required to create ManagementAssociation extension.
  • options - ManagementAssociationsClientCreateOrUpdateOptions contains the optional parameters for the ManagementAssociationsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/operationsmanagement/resource-manager/Microsoft.OperationsManagement/preview/2015-11-01-preview/examples/ManagementAssociationCreate.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/operationsmanagement/armoperationsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoperationsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagementAssociationsClient().CreateOrUpdate(ctx, "rg1", "providerName", "resourceType", "resourceName", "managementAssociation1", armoperationsmanagement.ManagementAssociation{
		Location: to.Ptr("East US"),
		Properties: &armoperationsmanagement.ManagementAssociationProperties{
			ApplicationID: to.Ptr("/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.Appliance/Appliances/appliance1"),
		},
	}, 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.ManagementAssociation = armoperationsmanagement.ManagementAssociation{
	// 	Name: to.Ptr("managementAssociation1"),
	// 	Type: to.Ptr("Microsoft.OperationsManagement/ManagementAssociations"),
	// 	ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.OperationalInsights/workspaces/ws1/Microsoft.OperationsManagement/ManagementAssociations/managementAssociation1"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armoperationsmanagement.ManagementAssociationProperties{
	// 		ApplicationID: to.Ptr("/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.Appliance/Appliances/appliance1"),
	// 	},
	// }
}
Output:

func (*ManagementAssociationsClient) Delete

func (client *ManagementAssociationsClient) Delete(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, managementAssociationName string, options *ManagementAssociationsClientDeleteOptions) (ManagementAssociationsClientDeleteResponse, error)

Delete - Deletes the ManagementAssociation in the subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-11-01-preview

  • resourceGroupName - The name of the resource group to get. The name is case insensitive.
  • providerName - Provider name for the parent resource.
  • resourceType - Resource type for the parent resource
  • resourceName - Parent resource name.
  • managementAssociationName - User ManagementAssociation Name.
  • options - ManagementAssociationsClientDeleteOptions contains the optional parameters for the ManagementAssociationsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/operationsmanagement/resource-manager/Microsoft.OperationsManagement/preview/2015-11-01-preview/examples/ManagementAssociationDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationsmanagement/armoperationsmanagement"
)

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

func (*ManagementAssociationsClient) Get

func (client *ManagementAssociationsClient) Get(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, managementAssociationName string, options *ManagementAssociationsClientGetOptions) (ManagementAssociationsClientGetResponse, error)

Get - Retrieves the user ManagementAssociation. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-11-01-preview

  • resourceGroupName - The name of the resource group to get. The name is case insensitive.
  • providerName - Provider name for the parent resource.
  • resourceType - Resource type for the parent resource
  • resourceName - Parent resource name.
  • managementAssociationName - User ManagementAssociation Name.
  • options - ManagementAssociationsClientGetOptions contains the optional parameters for the ManagementAssociationsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/operationsmanagement/resource-manager/Microsoft.OperationsManagement/preview/2015-11-01-preview/examples/ManagementAssociationGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationsmanagement/armoperationsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoperationsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagementAssociationsClient().Get(ctx, "rg1", "providerName", "resourceType", "resourceName", "managementAssociation1", 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.ManagementAssociation = armoperationsmanagement.ManagementAssociation{
	// 	Name: to.Ptr("managementAssociation1"),
	// 	Type: to.Ptr("Microsoft.OperationsManagement/ManagementAssociations"),
	// 	ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.OperationalInsights/workspaces/ws1/Microsoft.OperationsManagement/ManagementAssociations/managementAssociation1"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armoperationsmanagement.ManagementAssociationProperties{
	// 		ApplicationID: to.Ptr("/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.Appliance/Appliances/appliance1"),
	// 	},
	// }
}
Output:

func (*ManagementAssociationsClient) ListBySubscription

ListBySubscription - Retrieves the ManagementAssociations list. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-11-01-preview

  • options - ManagementAssociationsClientListBySubscriptionOptions contains the optional parameters for the ManagementAssociationsClient.ListBySubscription method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/operationsmanagement/resource-manager/Microsoft.OperationsManagement/preview/2015-11-01-preview/examples/ManagementAssociationListForSubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationsmanagement/armoperationsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoperationsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagementAssociationsClient().ListBySubscription(ctx, 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.ManagementAssociationPropertiesList = armoperationsmanagement.ManagementAssociationPropertiesList{
	// }
}
Output:

type ManagementAssociationsClientCreateOrUpdateOptions added in v0.3.0

type ManagementAssociationsClientCreateOrUpdateOptions struct {
}

ManagementAssociationsClientCreateOrUpdateOptions contains the optional parameters for the ManagementAssociationsClient.CreateOrUpdate method.

type ManagementAssociationsClientCreateOrUpdateResponse added in v0.3.0

type ManagementAssociationsClientCreateOrUpdateResponse struct {
	// The container for solution.
	ManagementAssociation
}

ManagementAssociationsClientCreateOrUpdateResponse contains the response from method ManagementAssociationsClient.CreateOrUpdate.

type ManagementAssociationsClientDeleteOptions added in v0.3.0

type ManagementAssociationsClientDeleteOptions struct {
}

ManagementAssociationsClientDeleteOptions contains the optional parameters for the ManagementAssociationsClient.Delete method.

type ManagementAssociationsClientDeleteResponse added in v0.3.0

type ManagementAssociationsClientDeleteResponse struct {
}

ManagementAssociationsClientDeleteResponse contains the response from method ManagementAssociationsClient.Delete.

type ManagementAssociationsClientGetOptions added in v0.3.0

type ManagementAssociationsClientGetOptions struct {
}

ManagementAssociationsClientGetOptions contains the optional parameters for the ManagementAssociationsClient.Get method.

type ManagementAssociationsClientGetResponse added in v0.3.0

type ManagementAssociationsClientGetResponse struct {
	// The container for solution.
	ManagementAssociation
}

ManagementAssociationsClientGetResponse contains the response from method ManagementAssociationsClient.Get.

type ManagementAssociationsClientListBySubscriptionOptions added in v0.3.0

type ManagementAssociationsClientListBySubscriptionOptions struct {
}

ManagementAssociationsClientListBySubscriptionOptions contains the optional parameters for the ManagementAssociationsClient.ListBySubscription method.

type ManagementAssociationsClientListBySubscriptionResponse added in v0.3.0

type ManagementAssociationsClientListBySubscriptionResponse struct {
	// the list of ManagementAssociation response
	ManagementAssociationPropertiesList
}

ManagementAssociationsClientListBySubscriptionResponse contains the response from method ManagementAssociationsClient.ListBySubscription.

type ManagementConfiguration

type ManagementConfiguration struct {
	// Resource location
	Location *string

	// Properties for ManagementConfiguration object supported by the OperationsManagement resource provider.
	Properties *ManagementConfigurationProperties

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

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

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

ManagementConfiguration - The container for solution.

func (ManagementConfiguration) MarshalJSON added in v0.7.0

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

MarshalJSON implements the json.Marshaller interface for type ManagementConfiguration.

func (*ManagementConfiguration) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagementConfiguration.

type ManagementConfigurationProperties

type ManagementConfigurationProperties struct {
	// REQUIRED; Parameters to run the ARM template
	Parameters []*ArmTemplateParameter

	// REQUIRED; The type of the parent resource.
	ParentResourceType *string

	// REQUIRED; The Json object containing the ARM template to deploy
	Template any

	// The applicationId of the appliance for this Management.
	ApplicationID *string

	// READ-ONLY; The provisioning state for the ManagementConfiguration.
	ProvisioningState *string
}

ManagementConfigurationProperties - ManagementConfiguration properties supported by the OperationsManagement resource provider.

func (ManagementConfigurationProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagementConfigurationProperties.

func (*ManagementConfigurationProperties) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagementConfigurationProperties.

type ManagementConfigurationPropertiesList

type ManagementConfigurationPropertiesList struct {
	// List of Management Configuration properties within the subscription.
	Value []*ManagementConfiguration
}

ManagementConfigurationPropertiesList - the list of ManagementConfiguration response

func (ManagementConfigurationPropertiesList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagementConfigurationPropertiesList.

func (*ManagementConfigurationPropertiesList) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagementConfigurationPropertiesList.

type ManagementConfigurationsClient

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

ManagementConfigurationsClient contains the methods for the ManagementConfigurations group. Don't use this type directly, use NewManagementConfigurationsClient() instead.

func NewManagementConfigurationsClient

func NewManagementConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementConfigurationsClient, error)

NewManagementConfigurationsClient creates a new instance of ManagementConfigurationsClient with the specified values.

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

func (*ManagementConfigurationsClient) CreateOrUpdate

CreateOrUpdate - Creates or updates the ManagementConfiguration. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-11-01-preview

  • resourceGroupName - The name of the resource group to get. The name is case insensitive.
  • managementConfigurationName - User Management Configuration Name.
  • parameters - The parameters required to create OMS Solution.
  • options - ManagementConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the ManagementConfigurationsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/operationsmanagement/resource-manager/Microsoft.OperationsManagement/preview/2015-11-01-preview/examples/ManagementConfigurationCreate.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/operationsmanagement/armoperationsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoperationsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagementConfigurationsClient().CreateOrUpdate(ctx, "rg1", "managementConfiguration1", armoperationsmanagement.ManagementConfiguration{
		Location: to.Ptr("East US"),
	}, 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.ManagementConfiguration = armoperationsmanagement.ManagementConfiguration{
	// 	Name: to.Ptr("managementConfiguration1"),
	// 	Type: to.Ptr("Microsoft.OperationsManagement/ManagementConfigurations"),
	// 	ID: to.Ptr("subscriptions/subid/resourcegroups/rg1/providers/Microsoft.OperationsManagement/ManagementConfigurations/managementConfiguration1"),
	// 	Location: to.Ptr("East US"),
	// }
}
Output:

func (*ManagementConfigurationsClient) Delete

Delete - Deletes the ManagementConfiguration in the subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-11-01-preview

  • resourceGroupName - The name of the resource group to get. The name is case insensitive.
  • managementConfigurationName - User Management Configuration Name.
  • options - ManagementConfigurationsClientDeleteOptions contains the optional parameters for the ManagementConfigurationsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/operationsmanagement/resource-manager/Microsoft.OperationsManagement/preview/2015-11-01-preview/examples/ManagementConfigurationDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationsmanagement/armoperationsmanagement"
)

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

func (*ManagementConfigurationsClient) Get

Get - Retrieves the user ManagementConfiguration. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-11-01-preview

  • resourceGroupName - The name of the resource group to get. The name is case insensitive.
  • managementConfigurationName - User Management Configuration Name.
  • options - ManagementConfigurationsClientGetOptions contains the optional parameters for the ManagementConfigurationsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/operationsmanagement/resource-manager/Microsoft.OperationsManagement/preview/2015-11-01-preview/examples/ManagementConfigurationGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationsmanagement/armoperationsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoperationsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagementConfigurationsClient().Get(ctx, "rg1", "managementConfigurationName", 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.ManagementConfiguration = armoperationsmanagement.ManagementConfiguration{
	// 	Name: to.Ptr("managementConfiguration1"),
	// 	Type: to.Ptr("Microsoft.OperationsManagement/ManagementConfigurations"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.OperationsManagement/ManagementConfigurations/managementConfiguration1"),
	// 	Location: to.Ptr("East US"),
	// }
}
Output:

func (*ManagementConfigurationsClient) ListBySubscription

ListBySubscription - Retrieves the ManagementConfigurations list. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-11-01-preview

  • options - ManagementConfigurationsClientListBySubscriptionOptions contains the optional parameters for the ManagementConfigurationsClient.ListBySubscription method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/operationsmanagement/resource-manager/Microsoft.OperationsManagement/preview/2015-11-01-preview/examples/ManagementConfigurationListForSubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationsmanagement/armoperationsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoperationsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagementConfigurationsClient().ListBySubscription(ctx, 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.ManagementConfigurationPropertiesList = armoperationsmanagement.ManagementConfigurationPropertiesList{
	// }
}
Output:

type ManagementConfigurationsClientCreateOrUpdateOptions added in v0.3.0

type ManagementConfigurationsClientCreateOrUpdateOptions struct {
}

ManagementConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the ManagementConfigurationsClient.CreateOrUpdate method.

type ManagementConfigurationsClientCreateOrUpdateResponse added in v0.3.0

type ManagementConfigurationsClientCreateOrUpdateResponse struct {
	// The container for solution.
	ManagementConfiguration
}

ManagementConfigurationsClientCreateOrUpdateResponse contains the response from method ManagementConfigurationsClient.CreateOrUpdate.

type ManagementConfigurationsClientDeleteOptions added in v0.3.0

type ManagementConfigurationsClientDeleteOptions struct {
}

ManagementConfigurationsClientDeleteOptions contains the optional parameters for the ManagementConfigurationsClient.Delete method.

type ManagementConfigurationsClientDeleteResponse added in v0.3.0

type ManagementConfigurationsClientDeleteResponse struct {
}

ManagementConfigurationsClientDeleteResponse contains the response from method ManagementConfigurationsClient.Delete.

type ManagementConfigurationsClientGetOptions added in v0.3.0

type ManagementConfigurationsClientGetOptions struct {
}

ManagementConfigurationsClientGetOptions contains the optional parameters for the ManagementConfigurationsClient.Get method.

type ManagementConfigurationsClientGetResponse added in v0.3.0

type ManagementConfigurationsClientGetResponse struct {
	// The container for solution.
	ManagementConfiguration
}

ManagementConfigurationsClientGetResponse contains the response from method ManagementConfigurationsClient.Get.

type ManagementConfigurationsClientListBySubscriptionOptions added in v0.3.0

type ManagementConfigurationsClientListBySubscriptionOptions struct {
}

ManagementConfigurationsClientListBySubscriptionOptions contains the optional parameters for the ManagementConfigurationsClient.ListBySubscription method.

type ManagementConfigurationsClientListBySubscriptionResponse added in v0.3.0

type ManagementConfigurationsClientListBySubscriptionResponse struct {
	// the list of ManagementConfiguration response
	ManagementConfigurationPropertiesList
}

ManagementConfigurationsClientListBySubscriptionResponse contains the response from method ManagementConfigurationsClient.ListBySubscription.

type Operation

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

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

Operation - Supported operation of OperationsManagement resource provider.

func (Operation) MarshalJSON added in v0.7.0

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// Type of operation: get, read, delete, etc.
	Operation *string

	// Service provider: Microsoft OperationsManagement.
	Provider *string

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

OperationDisplay - Display metadata associated with the operation.

func (OperationDisplay) MarshalJSON added in v0.7.0

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// List of solution operations supported by the OperationsManagement resource provider.
	Value []*Operation
}

OperationListResult - Result of the request to list solution operations.

func (OperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationsClient

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

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

func NewOperationsClient

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

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

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

func (*OperationsClient) NewListPager added in v0.5.0

NewListPager - Lists all of the available OperationsManagement Rest API operations.

Generated from API version 2015-11-01-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/operationsmanagement/resource-manager/Microsoft.OperationsManagement/preview/2015-11-01-preview/examples/OperationsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationsmanagement/armoperationsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoperationsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.OperationListResult = armoperationsmanagement.OperationListResult{
		// }
	}
}
Output:

type OperationsClientListOptions added in v0.3.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.3.0

type OperationsClientListResponse struct {
	// Result of the request to list solution operations.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type Solution

type Solution struct {
	// Resource location
	Location *string

	// Plan for solution object supported by the OperationsManagement resource provider.
	Plan *SolutionPlan

	// Properties for solution object supported by the OperationsManagement resource provider.
	Properties *SolutionProperties

	// Resource tags
	Tags map[string]*string

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

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

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

Solution - The container for solution.

func (Solution) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Solution.

func (*Solution) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Solution.

type SolutionPatch

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

SolutionPatch - The properties of a Solution that can be patched.

func (SolutionPatch) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SolutionPatch.

func (*SolutionPatch) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SolutionPatch.

type SolutionPlan

type SolutionPlan struct {
	// name of the solution to be created. For Microsoft published solution it should be in the format of solutionType(workspaceName).
	// SolutionType part is case sensitive. For third party solution, it can be
	// anything.
	Name *string

	// name of the solution to enabled/add. For Microsoft published gallery solution it should be in the format of OMSGallery/.
	// This is case sensitive
	Product *string

	// promotionCode, Not really used now, can you left as empty
	PromotionCode *string

	// Publisher name. For gallery solution, it is Microsoft.
	Publisher *string
}

SolutionPlan - Plan for solution object supported by the OperationsManagement resource provider.

func (SolutionPlan) MarshalJSON added in v0.7.0

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

MarshalJSON implements the json.Marshaller interface for type SolutionPlan.

func (*SolutionPlan) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SolutionPlan.

type SolutionProperties

type SolutionProperties struct {
	// REQUIRED; The azure resourceId for the workspace where the solution will be deployed/enabled.
	WorkspaceResourceID *string

	// The azure resources that will be contained within the solutions. They will be locked and gets deleted automatically when
	// the solution is deleted.
	ContainedResources []*string

	// The resources that will be referenced from this solution. Deleting any of those solution out of band will break the solution.
	ReferencedResources []*string

	// READ-ONLY; The provisioning state for the solution.
	ProvisioningState *string
}

SolutionProperties - Solution properties supported by the OperationsManagement resource provider.

func (SolutionProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SolutionProperties.

func (*SolutionProperties) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SolutionProperties.

type SolutionPropertiesList

type SolutionPropertiesList struct {
	// List of solution properties within the subscription.
	Value []*Solution
}

SolutionPropertiesList - the list of solution response

func (SolutionPropertiesList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SolutionPropertiesList.

func (*SolutionPropertiesList) UnmarshalJSON added in v0.7.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SolutionPropertiesList.

type SolutionsClient

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

SolutionsClient contains the methods for the Solutions group. Don't use this type directly, use NewSolutionsClient() instead.

func NewSolutionsClient

func NewSolutionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SolutionsClient, error)

NewSolutionsClient creates a new instance of SolutionsClient with the specified values.

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

func (*SolutionsClient) BeginCreateOrUpdate

func (client *SolutionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, solutionName string, parameters Solution, options *SolutionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SolutionsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates the Solution. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-11-01-preview

  • resourceGroupName - The name of the resource group to get. The name is case insensitive.
  • solutionName - User Solution Name.
  • parameters - The parameters required to create OMS Solution.
  • options - SolutionsClientBeginCreateOrUpdateOptions contains the optional parameters for the SolutionsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/operationsmanagement/resource-manager/Microsoft.OperationsManagement/preview/2015-11-01-preview/examples/SolutionCreate.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/operationsmanagement/armoperationsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoperationsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSolutionsClient().BeginCreateOrUpdate(ctx, "rg1", "solution1", armoperationsmanagement.Solution{
		Location: to.Ptr("East US"),
		Plan: &armoperationsmanagement.SolutionPlan{
			Name:          to.Ptr("name1"),
			Product:       to.Ptr("product1"),
			PromotionCode: to.Ptr("promocode1"),
			Publisher:     to.Ptr("publisher1"),
		},
		Properties: &armoperationsmanagement.SolutionProperties{
			ContainedResources: []*string{
				to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider1/resources/resource1"),
				to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider2/resources/resource2")},
			ReferencedResources: []*string{
				to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider1/resources/resource2"),
				to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider2/resources/resource3")},
			WorkspaceResourceID: to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/Microsoft.OperationalInsights/workspaces/ws1"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*SolutionsClient) BeginDelete

func (client *SolutionsClient) BeginDelete(ctx context.Context, resourceGroupName string, solutionName string, options *SolutionsClientBeginDeleteOptions) (*runtime.Poller[SolutionsClientDeleteResponse], error)

BeginDelete - Deletes the solution in the subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-11-01-preview

  • resourceGroupName - The name of the resource group to get. The name is case insensitive.
  • solutionName - User Solution Name.
  • options - SolutionsClientBeginDeleteOptions contains the optional parameters for the SolutionsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/operationsmanagement/resource-manager/Microsoft.OperationsManagement/preview/2015-11-01-preview/examples/SolutionDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationsmanagement/armoperationsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoperationsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSolutionsClient().BeginDelete(ctx, "rg1", "solution1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*SolutionsClient) BeginUpdate

func (client *SolutionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, solutionName string, parameters SolutionPatch, options *SolutionsClientBeginUpdateOptions) (*runtime.Poller[SolutionsClientUpdateResponse], error)

BeginUpdate - Patch a Solution. Only updating tags supported. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-11-01-preview

  • resourceGroupName - The name of the resource group to get. The name is case insensitive.
  • solutionName - User Solution Name.
  • parameters - The parameters required to patch a Solution.
  • options - SolutionsClientBeginUpdateOptions contains the optional parameters for the SolutionsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/operationsmanagement/resource-manager/Microsoft.OperationsManagement/preview/2015-11-01-preview/examples/SolutionUpdate.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/operationsmanagement/armoperationsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoperationsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSolutionsClient().BeginUpdate(ctx, "rg1", "solution1", armoperationsmanagement.SolutionPatch{
		Tags: map[string]*string{
			"Dept":        to.Ptr("IT"),
			"Environment": to.Ptr("Test"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Solution = armoperationsmanagement.Solution{
	// 	Name: to.Ptr("solution1"),
	// 	Type: to.Ptr("Microsoft.OperationsManagement/solution"),
	// 	ID: to.Ptr("subscriptions/subid/resourcegroups/rg1/providers/Microsoft.OperationsManagement/solutions/solution1"),
	// 	Location: to.Ptr("East US"),
	// 	Plan: &armoperationsmanagement.SolutionPlan{
	// 		Name: to.Ptr("name1"),
	// 		Product: to.Ptr("product1"),
	// 		PromotionCode: to.Ptr("promocode1"),
	// 		Publisher: to.Ptr("publisher1"),
	// 	},
	// 	Properties: &armoperationsmanagement.SolutionProperties{
	// 		ContainedResources: []*string{
	// 			to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider1/resources/resource1"),
	// 			to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider2/resources/resource2")},
	// 			ProvisioningState: to.Ptr("Succeeded"),
	// 			ReferencedResources: []*string{
	// 				to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider1/resources/resource2"),
	// 				to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider2/resources/resource3")},
	// 				WorkspaceResourceID: to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/Microsoft.OperationalInsights/workspaces/ws1"),
	// 			},
	// 			Tags: map[string]*string{
	// 				"Dept": to.Ptr("IT"),
	// 				"Environment": to.Ptr("Test"),
	// 			},
	// 		}
}
Output:

func (*SolutionsClient) Get

func (client *SolutionsClient) Get(ctx context.Context, resourceGroupName string, solutionName string, options *SolutionsClientGetOptions) (SolutionsClientGetResponse, error)

Get - Retrieves the user solution. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-11-01-preview

  • resourceGroupName - The name of the resource group to get. The name is case insensitive.
  • solutionName - User Solution Name.
  • options - SolutionsClientGetOptions contains the optional parameters for the SolutionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/operationsmanagement/resource-manager/Microsoft.OperationsManagement/preview/2015-11-01-preview/examples/SolutionGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationsmanagement/armoperationsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoperationsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSolutionsClient().Get(ctx, "rg1", "solution1", 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.Solution = armoperationsmanagement.Solution{
	// 	Name: to.Ptr("solution1"),
	// 	Type: to.Ptr("Microsoft.OperationsManagement/solutions"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.OperationsManagement/solutions/solution1"),
	// 	Location: to.Ptr("East US"),
	// 	Plan: &armoperationsmanagement.SolutionPlan{
	// 		Name: to.Ptr("name1"),
	// 		Product: to.Ptr("product1"),
	// 		PromotionCode: to.Ptr("promocode1"),
	// 		Publisher: to.Ptr("publisher1"),
	// 	},
	// 	Properties: &armoperationsmanagement.SolutionProperties{
	// 		ContainedResources: []*string{
	// 			to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider1/resources/resource1"),
	// 			to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider2/resources/resource2")},
	// 			ProvisioningState: to.Ptr("Succeeded"),
	// 			ReferencedResources: []*string{
	// 				to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider1/resources/resource2"),
	// 				to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider2/resources/resource3")},
	// 				WorkspaceResourceID: to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/Microsoft.OperationalInsights/workspaces/ws1"),
	// 			},
	// 		}
}
Output:

func (*SolutionsClient) ListByResourceGroup

ListByResourceGroup - Retrieves the solution list. It will retrieve both first party and third party solutions If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-11-01-preview

  • resourceGroupName - The name of the resource group to get. The name is case insensitive.
  • options - SolutionsClientListByResourceGroupOptions contains the optional parameters for the SolutionsClient.ListByResourceGroup method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/operationsmanagement/resource-manager/Microsoft.OperationsManagement/preview/2015-11-01-preview/examples/SolutionList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationsmanagement/armoperationsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoperationsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSolutionsClient().ListByResourceGroup(ctx, "rg1", 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.SolutionPropertiesList = armoperationsmanagement.SolutionPropertiesList{
	// 	Value: []*armoperationsmanagement.Solution{
	// 		{
	// 			Name: to.Ptr("solution1"),
	// 			Type: to.Ptr("Microsoft.OperationsManagement/solutions"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.OperationsManagement/solutions/solution1"),
	// 			Location: to.Ptr("East US"),
	// 			Plan: &armoperationsmanagement.SolutionPlan{
	// 				Name: to.Ptr("name1"),
	// 				Product: to.Ptr("product1"),
	// 				PromotionCode: to.Ptr("promocode1"),
	// 				Publisher: to.Ptr("publisher1"),
	// 			},
	// 			Properties: &armoperationsmanagement.SolutionProperties{
	// 				ContainedResources: []*string{
	// 					to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider1/resources/resource1"),
	// 					to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider2/resources/resource2")},
	// 					ProvisioningState: to.Ptr("Succeeded"),
	// 					ReferencedResources: []*string{
	// 						to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider1/resources/resource2"),
	// 						to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider2/resources/resource3")},
	// 						WorkspaceResourceID: to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/Microsoft.OperationalInsights/workspaces/ws1"),
	// 					},
	// 			}},
	// 		}
}
Output:

func (*SolutionsClient) ListBySubscription

ListBySubscription - Retrieves the solution list. It will retrieve both first party and third party solutions If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2015-11-01-preview

  • options - SolutionsClientListBySubscriptionOptions contains the optional parameters for the SolutionsClient.ListBySubscription method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/operationsmanagement/resource-manager/Microsoft.OperationsManagement/preview/2015-11-01-preview/examples/SolutionListForSubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationsmanagement/armoperationsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoperationsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSolutionsClient().ListBySubscription(ctx, 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.SolutionPropertiesList = armoperationsmanagement.SolutionPropertiesList{
	// 	Value: []*armoperationsmanagement.Solution{
	// 		{
	// 			Name: to.Ptr("solution1"),
	// 			Type: to.Ptr("Microsoft.OperationsManagement/solutions"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.OperationsManagement/solutions/solution1"),
	// 			Location: to.Ptr("East US"),
	// 			Plan: &armoperationsmanagement.SolutionPlan{
	// 				Name: to.Ptr("name1"),
	// 				Product: to.Ptr("product1"),
	// 				PromotionCode: to.Ptr("promocode1"),
	// 				Publisher: to.Ptr("publisher1"),
	// 			},
	// 			Properties: &armoperationsmanagement.SolutionProperties{
	// 				ContainedResources: []*string{
	// 					to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider1/resources/resource1"),
	// 					to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider2/resources/resource2")},
	// 					ProvisioningState: to.Ptr("Succeeded"),
	// 					ReferencedResources: []*string{
	// 						to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider1/resources/resource2"),
	// 						to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/provider2/resources/resource3")},
	// 						WorkspaceResourceID: to.Ptr("/subscriptions/sub2/resourceGroups/rg2/providers/Microsoft.OperationalInsights/workspaces/ws1"),
	// 					},
	// 			}},
	// 		}
}
Output:

type SolutionsClientBeginCreateOrUpdateOptions added in v0.3.0

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

SolutionsClientBeginCreateOrUpdateOptions contains the optional parameters for the SolutionsClient.BeginCreateOrUpdate method.

type SolutionsClientBeginDeleteOptions added in v0.3.0

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

SolutionsClientBeginDeleteOptions contains the optional parameters for the SolutionsClient.BeginDelete method.

type SolutionsClientBeginUpdateOptions added in v0.3.0

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

SolutionsClientBeginUpdateOptions contains the optional parameters for the SolutionsClient.BeginUpdate method.

type SolutionsClientCreateOrUpdateResponse added in v0.3.0

type SolutionsClientCreateOrUpdateResponse struct {
	// The container for solution.
	Solution
}

SolutionsClientCreateOrUpdateResponse contains the response from method SolutionsClient.BeginCreateOrUpdate.

type SolutionsClientDeleteResponse added in v0.3.0

type SolutionsClientDeleteResponse struct {
}

SolutionsClientDeleteResponse contains the response from method SolutionsClient.BeginDelete.

type SolutionsClientGetOptions added in v0.3.0

type SolutionsClientGetOptions struct {
}

SolutionsClientGetOptions contains the optional parameters for the SolutionsClient.Get method.

type SolutionsClientGetResponse added in v0.3.0

type SolutionsClientGetResponse struct {
	// The container for solution.
	Solution
}

SolutionsClientGetResponse contains the response from method SolutionsClient.Get.

type SolutionsClientListByResourceGroupOptions added in v0.3.0

type SolutionsClientListByResourceGroupOptions struct {
}

SolutionsClientListByResourceGroupOptions contains the optional parameters for the SolutionsClient.ListByResourceGroup method.

type SolutionsClientListByResourceGroupResponse added in v0.3.0

type SolutionsClientListByResourceGroupResponse struct {
	// the list of solution response
	SolutionPropertiesList
}

SolutionsClientListByResourceGroupResponse contains the response from method SolutionsClient.ListByResourceGroup.

type SolutionsClientListBySubscriptionOptions added in v0.3.0

type SolutionsClientListBySubscriptionOptions struct {
}

SolutionsClientListBySubscriptionOptions contains the optional parameters for the SolutionsClient.ListBySubscription method.

type SolutionsClientListBySubscriptionResponse added in v0.3.0

type SolutionsClientListBySubscriptionResponse struct {
	// the list of solution response
	SolutionPropertiesList
}

SolutionsClientListBySubscriptionResponse contains the response from method SolutionsClient.ListBySubscription.

type SolutionsClientUpdateResponse added in v0.3.0

type SolutionsClientUpdateResponse struct {
	// The container for solution.
	Solution
}

SolutionsClientUpdateResponse contains the response from method SolutionsClient.BeginUpdate.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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