armhanaonazure

package module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 14 Imported by: 3

README

Azure SAP HANA Module for Go

The armhanaonazure module provides operations for working with Azure SAP HANA.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Supported version of Go (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 SAP HANA module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hanaonazure/armhanaonazure

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure SAP HANA. 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 SAP HANA 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 := armhanaonazure.NewClientFactory(, 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 := armhanaonazure.NewClientFactory(, 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.NewProviderInstancesClient()

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 SAP HANA 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 ClientFactory added in v0.6.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.6.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. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewOperationsClient added in v0.6.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewProviderInstancesClient added in v0.6.0

func (c *ClientFactory) NewProviderInstancesClient() *ProviderInstancesClient

NewProviderInstancesClient creates a new instance of ProviderInstancesClient.

func (*ClientFactory) NewSapMonitorsClient added in v0.6.0

func (c *ClientFactory) NewSapMonitorsClient() *SapMonitorsClient

NewSapMonitorsClient creates a new instance of SapMonitorsClient.

type CreatedByType added in v0.8.0

type CreatedByType string

CreatedByType - The kind of entity that created the resource.

const (
	// CreatedByTypeApplication - The entity was created by an application.
	CreatedByTypeApplication CreatedByType = "Application"
	// CreatedByTypeKey - The entity was created by a key.
	CreatedByTypeKey CreatedByType = "Key"
	// CreatedByTypeManagedIdentity - The entity was created by a managed identity.
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	// CreatedByTypeUser - The entity was created by a user.
	CreatedByTypeUser CreatedByType = "User"
)

func PossibleCreatedByTypeValues added in v0.8.0

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type Display

type Display struct {
	// READ-ONLY; The localized friendly description for the operation as shown to the user. This description should be thorough,
	// yet concise. It will be used in tool-tips and detailed views.
	Description *string

	// READ-ONLY; The localized friendly name for the operation as shown to the user. This name should be concise (to fit in drop
	// downs), but clear (self-documenting). Use Title Casing and include the entity/resource to which it applies.
	Operation *string

	// READ-ONLY; The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs
	// UX. Default value is 'user,system'
	Origin *string

	// READ-ONLY; The localized friendly form of the resource provider name. This form is also expected to include the publisher/company
	// responsible. Use Title Casing. Begin with "Microsoft" for 1st party services.
	Provider *string

	// READ-ONLY; The localized friendly form of the resource type related to this action/operation. This form should match the
	// public documentation for the resource provider. Use Title Casing. For examples, refer to the “name” section.
	Resource *string
}

Display - Detailed HANA operation information

func (Display) MarshalJSON added in v0.6.0

func (d Display) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Display.

func (*Display) UnmarshalJSON added in v0.6.0

func (d *Display) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Display.

type HanaProvisioningStatesEnum

type HanaProvisioningStatesEnum string

HanaProvisioningStatesEnum - State of provisioning of the HanaInstance

const (
	// HanaProvisioningStatesEnumAccepted - Accepted
	HanaProvisioningStatesEnumAccepted HanaProvisioningStatesEnum = "Accepted"
	// HanaProvisioningStatesEnumCreating - Creating
	HanaProvisioningStatesEnumCreating HanaProvisioningStatesEnum = "Creating"
	// HanaProvisioningStatesEnumDeleting - Deleting
	HanaProvisioningStatesEnumDeleting HanaProvisioningStatesEnum = "Deleting"
	// HanaProvisioningStatesEnumFailed - Failed
	HanaProvisioningStatesEnumFailed HanaProvisioningStatesEnum = "Failed"
	// HanaProvisioningStatesEnumMigrating - Migrating
	HanaProvisioningStatesEnumMigrating HanaProvisioningStatesEnum = "Migrating"
	// HanaProvisioningStatesEnumSucceeded - Succeeded
	HanaProvisioningStatesEnumSucceeded HanaProvisioningStatesEnum = "Succeeded"
	// HanaProvisioningStatesEnumUpdating - Updating
	HanaProvisioningStatesEnumUpdating HanaProvisioningStatesEnum = "Updating"
)

func PossibleHanaProvisioningStatesEnumValues

func PossibleHanaProvisioningStatesEnumValues() []HanaProvisioningStatesEnum

PossibleHanaProvisioningStatesEnumValues returns the possible values for the HanaProvisioningStatesEnum const type.

type Operation

type Operation struct {
	// Displayed HANA operation information
	Display *Display

	// READ-ONLY; The name of the operation being performed on this particular object. This name should match the action name
	// that appears in RBAC / the event service.
	Name *string
}

Operation - HANA operation information

func (Operation) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationList

type OperationList struct {
	NextLink *string

	// List of HANA operations
	Value []*Operation
}

OperationList - List of HANA operations

func (OperationList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationList.

func (*OperationList) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationList.

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.

Generated from API version 2020-02-07-preview

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 - Contains optional client configuration. Pass nil to accept the default values.

func (*OperationsClient) NewListPager added in v0.4.0

NewListPager - Gets a list of SAP HANA management operations.

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

Generated from example definition: 2020-02-07-preview/HanaOperations_List.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hanaonazure/armhanaonazure"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhanaonazure.NewClientFactory("", 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 = armhanaonazure.OperationsClientListResponse{
		// 	OperationList: armhanaonazure.OperationList{
		// 		Value: []*armhanaonazure.Operation{
		// 			{
		// 				Name: to.Ptr("HanaOp1"),
		// 				Display: &armhanaonazure.Display{
		// 					Description: to.Ptr("HanaOp1Description"),
		// 					Operation: to.Ptr("HanaOp1OperationName"),
		// 					Origin: to.Ptr("HanaOp1Origin"),
		// 					Provider: to.Ptr("HanaOp1ProviderName"),
		// 					Resource: to.Ptr("HanaOp1ResourceName"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("HanaOp2"),
		// 				Display: &armhanaonazure.Display{
		// 					Description: to.Ptr("HanaOp2Description"),
		// 					Operation: to.Ptr("HanaOp2OperationName"),
		// 					Origin: to.Ptr("HanaOp2Origin"),
		// 					Provider: to.Ptr("HanaOp2ProviderName"),
		// 					Resource: to.Ptr("HanaOp2ResourceName"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	// List of HANA operations
	OperationList
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type ProviderInstance

type ProviderInstance struct {
	// Provider Instance properties
	Properties *ProviderInstanceProperties

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ProviderInstance - A provider instance associated with a SAP monitor.

func (ProviderInstance) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ProviderInstance.

func (*ProviderInstance) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ProviderInstance.

type ProviderInstanceListResult

type ProviderInstanceListResult struct {
	// REQUIRED; The ProviderInstance items on this page
	Value []*ProviderInstance

	// The link to the next page of items
	NextLink *string
}

ProviderInstanceListResult - The response of a ProviderInstance list operation.

func (ProviderInstanceListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ProviderInstanceListResult.

func (*ProviderInstanceListResult) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ProviderInstanceListResult.

type ProviderInstanceProperties

type ProviderInstanceProperties struct {
	// A JSON string containing metadata of the provider instance.
	Metadata *string

	// A JSON string containing the properties of the provider instance.
	Properties *string

	// The type of provider instance.
	Type *string

	// READ-ONLY; State of provisioning of the provider instance
	ProvisioningState *HanaProvisioningStatesEnum
}

ProviderInstanceProperties - Describes the properties of a provider instance.

func (ProviderInstanceProperties) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type ProviderInstanceProperties.

func (*ProviderInstanceProperties) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ProviderInstanceProperties.

type ProviderInstancesClient

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

ProviderInstancesClient contains the methods for the ProviderInstances group. Don't use this type directly, use NewProviderInstancesClient() instead.

Generated from API version 2020-02-07-preview

func NewProviderInstancesClient

func NewProviderInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProviderInstancesClient, error)

NewProviderInstancesClient creates a new instance of ProviderInstancesClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - Contains optional client configuration. Pass nil to accept the default values.

func (*ProviderInstancesClient) BeginCreate

func (client *ProviderInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapMonitorName string, providerInstanceName string, providerInstanceParameter ProviderInstance, options *ProviderInstancesClientBeginCreateOptions) (*runtime.Poller[ProviderInstancesClientCreateResponse], error)

BeginCreate - Creates a provider instance.

The product Microsoft.Workloads/sapMonitors (AMS Classic) is officially retired as of May 31, 2023. If the operation fails it returns an *azcore.ResponseError type.

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • sapMonitorName - Name of the SAP monitor resource.
  • providerInstanceName - Name of the provider instance.
  • providerInstanceParameter - Request body representing a provider instance
  • options - ProviderInstancesClientBeginCreateOptions contains the optional parameters for the ProviderInstancesClient.BeginCreate method.
Example

Generated from example definition: 2020-02-07-preview/ProviderInstances_Create.json

package main

import (
	"context"
	"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/hanaonazure/armhanaonazure"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhanaonazure.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewProviderInstancesClient().BeginCreate(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", armhanaonazure.ProviderInstance{
		Properties: &armhanaonazure.ProviderInstanceProperties{
			Type:       to.Ptr("hana"),
			Metadata:   to.Ptr("{\"key\":\"value\"}"),
			Properties: to.Ptr("{\"hostname\":\"10.0.0.6\",\"dbName\":\"SYSTEMDB\",\"sqlPort\":30013,\"dbUsername\":\"SYSTEM\",\"dbPassword\":\"PASSWORD\"}"),
		},
	}, 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 poll 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 = armhanaonazure.ProviderInstancesClientCreateResponse{
	// 	ProviderInstance: armhanaonazure.ProviderInstance{
	// 		Name: to.Ptr("myProviderInstance"),
	// 		Type: to.Ptr("Microsoft.HanaOnAzure/sapMonitors/providerInstances"),
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.HanaOnAzure/sapMonitors/mySapMonitor/providerInstances/myProviderInstance"),
	// 		Properties: &armhanaonazure.ProviderInstanceProperties{
	// 			Type: to.Ptr("SapHana"),
	// 			Metadata: to.Ptr("{\"key\":\"value\"}"),
	// 			Properties: to.Ptr("{\"hostname\":\"10.0.0.6\",\"dbName\":\"SYSTEMDB\",\"sqlPort\":30013,\"dbUsername\":\"SYSTEM\"}"),
	// 			ProvisioningState: to.Ptr(armhanaonazure.HanaProvisioningStatesEnumAccepted),
	// 		},
	// 	},
	// }
}

func (*ProviderInstancesClient) BeginDelete

func (client *ProviderInstancesClient) BeginDelete(ctx context.Context, resourceGroupName string, sapMonitorName string, providerInstanceName string, options *ProviderInstancesClientBeginDeleteOptions) (*runtime.Poller[ProviderInstancesClientDeleteResponse], error)

BeginDelete - Deletes a provider instance.

The product Microsoft.Workloads/sapMonitors (AMS Classic) is officially retired as of May 31, 2023. If the operation fails it returns an *azcore.ResponseError type.

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • sapMonitorName - Name of the SAP monitor resource.
  • providerInstanceName - Name of the provider instance.
  • options - ProviderInstancesClientBeginDeleteOptions contains the optional parameters for the ProviderInstancesClient.BeginDelete method.
Example

Generated from example definition: 2020-02-07-preview/ProviderInstances_Delete.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hanaonazure/armhanaonazure"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhanaonazure.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewProviderInstancesClient().BeginDelete(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", 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 poll 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 = armhanaonazure.ProviderInstancesClientDeleteResponse{
	// }
}

func (*ProviderInstancesClient) Get

func (client *ProviderInstancesClient) Get(ctx context.Context, resourceGroupName string, sapMonitorName string, providerInstanceName string, options *ProviderInstancesClientGetOptions) (ProviderInstancesClientGetResponse, error)

Get - Gets properties of a provider instance.

The product Microsoft.Workloads/sapMonitors (AMS Classic) is officially retired as of May 31, 2023. If the operation fails it returns an *azcore.ResponseError type.

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • sapMonitorName - Name of the SAP monitor resource.
  • providerInstanceName - Name of the provider instance.
  • options - ProviderInstancesClientGetOptions contains the optional parameters for the ProviderInstancesClient.Get method.
Example

Generated from example definition: 2020-02-07-preview/ProviderInstances_Get.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hanaonazure/armhanaonazure"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhanaonazure.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProviderInstancesClient().Get(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", 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 = armhanaonazure.ProviderInstancesClientGetResponse{
	// 	ProviderInstance: armhanaonazure.ProviderInstance{
	// 		Name: to.Ptr("myProviderInstance"),
	// 		Type: to.Ptr("Microsoft.HanaOnAzure/sapMonitors/providerInstances"),
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.HanaOnAzure/sapMonitors/mySapMonitor/providerInstances/myProviderInstance"),
	// 		Properties: &armhanaonazure.ProviderInstanceProperties{
	// 			Type: to.Ptr("SapHana"),
	// 			Metadata: to.Ptr("{\"key\":\"value\"}"),
	// 			Properties: to.Ptr("{\"hostname\":\"10.0.0.6\",\"dbName\":\"SYSTEMDB\",\"sqlPort\":30013,\"dbUsername\":\"SYSTEM\"}"),
	// 		},
	// 	},
	// }
}

func (*ProviderInstancesClient) NewListPager added in v0.4.0

func (client *ProviderInstancesClient) NewListPager(resourceGroupName string, sapMonitorName string, options *ProviderInstancesClientListOptions) *runtime.Pager[ProviderInstancesClientListResponse]

NewListPager - Gets a list of provider instances in the specified SAP monitor.

The product Microsoft.Workloads/sapMonitors (AMS Classic) is officially retired as of May 31, 2023.

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • sapMonitorName - Name of the SAP monitor resource.
  • options - ProviderInstancesClientListOptions contains the optional parameters for the ProviderInstancesClient.NewListPager method.
Example

Generated from example definition: 2020-02-07-preview/ProviderInstances_List.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hanaonazure/armhanaonazure"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhanaonazure.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewProviderInstancesClient().NewListPager("myResourceGroup", "mySapMonitor", 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 = armhanaonazure.ProviderInstancesClientListResponse{
		// 	ProviderInstanceListResult: armhanaonazure.ProviderInstanceListResult{
		// 		Value: []*armhanaonazure.ProviderInstance{
		// 			{
		// 				Name: to.Ptr("myProviderInstance1"),
		// 				Type: to.Ptr("Microsoft.HanaOnAzure/sapMonitors/providerInstances"),
		// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.HanaOnAzure/sapMonitors/mySapMonitor/providerInstances/myProviderInstance1"),
		// 				Properties: &armhanaonazure.ProviderInstanceProperties{
		// 					Type: to.Ptr("SapHana"),
		// 					Metadata: to.Ptr("{\"key\":\"value\"}"),
		// 					Properties: to.Ptr("{\"hostname\":\"10.0.0.6\",\"dbName\":\"SYSTEMDB\",\"sqlPort\":30013,\"dbUsername\":\"SYSTEM\"}"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("myProviderInstance2"),
		// 				Type: to.Ptr("Microsoft.HanaOnAzure/sapMonitors/providerInstances"),
		// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.HanaOnAzure/sapMonitors/mySapMonitor/providerInstances/myProviderInstance2"),
		// 				Properties: &armhanaonazure.ProviderInstanceProperties{
		// 					Type: to.Ptr("PrometheusHaCluster"),
		// 					Metadata: to.Ptr("{\"key\":\"value\"}"),
		// 					Properties: to.Ptr("{\"prometheusUrl\":\"http://10.0.0.21:9664/metrics\"}"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("myProviderInstance2"),
		// 				Type: to.Ptr("Microsoft.HanaOnAzure/sapMonitors/providerInstances"),
		// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.HanaOnAzure/sapMonitors/mySapMonitor/providerInstances/myProviderInstance2"),
		// 				Properties: &armhanaonazure.ProviderInstanceProperties{
		// 					Type: to.Ptr("MsSqlServer"),
		// 					Metadata: to.Ptr("{\"key\":\"value\"}"),
		// 					Properties: to.Ptr("{\"sqlHostname\":\"10.0.0.6\",\"sqlPort\":1433,\"sqlUsername\":\"sqladmin\"}"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

type ProviderInstancesClientBeginCreateOptions added in v0.2.0

type ProviderInstancesClientBeginCreateOptions struct {
	// Resumes the long-running operation from the provided token.
	ResumeToken string
}

ProviderInstancesClientBeginCreateOptions contains the optional parameters for the ProviderInstancesClient.BeginCreate method.

type ProviderInstancesClientBeginDeleteOptions added in v0.2.0

type ProviderInstancesClientBeginDeleteOptions struct {
	// Resumes the long-running operation from the provided token.
	ResumeToken string
}

ProviderInstancesClientBeginDeleteOptions contains the optional parameters for the ProviderInstancesClient.BeginDelete method.

type ProviderInstancesClientCreateResponse added in v0.2.0

type ProviderInstancesClientCreateResponse struct {
	// A provider instance associated with a SAP monitor.
	ProviderInstance
}

ProviderInstancesClientCreateResponse contains the response from method ProviderInstancesClient.BeginCreate.

type ProviderInstancesClientDeleteResponse added in v0.2.0

type ProviderInstancesClientDeleteResponse struct {
}

ProviderInstancesClientDeleteResponse contains the response from method ProviderInstancesClient.BeginDelete.

type ProviderInstancesClientGetOptions added in v0.2.0

type ProviderInstancesClientGetOptions struct {
}

ProviderInstancesClientGetOptions contains the optional parameters for the ProviderInstancesClient.Get method.

type ProviderInstancesClientGetResponse added in v0.2.0

type ProviderInstancesClientGetResponse struct {
	// A provider instance associated with a SAP monitor.
	ProviderInstance
}

ProviderInstancesClientGetResponse contains the response from method ProviderInstancesClient.Get.

type ProviderInstancesClientListOptions added in v0.2.0

type ProviderInstancesClientListOptions struct {
}

ProviderInstancesClientListOptions contains the optional parameters for the ProviderInstancesClient.NewListPager method.

type ProviderInstancesClientListResponse added in v0.2.0

type ProviderInstancesClientListResponse struct {
	// The response of a ProviderInstance list operation.
	ProviderInstanceListResult
}

ProviderInstancesClientListResponse contains the response from method ProviderInstancesClient.NewListPager.

type SapMonitor

type SapMonitor struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// SAP monitor properties
	Properties *SapMonitorProperties

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

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

SapMonitor - SAP monitor info on Azure (ARM properties and SAP monitor properties)

func (SapMonitor) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SapMonitor.

func (*SapMonitor) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SapMonitor.

type SapMonitorListResult

type SapMonitorListResult struct {
	// REQUIRED; The SapMonitor items on this page
	Value []*SapMonitor

	// The link to the next page of items
	NextLink *string
}

SapMonitorListResult - The response of a SapMonitor list operation.

func (SapMonitorListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SapMonitorListResult.

func (*SapMonitorListResult) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SapMonitorListResult.

type SapMonitorProperties

type SapMonitorProperties struct {
	// The value indicating whether to send analytics to Microsoft
	EnableCustomerAnalytics *bool

	// The ARM ID of the Log Analytics Workspace that is used for monitoring
	LogAnalyticsWorkspaceArmID *string

	// The workspace ID of the log analytics workspace to be used for monitoring
	LogAnalyticsWorkspaceID *string

	// The shared key of the log analytics workspace that is used for monitoring
	LogAnalyticsWorkspaceSharedKey *string

	// The subnet which the SAP monitor will be deployed in
	MonitorSubnet *string

	// READ-ONLY; The name of the resource group the SAP Monitor resources get deployed into.
	ManagedResourceGroupName *string

	// READ-ONLY; State of provisioning of the HanaInstance
	ProvisioningState *HanaProvisioningStatesEnum

	// READ-ONLY; The version of the payload running in the Collector VM
	SapMonitorCollectorVersion *string
}

SapMonitorProperties - Describes the properties of a SAP monitor.

func (SapMonitorProperties) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type SapMonitorProperties.

func (*SapMonitorProperties) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SapMonitorProperties.

type SapMonitorsClient

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

SapMonitorsClient contains the methods for the SapMonitors group. Don't use this type directly, use NewSapMonitorsClient() instead.

Generated from API version 2020-02-07-preview

func NewSapMonitorsClient

func NewSapMonitorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SapMonitorsClient, error)

NewSapMonitorsClient creates a new instance of SapMonitorsClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - Contains optional client configuration. Pass nil to accept the default values.

func (*SapMonitorsClient) BeginCreate

func (client *SapMonitorsClient) BeginCreate(ctx context.Context, resourceGroupName string, sapMonitorName string, sapMonitorParameter SapMonitor, options *SapMonitorsClientBeginCreateOptions) (*runtime.Poller[SapMonitorsClientCreateResponse], error)

BeginCreate - Creates a SAP monitor.

The product Microsoft.Workloads/sapMonitors (AMS Classic) is officially retired as of May 31, 2023. If the operation fails it returns an *azcore.ResponseError type.

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • sapMonitorName - Name of the SAP monitor resource.
  • sapMonitorParameter - Request body representing a SAP Monitor
  • options - SapMonitorsClientBeginCreateOptions contains the optional parameters for the SapMonitorsClient.BeginCreate method.
Example

Generated from example definition: 2020-02-07-preview/SapMonitors_Create.json

package main

import (
	"context"
	"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/hanaonazure/armhanaonazure"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhanaonazure.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSapMonitorsClient().BeginCreate(ctx, "myResourceGroup", "mySapMonitor", armhanaonazure.SapMonitor{
		Location: to.Ptr("westus"),
		Properties: &armhanaonazure.SapMonitorProperties{
			EnableCustomerAnalytics:        to.Ptr(true),
			LogAnalyticsWorkspaceArmID:     to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace"),
			LogAnalyticsWorkspaceID:        to.Ptr("00000000-0000-0000-0000-000000000000"),
			LogAnalyticsWorkspaceSharedKey: to.Ptr("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000=="),
			MonitorSubnet:                  to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"),
		},
		Tags: map[string]*string{
			"key": to.Ptr("value"),
		},
	}, 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 poll 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 = armhanaonazure.SapMonitorsClientCreateResponse{
	// 	SapMonitor: armhanaonazure.SapMonitor{
	// 		Name: to.Ptr("myHanaInstance"),
	// 		Type: to.Ptr("Microsoft.HanaOnAzure/hanaInstances"),
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.HanaOnAzure/hanaInstances/myHanaInstance"),
	// 		Location: to.Ptr("westus"),
	// 		Properties: &armhanaonazure.SapMonitorProperties{
	// 			EnableCustomerAnalytics: to.Ptr(true),
	// 			LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace"),
	// 			LogAnalyticsWorkspaceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			LogAnalyticsWorkspaceSharedKey: to.Ptr("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000=="),
	// 			ManagedResourceGroupName: to.Ptr("myManagedResourceGroup"),
	// 			MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"),
	// 			ProvisioningState: to.Ptr(armhanaonazure.HanaProvisioningStatesEnumSucceeded),
	// 			SapMonitorCollectorVersion: to.Ptr("v1.0"),
	// 		},
	// 		Tags: map[string]*string{
	// 			"key": to.Ptr("value"),
	// 		},
	// 	},
	// }
}

func (*SapMonitorsClient) BeginDelete

func (client *SapMonitorsClient) BeginDelete(ctx context.Context, resourceGroupName string, sapMonitorName string, options *SapMonitorsClientBeginDeleteOptions) (*runtime.Poller[SapMonitorsClientDeleteResponse], error)

BeginDelete - Deletes a SAP monitor.

The product Microsoft.Workloads/sapMonitors (AMS Classic) is officially retired as of May 31, 2023. If the operation fails it returns an *azcore.ResponseError type.

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • sapMonitorName - Name of the SAP monitor resource.
  • options - SapMonitorsClientBeginDeleteOptions contains the optional parameters for the SapMonitorsClient.BeginDelete method.
Example

Generated from example definition: 2020-02-07-preview/SapMonitors_Delete.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hanaonazure/armhanaonazure"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhanaonazure.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSapMonitorsClient().BeginDelete(ctx, "myResourceGroup", "mySapMonitor", 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 poll 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 = armhanaonazure.SapMonitorsClientDeleteResponse{
	// }
}

func (*SapMonitorsClient) Get

func (client *SapMonitorsClient) Get(ctx context.Context, resourceGroupName string, sapMonitorName string, options *SapMonitorsClientGetOptions) (SapMonitorsClientGetResponse, error)

Get - Gets properties of a SAP monitor.

The product Microsoft.Workloads/sapMonitors (AMS Classic) is officially retired as of May 31, 2023. If the operation fails it returns an *azcore.ResponseError type.

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • sapMonitorName - Name of the SAP monitor resource.
  • options - SapMonitorsClientGetOptions contains the optional parameters for the SapMonitorsClient.Get method.
Example

Generated from example definition: 2020-02-07-preview/SapMonitors_Get.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hanaonazure/armhanaonazure"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhanaonazure.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSapMonitorsClient().Get(ctx, "myResourceGroup", "mySapMonitor", 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 = armhanaonazure.SapMonitorsClientGetResponse{
	// 	SapMonitor: armhanaonazure.SapMonitor{
	// 		Name: to.Ptr("mySapMonitor"),
	// 		Type: to.Ptr("Microsoft.HanaOnAzure/sapMonitors"),
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.HanaOnAzure/sapMonitors/mySapMonitor"),
	// 		Location: to.Ptr("westus"),
	// 		Properties: &armhanaonazure.SapMonitorProperties{
	// 			EnableCustomerAnalytics: to.Ptr(true),
	// 			LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace"),
	// 			LogAnalyticsWorkspaceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			LogAnalyticsWorkspaceSharedKey: to.Ptr("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000=="),
	// 			ManagedResourceGroupName: to.Ptr("myManagedResourceGroup"),
	// 			MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"),
	// 			ProvisioningState: to.Ptr(armhanaonazure.HanaProvisioningStatesEnumSucceeded),
	// 			SapMonitorCollectorVersion: to.Ptr("v1.0"),
	// 		},
	// 		Tags: map[string]*string{
	// 			"key": to.Ptr("value"),
	// 		},
	// 	},
	// }
}

func (*SapMonitorsClient) NewListPager added in v0.4.0

NewListPager - Gets a list of SAP monitors in the specified subscription.

The product Microsoft.Workloads/sapMonitors (AMS Classic) is officially retired as of May 31, 2023.

  • options - SapMonitorsClientListOptions contains the optional parameters for the SapMonitorsClient.NewListPager method.
Example

Generated from example definition: 2020-02-07-preview/SapMonitors_List.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hanaonazure/armhanaonazure"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhanaonazure.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewSapMonitorsClient().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 = armhanaonazure.SapMonitorsClientListResponse{
		// 	SapMonitorListResult: armhanaonazure.SapMonitorListResult{
		// 		Value: []*armhanaonazure.SapMonitor{
		// 			{
		// 				Name: to.Ptr("mySapMonitor1"),
		// 				Type: to.Ptr("Microsoft.HanaOnAzure/sapMonitors"),
		// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.HanaOnAzure/sapMonitors/mySapMonitor1"),
		// 				Location: to.Ptr("westus"),
		// 				Properties: &armhanaonazure.SapMonitorProperties{
		// 					EnableCustomerAnalytics: to.Ptr(true),
		// 					LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace"),
		// 					LogAnalyticsWorkspaceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					LogAnalyticsWorkspaceSharedKey: to.Ptr("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000=="),
		// 					ManagedResourceGroupName: to.Ptr("myManagedResourceGroup"),
		// 					MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"),
		// 					ProvisioningState: to.Ptr(armhanaonazure.HanaProvisioningStatesEnumSucceeded),
		// 					SapMonitorCollectorVersion: to.Ptr("v1.0"),
		// 				},
		// 				Tags: map[string]*string{
		// 					"key": to.Ptr("value"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("mySapMonitor2"),
		// 				Type: to.Ptr("Microsoft.HanaOnAzure/sapMonitors"),
		// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.HanaOnAzure/sapMonitors/mySapMonitor2"),
		// 				Location: to.Ptr("westus"),
		// 				Properties: &armhanaonazure.SapMonitorProperties{
		// 					EnableCustomerAnalytics: to.Ptr(true),
		// 					LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace"),
		// 					LogAnalyticsWorkspaceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					LogAnalyticsWorkspaceSharedKey: to.Ptr("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000=="),
		// 					ManagedResourceGroupName: to.Ptr("myManagedResourceGroup"),
		// 					MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"),
		// 					ProvisioningState: to.Ptr(armhanaonazure.HanaProvisioningStatesEnumSucceeded),
		// 					SapMonitorCollectorVersion: to.Ptr("v1.0"),
		// 				},
		// 				Tags: map[string]*string{
		// 					"key": to.Ptr("value"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

func (*SapMonitorsClient) Update

func (client *SapMonitorsClient) Update(ctx context.Context, resourceGroupName string, sapMonitorName string, tagsParameter Tags, options *SapMonitorsClientUpdateOptions) (SapMonitorsClientUpdateResponse, error)

Update - Patches the Tags field of a SAP monitor.

The product Microsoft.Workloads/sapMonitors (AMS Classic) is officially retired as of May 31, 2023. If the operation fails it returns an *azcore.ResponseError type.

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • sapMonitorName - Name of the SAP monitor resource.
  • tagsParameter - Request body that only contains the new Tags field
  • options - SapMonitorsClientUpdateOptions contains the optional parameters for the SapMonitorsClient.Update method.
Example (DeleteTagsFieldOfASapMonitor)

Generated from example definition: 2020-02-07-preview/SapMonitors_PatchTags_Delete.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hanaonazure/armhanaonazure"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhanaonazure.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSapMonitorsClient().Update(ctx, "myResourceGroup", "mySapMonitor", armhanaonazure.Tags{
		Tags: map[string]*string{},
	}, 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 = armhanaonazure.SapMonitorsClientUpdateResponse{
	// 	SapMonitor: armhanaonazure.SapMonitor{
	// 		Name: to.Ptr("mySapMonitor"),
	// 		Type: to.Ptr("Microsoft.HanaOnAzure/sapMonitors"),
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.HanaOnAzure/sapMonitors/mySapMonitor"),
	// 		Location: to.Ptr("westus"),
	// 		Properties: &armhanaonazure.SapMonitorProperties{
	// 			EnableCustomerAnalytics: to.Ptr(true),
	// 			LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace"),
	// 			LogAnalyticsWorkspaceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			LogAnalyticsWorkspaceSharedKey: to.Ptr("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000=="),
	// 			ManagedResourceGroupName: to.Ptr("myManagedResourceGroup"),
	// 			MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"),
	// 			ProvisioningState: to.Ptr(armhanaonazure.HanaProvisioningStatesEnumSucceeded),
	// 			SapMonitorCollectorVersion: to.Ptr("v1.0"),
	// 		},
	// 		Tags: map[string]*string{
	// 		},
	// 	},
	// }
}
Example (UpdateTagsFieldOfASapMonitor)

Generated from example definition: 2020-02-07-preview/SapMonitors_PatchTags.json

package main

import (
	"context"
	"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/hanaonazure/armhanaonazure"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhanaonazure.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSapMonitorsClient().Update(ctx, "myResourceGroup", "mySapMonitor", armhanaonazure.Tags{
		Tags: map[string]*string{
			"testkey": to.Ptr("testvalue"),
		},
	}, 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 = armhanaonazure.SapMonitorsClientUpdateResponse{
	// 	SapMonitor: armhanaonazure.SapMonitor{
	// 		Name: to.Ptr("mySapMonitor"),
	// 		Type: to.Ptr("Microsoft.HanaOnAzure/sapMonitors"),
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.HanaOnAzure/sapMonitors/mySapMonitor"),
	// 		Location: to.Ptr("westus"),
	// 		Properties: &armhanaonazure.SapMonitorProperties{
	// 			EnableCustomerAnalytics: to.Ptr(true),
	// 			LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace"),
	// 			LogAnalyticsWorkspaceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			LogAnalyticsWorkspaceSharedKey: to.Ptr("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000=="),
	// 			ManagedResourceGroupName: to.Ptr("myManagedResourceGroup"),
	// 			MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"),
	// 			ProvisioningState: to.Ptr(armhanaonazure.HanaProvisioningStatesEnumSucceeded),
	// 			SapMonitorCollectorVersion: to.Ptr("v1.0"),
	// 		},
	// 		Tags: map[string]*string{
	// 			"testkey": to.Ptr("testvalue"),
	// 		},
	// 	},
	// }
}

type SapMonitorsClientBeginCreateOptions added in v0.2.0

type SapMonitorsClientBeginCreateOptions struct {
	// Resumes the long-running operation from the provided token.
	ResumeToken string
}

SapMonitorsClientBeginCreateOptions contains the optional parameters for the SapMonitorsClient.BeginCreate method.

type SapMonitorsClientBeginDeleteOptions added in v0.2.0

type SapMonitorsClientBeginDeleteOptions struct {
	// Resumes the long-running operation from the provided token.
	ResumeToken string
}

SapMonitorsClientBeginDeleteOptions contains the optional parameters for the SapMonitorsClient.BeginDelete method.

type SapMonitorsClientCreateResponse added in v0.2.0

type SapMonitorsClientCreateResponse struct {
	// SAP monitor info on Azure (ARM properties and SAP monitor properties)
	SapMonitor
}

SapMonitorsClientCreateResponse contains the response from method SapMonitorsClient.BeginCreate.

type SapMonitorsClientDeleteResponse added in v0.2.0

type SapMonitorsClientDeleteResponse struct {
}

SapMonitorsClientDeleteResponse contains the response from method SapMonitorsClient.BeginDelete.

type SapMonitorsClientGetOptions added in v0.2.0

type SapMonitorsClientGetOptions struct {
}

SapMonitorsClientGetOptions contains the optional parameters for the SapMonitorsClient.Get method.

type SapMonitorsClientGetResponse added in v0.2.0

type SapMonitorsClientGetResponse struct {
	// SAP monitor info on Azure (ARM properties and SAP monitor properties)
	SapMonitor
}

SapMonitorsClientGetResponse contains the response from method SapMonitorsClient.Get.

type SapMonitorsClientListOptions added in v0.2.0

type SapMonitorsClientListOptions struct {
}

SapMonitorsClientListOptions contains the optional parameters for the SapMonitorsClient.NewListPager method.

type SapMonitorsClientListResponse added in v0.2.0

type SapMonitorsClientListResponse struct {
	// The response of a SapMonitor list operation.
	SapMonitorListResult
}

SapMonitorsClientListResponse contains the response from method SapMonitorsClient.NewListPager.

type SapMonitorsClientUpdateOptions added in v0.2.0

type SapMonitorsClientUpdateOptions struct {
}

SapMonitorsClientUpdateOptions contains the optional parameters for the SapMonitorsClient.Update method.

type SapMonitorsClientUpdateResponse added in v0.2.0

type SapMonitorsClientUpdateResponse struct {
	// SAP monitor info on Azure (ARM properties and SAP monitor properties)
	SapMonitor
}

SapMonitorsClientUpdateResponse contains the response from method SapMonitorsClient.Update.

type SystemData added in v0.8.0

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

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

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

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

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

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

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

func (SystemData) MarshalJSON added in v0.8.0

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

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type Tags

type Tags struct {
	// Tags field of the resource.
	Tags map[string]*string
}

Tags field of the resource.

func (Tags) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Tags.

func (*Tags) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Tags.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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