armmysql

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 14 Imported by: 10

README

Azure Database for MySQL Module for Go

PkgGoDev

The armmysql module provides operations for working with Azure Database for MySQL.

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 Database for MySQL module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Database for MySQL. 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 Database for MySQL 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 := armmysql.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 := armmysql.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.NewDatabasesClient()

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 Database for MySQL 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 Advisor

type Advisor struct {
	// The properties of a recommendation action advisor.
	Properties any

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

Advisor - Represents a recommendation action advisor.

func (Advisor) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Advisor.

func (*Advisor) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Advisor.

type AdvisorsClient

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

AdvisorsClient contains the methods for the Advisors group. Don't use this type directly, use NewAdvisorsClient() instead.

func NewAdvisorsClient

func NewAdvisorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdvisorsClient, error)

NewAdvisorsClient creates a new instance of AdvisorsClient with the specified values.

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

func (*AdvisorsClient) Get

func (client *AdvisorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, advisorName string, options *AdvisorsClientGetOptions) (AdvisorsClientGetResponse, error)

Get - Get a recommendation action advisor. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • advisorName - The advisor name for recommendation action.
  • options - AdvisorsClientGetOptions contains the optional parameters for the AdvisorsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/AdvisorsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAdvisorsClient().Get(ctx, "testResourceGroupName", "testServerName", "Index", 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.Advisor = armmysql.Advisor{
	// 	Name: to.Ptr("Index"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/advisors"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/advisors/Index"),
	// 	Properties: map[string]any{
	// 	},
	// }
}
Output:

func (*AdvisorsClient) NewListByServerPager added in v0.5.0

func (client *AdvisorsClient) NewListByServerPager(resourceGroupName string, serverName string, options *AdvisorsClientListByServerOptions) *runtime.Pager[AdvisorsClientListByServerResponse]

NewListByServerPager - List recommendation action advisors.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - AdvisorsClientListByServerOptions contains the optional parameters for the AdvisorsClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/AdvisorsListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAdvisorsClient().NewListByServerPager("testResourceGroupName", "testServerName", 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.AdvisorsResultList = armmysql.AdvisorsResultList{
		// 	Value: []*armmysql.Advisor{
		// 		{
		// 			Name: to.Ptr("Index"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/advisors"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/advisors/Index"),
		// 			Properties: map[string]any{
		// 			},
		// 	}},
		// }
	}
}
Output:

type AdvisorsClientGetOptions added in v0.3.0

type AdvisorsClientGetOptions struct {
}

AdvisorsClientGetOptions contains the optional parameters for the AdvisorsClient.Get method.

type AdvisorsClientGetResponse added in v0.3.0

type AdvisorsClientGetResponse struct {
	// Represents a recommendation action advisor.
	Advisor
}

AdvisorsClientGetResponse contains the response from method AdvisorsClient.Get.

type AdvisorsClientListByServerOptions added in v0.3.0

type AdvisorsClientListByServerOptions struct {
}

AdvisorsClientListByServerOptions contains the optional parameters for the AdvisorsClient.NewListByServerPager method.

type AdvisorsClientListByServerResponse added in v0.3.0

type AdvisorsClientListByServerResponse struct {
	// A list of query statistics.
	AdvisorsResultList
}

AdvisorsClientListByServerResponse contains the response from method AdvisorsClient.NewListByServerPager.

type AdvisorsResultList

type AdvisorsResultList struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string

	// READ-ONLY; The list of recommendation action advisors.
	Value []*Advisor
}

AdvisorsResultList - A list of query statistics.

func (AdvisorsResultList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AdvisorsResultList.

func (*AdvisorsResultList) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AdvisorsResultList.

type CheckNameAvailabilityClient

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

CheckNameAvailabilityClient contains the methods for the CheckNameAvailability group. Don't use this type directly, use NewCheckNameAvailabilityClient() instead.

func NewCheckNameAvailabilityClient

func NewCheckNameAvailabilityClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CheckNameAvailabilityClient, error)

NewCheckNameAvailabilityClient creates a new instance of CheckNameAvailabilityClient with the specified values.

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

func (*CheckNameAvailabilityClient) Execute

Execute - Check the availability of name for resource If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • nameAvailabilityRequest - The required parameters for checking if resource name is available.
  • options - CheckNameAvailabilityClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityClient.Execute method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/CheckNameAvailability.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCheckNameAvailabilityClient().Execute(ctx, armmysql.NameAvailabilityRequest{
		Name: to.Ptr("name1"),
		Type: to.Ptr("Microsoft.DBforMySQL"),
	}, 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.NameAvailability = armmysql.NameAvailability{
	// 	Message: to.Ptr(""),
	// 	NameAvailable: to.Ptr(true),
	// 	Reason: to.Ptr(""),
	// }
}
Output:

type CheckNameAvailabilityClientExecuteOptions added in v0.3.0

type CheckNameAvailabilityClientExecuteOptions struct {
}

CheckNameAvailabilityClientExecuteOptions contains the optional parameters for the CheckNameAvailabilityClient.Execute method.

type CheckNameAvailabilityClientExecuteResponse added in v0.3.0

type CheckNameAvailabilityClientExecuteResponse struct {
	// Represents a resource name availability.
	NameAvailability
}

CheckNameAvailabilityClientExecuteResponse contains the response from method CheckNameAvailabilityClient.Execute.

type ClientFactory added in v1.1.0

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

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

func NewClientFactory added in v1.1.0

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

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

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

func (*ClientFactory) NewAdvisorsClient added in v1.1.0

func (c *ClientFactory) NewAdvisorsClient() *AdvisorsClient

NewAdvisorsClient creates a new instance of AdvisorsClient.

func (*ClientFactory) NewCheckNameAvailabilityClient added in v1.1.0

func (c *ClientFactory) NewCheckNameAvailabilityClient() *CheckNameAvailabilityClient

NewCheckNameAvailabilityClient creates a new instance of CheckNameAvailabilityClient.

func (*ClientFactory) NewConfigurationsClient added in v1.1.0

func (c *ClientFactory) NewConfigurationsClient() *ConfigurationsClient

NewConfigurationsClient creates a new instance of ConfigurationsClient.

func (*ClientFactory) NewDatabasesClient added in v1.1.0

func (c *ClientFactory) NewDatabasesClient() *DatabasesClient

NewDatabasesClient creates a new instance of DatabasesClient.

func (*ClientFactory) NewFirewallRulesClient added in v1.1.0

func (c *ClientFactory) NewFirewallRulesClient() *FirewallRulesClient

NewFirewallRulesClient creates a new instance of FirewallRulesClient.

func (*ClientFactory) NewLocationBasedPerformanceTierClient added in v1.1.0

func (c *ClientFactory) NewLocationBasedPerformanceTierClient() *LocationBasedPerformanceTierClient

NewLocationBasedPerformanceTierClient creates a new instance of LocationBasedPerformanceTierClient.

func (*ClientFactory) NewLocationBasedRecommendedActionSessionsOperationStatusClient added in v1.1.0

func (c *ClientFactory) NewLocationBasedRecommendedActionSessionsOperationStatusClient() *LocationBasedRecommendedActionSessionsOperationStatusClient

NewLocationBasedRecommendedActionSessionsOperationStatusClient creates a new instance of LocationBasedRecommendedActionSessionsOperationStatusClient.

func (*ClientFactory) NewLocationBasedRecommendedActionSessionsResultClient added in v1.1.0

func (c *ClientFactory) NewLocationBasedRecommendedActionSessionsResultClient() *LocationBasedRecommendedActionSessionsResultClient

NewLocationBasedRecommendedActionSessionsResultClient creates a new instance of LocationBasedRecommendedActionSessionsResultClient.

func (*ClientFactory) NewLogFilesClient added in v1.1.0

func (c *ClientFactory) NewLogFilesClient() *LogFilesClient

NewLogFilesClient creates a new instance of LogFilesClient.

func (*ClientFactory) NewManagementClient added in v1.1.0

func (c *ClientFactory) NewManagementClient() *ManagementClient

NewManagementClient creates a new instance of ManagementClient.

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewPrivateEndpointConnectionsClient added in v1.1.0

func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient

NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient.

func (*ClientFactory) NewPrivateLinkResourcesClient added in v1.1.0

func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient

NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient.

func (*ClientFactory) NewQueryTextsClient added in v1.1.0

func (c *ClientFactory) NewQueryTextsClient() *QueryTextsClient

NewQueryTextsClient creates a new instance of QueryTextsClient.

func (*ClientFactory) NewRecommendedActionsClient added in v1.1.0

func (c *ClientFactory) NewRecommendedActionsClient() *RecommendedActionsClient

NewRecommendedActionsClient creates a new instance of RecommendedActionsClient.

func (*ClientFactory) NewRecoverableServersClient added in v1.1.0

func (c *ClientFactory) NewRecoverableServersClient() *RecoverableServersClient

NewRecoverableServersClient creates a new instance of RecoverableServersClient.

func (*ClientFactory) NewReplicasClient added in v1.1.0

func (c *ClientFactory) NewReplicasClient() *ReplicasClient

NewReplicasClient creates a new instance of ReplicasClient.

func (*ClientFactory) NewServerAdministratorsClient added in v1.1.0

func (c *ClientFactory) NewServerAdministratorsClient() *ServerAdministratorsClient

NewServerAdministratorsClient creates a new instance of ServerAdministratorsClient.

func (*ClientFactory) NewServerBasedPerformanceTierClient added in v1.1.0

func (c *ClientFactory) NewServerBasedPerformanceTierClient() *ServerBasedPerformanceTierClient

NewServerBasedPerformanceTierClient creates a new instance of ServerBasedPerformanceTierClient.

func (*ClientFactory) NewServerKeysClient added in v1.1.0

func (c *ClientFactory) NewServerKeysClient() *ServerKeysClient

NewServerKeysClient creates a new instance of ServerKeysClient.

func (*ClientFactory) NewServerParametersClient added in v1.1.0

func (c *ClientFactory) NewServerParametersClient() *ServerParametersClient

NewServerParametersClient creates a new instance of ServerParametersClient.

func (*ClientFactory) NewServerSecurityAlertPoliciesClient added in v1.1.0

func (c *ClientFactory) NewServerSecurityAlertPoliciesClient() *ServerSecurityAlertPoliciesClient

NewServerSecurityAlertPoliciesClient creates a new instance of ServerSecurityAlertPoliciesClient.

func (*ClientFactory) NewServersClient added in v1.1.0

func (c *ClientFactory) NewServersClient() *ServersClient

NewServersClient creates a new instance of ServersClient.

func (*ClientFactory) NewTopQueryStatisticsClient added in v1.1.0

func (c *ClientFactory) NewTopQueryStatisticsClient() *TopQueryStatisticsClient

NewTopQueryStatisticsClient creates a new instance of TopQueryStatisticsClient.

func (*ClientFactory) NewVirtualNetworkRulesClient added in v1.1.0

func (c *ClientFactory) NewVirtualNetworkRulesClient() *VirtualNetworkRulesClient

NewVirtualNetworkRulesClient creates a new instance of VirtualNetworkRulesClient.

func (*ClientFactory) NewWaitStatisticsClient added in v1.1.0

func (c *ClientFactory) NewWaitStatisticsClient() *WaitStatisticsClient

NewWaitStatisticsClient creates a new instance of WaitStatisticsClient.

type Configuration

type Configuration struct {
	// The properties of a configuration.
	Properties *ConfigurationProperties

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

Configuration - Represents a Configuration.

func (Configuration) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Configuration.

func (*Configuration) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Configuration.

type ConfigurationListResult

type ConfigurationListResult struct {
	// The list of server configurations.
	Value []*Configuration
}

ConfigurationListResult - A list of server configurations.

func (ConfigurationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ConfigurationListResult.

func (*ConfigurationListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationListResult.

type ConfigurationProperties

type ConfigurationProperties struct {
	// Source of the configuration.
	Source *string

	// Value of the configuration.
	Value *string

	// READ-ONLY; Allowed values of the configuration.
	AllowedValues *string

	// READ-ONLY; Data type of the configuration.
	DataType *string

	// READ-ONLY; Default value of the configuration.
	DefaultValue *string

	// READ-ONLY; Description of the configuration.
	Description *string
}

ConfigurationProperties - The properties of a configuration.

func (ConfigurationProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ConfigurationProperties.

func (*ConfigurationProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProperties.

type ConfigurationsClient

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

ConfigurationsClient contains the methods for the Configurations group. Don't use this type directly, use NewConfigurationsClient() instead.

func NewConfigurationsClient

func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationsClient, error)

NewConfigurationsClient creates a new instance of ConfigurationsClient with the specified values.

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

func (*ConfigurationsClient) BeginCreateOrUpdate

func (client *ConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration, options *ConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConfigurationsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Updates a configuration of a server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • configurationName - The name of the server configuration.
  • parameters - The required parameters for updating a server configuration.
  • options - ConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ConfigurationCreateOrUpdate.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewConfigurationsClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "event_scheduler", armmysql.Configuration{
		Properties: &armmysql.ConfigurationProperties{
			Source: to.Ptr("user-override"),
			Value:  to.Ptr("off"),
		},
	}, 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.Configuration = armmysql.Configuration{
	// 	Name: to.Ptr("event_scheduler"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/configurations/event_scheduler"),
	// 	Properties: &armmysql.ConfigurationProperties{
	// 		Description: to.Ptr("Indicates the status of the Event Scheduler."),
	// 		AllowedValues: to.Ptr("ON,OFF,DISABLED"),
	// 		DataType: to.Ptr("Enumeration"),
	// 		DefaultValue: to.Ptr("OFF"),
	// 		Source: to.Ptr("user-override"),
	// 		Value: to.Ptr("ON"),
	// 	},
	// }
}
Output:

func (*ConfigurationsClient) Get

func (client *ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, serverName string, configurationName string, options *ConfigurationsClientGetOptions) (ConfigurationsClientGetResponse, error)

Get - Gets information about a configuration of server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • configurationName - The name of the server configuration.
  • options - ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ConfigurationGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConfigurationsClient().Get(ctx, "TestGroup", "testserver", "event_scheduler", 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.Configuration = armmysql.Configuration{
	// 	Name: to.Ptr("event_scheduler"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/configurations/event_scheduler"),
	// 	Properties: &armmysql.ConfigurationProperties{
	// 		Description: to.Ptr("Indicates the status of the Event Scheduler."),
	// 		AllowedValues: to.Ptr("ON,OFF,DISABLED"),
	// 		DataType: to.Ptr("Enumeration"),
	// 		DefaultValue: to.Ptr("OFF"),
	// 		Source: to.Ptr("user-override"),
	// 		Value: to.Ptr("ON"),
	// 	},
	// }
}
Output:

func (*ConfigurationsClient) NewListByServerPager added in v0.5.0

func (client *ConfigurationsClient) NewListByServerPager(resourceGroupName string, serverName string, options *ConfigurationsClientListByServerOptions) *runtime.Pager[ConfigurationsClientListByServerResponse]

NewListByServerPager - List all the configurations in a given server.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ConfigurationsClientListByServerOptions contains the optional parameters for the ConfigurationsClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ConfigurationListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConfigurationsClient().NewListByServerPager("testrg", "mysqltestsvc1", 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.ConfigurationListResult = armmysql.ConfigurationListResult{
		// 	Value: []*armmysql.Configuration{
		// 		{
		// 			Name: to.Ptr("event_scheduler"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/event_scheduler"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Indicates the status of the Event Scheduler."),
		// 				AllowedValues: to.Ptr("ON,OFF,DISABLED"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("OFF"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("OFF"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("div_precision_increment"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/div_precision_increment"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Number of digits by which to increase the scale of the result of division operations."),
		// 				AllowedValues: to.Ptr("0-30"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("4"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("4"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("group_concat_max_len"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/group_concat_max_len"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Maximum allowed result length in bytes for the GROUP_CONCAT()."),
		// 				AllowedValues: to.Ptr("4-16777216"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("1024"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("1024"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("innodb_adaptive_hash_index"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_adaptive_hash_index"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Whether innodb adaptive hash indexes are enabled or disabled."),
		// 				AllowedValues: to.Ptr("ON,OFF"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("ON"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("ON"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("innodb_lock_wait_timeout"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_lock_wait_timeout"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The length of time in seconds an InnoDB transaction waits for a row lock before giving up."),
		// 				AllowedValues: to.Ptr("1-3600"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("50"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("50"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("interactive_timeout"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/interactive_timeout"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Number of seconds the server waits for activity on an interactive connection before closing it."),
		// 				AllowedValues: to.Ptr("10-1800"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("1800"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("1800"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_queries_not_using_indexes"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/log_queries_not_using_indexes"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Logs queries that are expected to retrieve all rows to slow query log."),
		// 				AllowedValues: to.Ptr("ON,OFF"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("OFF"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("OFF"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_throttle_queries_not_using_indexes"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/log_throttle_queries_not_using_indexes"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Limits the number of such queries per minute that can be written to the slow query log."),
		// 				AllowedValues: to.Ptr("0-4294967295"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_slow_admin_statements"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/log_slow_admin_statements"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Include slow administrative statements in the statements written to the slow query log."),
		// 				AllowedValues: to.Ptr("ON,OFF"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("OFF"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("OFF"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_slow_slave_statements"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/log_slow_slave_statements"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("When the slow query log is enabled, this variable enables logging for queries that have taken more than long_query_time seconds to execute on the slave."),
		// 				AllowedValues: to.Ptr("ON,OFF"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("OFF"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("OFF"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("log_bin_trust_function_creators"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/log_bin_trust_function_creators"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("This variable applies when binary logging is enabled. It controls whether stored function creators can be trusted not to create stored functions that will cause unsafe events to be written to the binary log."),
		// 				AllowedValues: to.Ptr("ON,OFF"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("OFF"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("OFF"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("long_query_time"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/long_query_time"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("If a query takes longer than this many seconds, the server increments the Slow_queries status variable."),
		// 				AllowedValues: to.Ptr("0-1E+100"),
		// 				DataType: to.Ptr("Numeric"),
		// 				DefaultValue: to.Ptr("10"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("10"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("min_examined_row_limit"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/min_examined_row_limit"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Can be used to cause queries which examine fewer than the stated number of rows not to be logged."),
		// 				AllowedValues: to.Ptr("0-18446744073709551615"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("slow_query_log"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/slow_query_log"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Enable or disable the slow query log"),
		// 				AllowedValues: to.Ptr("ON,OFF"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("OFF"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("OFF"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("sql_mode"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/sql_mode"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The current server SQL mode."),
		// 				AllowedValues: to.Ptr(",ALLOW_INVALID_DATES,ANSI_QUOTES,ERROR_FOR_DIVISION_BY_ZERO,HIGH_NOT_PRECEDENCE,IGNORE_SPACE,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,NO_DIR_IN_CREATE,NO_ENGINE_SUBSTITUTION,NO_FIELD_OPTIONS,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_UNSIGNED_SUBTRACTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY,PAD_CHAR_TO_FULL_LENGTH,PIPES_AS_CONCAT,REAL_AS_FLOAT,STRICT_ALL_TABLES,STRICT_TRANS_TABLES"),
		// 				DataType: to.Ptr("Set"),
		// 				DefaultValue: to.Ptr(""),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr(""),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("wait_timeout"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/wait_timeout"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The number of seconds the server waits for activity on a noninteractive connection before closing it."),
		// 				AllowedValues: to.Ptr("60-86400"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("120"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("120"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("net_read_timeout"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/net_read_timeout"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The number of seconds the server waits for network reading action, especially for LOAD DATA LOCAL FILE."),
		// 				AllowedValues: to.Ptr("10-3600"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("120"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("120"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("net_write_timeout"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/net_write_timeout"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The number of seconds the server waits for network writing action, especially for LOAD DATA LOCAL FILE."),
		// 				AllowedValues: to.Ptr("10-3600"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("240"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("240"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("server_id"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/server_id"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The server ID, used in replication to give each master and slave a unique identity."),
		// 				AllowedValues: to.Ptr("1000-4294967295"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("1000"),
		// 				Source: to.Ptr("user-override"),
		// 				Value: to.Ptr("1381286943"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("max_allowed_packet"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/max_allowed_packet"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The maximum size of one packet or any generated/intermediate string, or any parameter sent by the mysql_stmt_send_long_data() C API function."),
		// 				AllowedValues: to.Ptr("1024-1073741824"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("536870912"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("536870912"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("slave_net_timeout"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/slave_net_timeout"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The number of seconds to wait for more data from the master before the slave considers the connection broken, aborts the read, and tries to reconnect."),
		// 				AllowedValues: to.Ptr("30-3600"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("60"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("60"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("time_zone"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/time_zone"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The server time zone"),
		// 				AllowedValues: to.Ptr("[+|-][0]{0,1}[0-9]:[0-5][0-9]|[+|-][1][0-2]:[0-5][0-9]|SYSTEM"),
		// 				DataType: to.Ptr("String"),
		// 				DefaultValue: to.Ptr("SYSTEM"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("SYSTEM"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("binlog_group_commit_sync_delay"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/binlog_group_commit_sync_delay"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Controls how many microseconds the binary log commit waits before synchronizing the binary log file to disk."),
		// 				AllowedValues: to.Ptr("0,11-1000000"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("1000"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("1000"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("binlog_group_commit_sync_no_delay_count"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/binlog_group_commit_sync_no_delay_count"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The maximum number of transactions to wait for before aborting the current delay as specified by binlog-group-commit-sync-delay."),
		// 				AllowedValues: to.Ptr("0-1000000"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("character_set_server"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/character_set_server"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Use charset_name as the default server character set."),
		// 				AllowedValues: to.Ptr("BIG5,DEC8,CP850,HP8,KOI8R,LATIN1,LATIN2,SWE7,ASCII,UJIS,SJIS,HEBREW,TIS620,EUCKR,KOI8U,GB2312,GREEK,CP1250,GBK,LATIN5,ARMSCII8,UTF8,UCS2,CP866,KEYBCS2,MACCE,MACROMAN,CP852,LATIN7,UTF8MB4,CP1251,UTF16,CP1256,CP1257,UTF32,BINARY,GEOSTD8,CP932,EUCJPMS"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("latin1"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("latin1"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("join_buffer_size"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/join_buffer_size"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The minimum size of the buffer that is used for plain index scans, range index scans, and joins that do not use indexes and thus perform full table scans."),
		// 				AllowedValues: to.Ptr("128-2097152"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("262144"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("262144"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("table_open_cache"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/table_open_cache"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The number of open tables for all threads."),
		// 				AllowedValues: to.Ptr("1-4000"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("2000"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("2000"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("lower_case_table_names"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/lower_case_table_names"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("If set to 1, table names are stored in lowercase on disk and comparisons are not case sensitive. If set to 2, table names are stored as given but compared in lowercase."),
		// 				AllowedValues: to.Ptr("1,2"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("1"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("1"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("slave_compressed_protocol"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/slave_compressed_protocol"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("This option places an upper limit on the total size in bytes of all relay logs on the slave."),
		// 				AllowedValues: to.Ptr("ON,OFF"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("OFF"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("OFF"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("innodb_io_capacity"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_io_capacity"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Sets an upper limit on I/O activity performed by InnoDB background tasks, such as flushing pages from the buffer pool and merging data from the change buffer."),
		// 				AllowedValues: to.Ptr("100-1500"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("200"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("200"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("innodb_read_io_threads"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_read_io_threads"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The number of I/O threads for read operations in InnoDB."),
		// 				AllowedValues: to.Ptr("1-64"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("4"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("4"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("innodb_thread_concurrency"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_thread_concurrency"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("InnoDB tries to keep the number of operating system threads concurrently inside InnoDB less than or equal to the limit given by this variable."),
		// 				AllowedValues: to.Ptr("0-1000"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("0"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("innodb_write_io_threads"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_write_io_threads"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The number of I/O threads for write operations in InnoDB."),
		// 				AllowedValues: to.Ptr("1-64"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("4"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("4"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("innodb_page_cleaners"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_page_cleaners"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The number of page cleaner threads that flush dirty pages from buffer pool instances."),
		// 				AllowedValues: to.Ptr("1-64"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("4"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("4"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("innodb_online_alter_log_max_size"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_online_alter_log_max_size"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Specifies an upper limit on the size of the temporary log files used during online DDL operations for InnoDB tables."),
		// 				AllowedValues: to.Ptr("65536-2147483648"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("134217728"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("134217728"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("init_connect"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/init_connect"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("A string to be executed by the server for each client that connects."),
		// 				AllowedValues: to.Ptr(""),
		// 				DataType: to.Ptr("String"),
		// 				DefaultValue: to.Ptr(""),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr(""),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("tx_isolation"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/tx_isolation"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The default transaction isolation level."),
		// 				AllowedValues: to.Ptr("READ-UNCOMMITTED,READ-COMMITTED,REPEATABLE-READ,SERIALIZABLE"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("REPEATABLE-READ"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("REPEATABLE-READ"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("eq_range_index_dive_limit"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/eq_range_index_dive_limit"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("This variable indicates the number of equality ranges in an equality comparison condition when the optimizer should switch from using index dives to index statistics in estimating the number of qualifying rows."),
		// 				AllowedValues: to.Ptr("0-4294967295"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("200"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("200"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("innodb_old_blocks_pct"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_old_blocks_pct"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Specifies the approximate percentage of the InnoDB buffer pool used for the old block sublist."),
		// 				AllowedValues: to.Ptr("5-95"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("37"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("37"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("innodb_old_blocks_time"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_old_blocks_time"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Non-zero values protect against the buffer pool being filled by data that is referenced only for a brief period, such as during a full table scan."),
		// 				AllowedValues: to.Ptr("0-4294967295"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("1000"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("1000"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("innodb_read_ahead_threshold"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_read_ahead_threshold"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Controls the sensitivity of linear read-ahead that InnoDB uses to prefetch pages into the buffer pool."),
		// 				AllowedValues: to.Ptr("0-64"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("56"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("56"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("max_length_for_sort_data"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/max_length_for_sort_data"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("The cutoff on the size of index values that determines which filesort algorithm to use."),
		// 				AllowedValues: to.Ptr("4-8388608"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("1024"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("1024"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("max_connect_errors"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/max_connect_errors"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("If more than this many successive connection requests from a host are interrupted without a successful connection, the server blocks that host from further connections."),
		// 				AllowedValues: to.Ptr("1-18446744073709551615"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("100"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("100"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("innodb_thread_sleep_delay"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_thread_sleep_delay"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Defines how long InnoDB threads sleep before joining the InnoDB queue, in microseconds."),
		// 				AllowedValues: to.Ptr("0-1000000"),
		// 				DataType: to.Ptr("Integer"),
		// 				DefaultValue: to.Ptr("10000"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("10000"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("innodb_file_format"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/innodb_file_format"),
		// 			Properties: &armmysql.ConfigurationProperties{
		// 				Description: to.Ptr("Indicates the InnoDB file format for file-per-table tablespaces."),
		// 				AllowedValues: to.Ptr("Antelope,Barracuda"),
		// 				DataType: to.Ptr("Enumeration"),
		// 				DefaultValue: to.Ptr("Barracuda"),
		// 				Source: to.Ptr("system-default"),
		// 				Value: to.Ptr("Barracuda"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ConfigurationsClientBeginCreateOrUpdateOptions added in v0.3.0

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

ConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginCreateOrUpdate method.

type ConfigurationsClientCreateOrUpdateResponse added in v0.3.0

type ConfigurationsClientCreateOrUpdateResponse struct {
	// Represents a Configuration.
	Configuration
}

ConfigurationsClientCreateOrUpdateResponse contains the response from method ConfigurationsClient.BeginCreateOrUpdate.

type ConfigurationsClientGetOptions added in v0.3.0

type ConfigurationsClientGetOptions struct {
}

ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method.

type ConfigurationsClientGetResponse added in v0.3.0

type ConfigurationsClientGetResponse struct {
	// Represents a Configuration.
	Configuration
}

ConfigurationsClientGetResponse contains the response from method ConfigurationsClient.Get.

type ConfigurationsClientListByServerOptions added in v0.3.0

type ConfigurationsClientListByServerOptions struct {
}

ConfigurationsClientListByServerOptions contains the optional parameters for the ConfigurationsClient.NewListByServerPager method.

type ConfigurationsClientListByServerResponse added in v0.3.0

type ConfigurationsClientListByServerResponse struct {
	// A list of server configurations.
	ConfigurationListResult
}

ConfigurationsClientListByServerResponse contains the response from method ConfigurationsClient.NewListByServerPager.

type CreateMode

type CreateMode string

CreateMode - The mode to create a new server.

const (
	CreateModeDefault            CreateMode = "Default"
	CreateModeGeoRestore         CreateMode = "GeoRestore"
	CreateModePointInTimeRestore CreateMode = "PointInTimeRestore"
	CreateModeReplica            CreateMode = "Replica"
)

func PossibleCreateModeValues

func PossibleCreateModeValues() []CreateMode

PossibleCreateModeValues returns the possible values for the CreateMode const type.

type Database

type Database struct {
	// The properties of a database.
	Properties *DatabaseProperties

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

Database - Represents a Database.

func (Database) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Database.

func (*Database) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Database.

type DatabaseListResult

type DatabaseListResult struct {
	// The list of databases housed in a server
	Value []*Database
}

DatabaseListResult - A List of databases.

func (DatabaseListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseListResult.

func (*DatabaseListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseListResult.

type DatabaseProperties

type DatabaseProperties struct {
	// The charset of the database.
	Charset *string

	// The collation of the database.
	Collation *string
}

DatabaseProperties - The properties of a database.

func (DatabaseProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type DatabaseProperties.

func (*DatabaseProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseProperties.

type DatabasesClient

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

DatabasesClient contains the methods for the Databases group. Don't use this type directly, use NewDatabasesClient() instead.

func NewDatabasesClient

func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabasesClient, error)

NewDatabasesClient creates a new instance of DatabasesClient with the specified values.

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

func (*DatabasesClient) BeginCreateOrUpdate

func (client *DatabasesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[DatabasesClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates a new database or updates an existing database. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • databaseName - The name of the database.
  • parameters - The required parameters for creating or updating a database.
  • options - DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/DatabaseCreate.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "db1", armmysql.Database{
		Properties: &armmysql.DatabaseProperties{
			Charset:   to.Ptr("utf8"),
			Collation: to.Ptr("utf8_general_ci"),
		},
	}, 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.Database = armmysql.Database{
	// 	Name: to.Ptr("db1"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/databases"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/databases/db1"),
	// 	Properties: &armmysql.DatabaseProperties{
	// 		Charset: to.Ptr("utf8"),
	// 		Collation: to.Ptr("utf8_general_ci"),
	// 	},
	// }
}
Output:

func (*DatabasesClient) BeginDelete

func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*runtime.Poller[DatabasesClientDeleteResponse], error)

BeginDelete - Deletes a database. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • databaseName - The name of the database.
  • options - DatabasesClientBeginDeleteOptions contains the optional parameters for the DatabasesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/DatabaseDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDatabasesClient().BeginDelete(ctx, "TestGroup", "testserver", "db1", 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 (*DatabasesClient) Get

func (client *DatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientGetOptions) (DatabasesClientGetResponse, error)

Get - Gets information about a database. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • databaseName - The name of the database.
  • options - DatabasesClientGetOptions contains the optional parameters for the DatabasesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/DatabaseGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDatabasesClient().Get(ctx, "TestGroup", "testserver", "db1", 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.Database = armmysql.Database{
	// 	Name: to.Ptr("db1"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/databases"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/databases/db1"),
	// 	Properties: &armmysql.DatabaseProperties{
	// 		Charset: to.Ptr("utf8"),
	// 		Collation: to.Ptr("utf8_general_ci"),
	// 	},
	// }
}
Output:

func (*DatabasesClient) NewListByServerPager added in v0.5.0

func (client *DatabasesClient) NewListByServerPager(resourceGroupName string, serverName string, options *DatabasesClientListByServerOptions) *runtime.Pager[DatabasesClientListByServerResponse]

NewListByServerPager - List all the databases in a given server.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - DatabasesClientListByServerOptions contains the optional parameters for the DatabasesClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/DatabaseListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDatabasesClient().NewListByServerPager("TestGroup", "testserver", 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.DatabaseListResult = armmysql.DatabaseListResult{
		// 	Value: []*armmysql.Database{
		// 		{
		// 			Name: to.Ptr("db1"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/databases"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/databases/db1"),
		// 			Properties: &armmysql.DatabaseProperties{
		// 				Charset: to.Ptr("utf8"),
		// 				Collation: to.Ptr("utf8_general_ci"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("db2"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/databases"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/databases/db2"),
		// 			Properties: &armmysql.DatabaseProperties{
		// 				Charset: to.Ptr("utf8"),
		// 				Collation: to.Ptr("utf8_general_ci"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type DatabasesClientBeginCreateOrUpdateOptions added in v0.3.0

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

DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate method.

type DatabasesClientBeginDeleteOptions added in v0.3.0

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

DatabasesClientBeginDeleteOptions contains the optional parameters for the DatabasesClient.BeginDelete method.

type DatabasesClientCreateOrUpdateResponse added in v0.3.0

type DatabasesClientCreateOrUpdateResponse struct {
	// Represents a Database.
	Database
}

DatabasesClientCreateOrUpdateResponse contains the response from method DatabasesClient.BeginCreateOrUpdate.

type DatabasesClientDeleteResponse added in v0.3.0

type DatabasesClientDeleteResponse struct {
}

DatabasesClientDeleteResponse contains the response from method DatabasesClient.BeginDelete.

type DatabasesClientGetOptions added in v0.3.0

type DatabasesClientGetOptions struct {
}

DatabasesClientGetOptions contains the optional parameters for the DatabasesClient.Get method.

type DatabasesClientGetResponse added in v0.3.0

type DatabasesClientGetResponse struct {
	// Represents a Database.
	Database
}

DatabasesClientGetResponse contains the response from method DatabasesClient.Get.

type DatabasesClientListByServerOptions added in v0.3.0

type DatabasesClientListByServerOptions struct {
}

DatabasesClientListByServerOptions contains the optional parameters for the DatabasesClient.NewListByServerPager method.

type DatabasesClientListByServerResponse added in v0.3.0

type DatabasesClientListByServerResponse struct {
	// A List of databases.
	DatabaseListResult
}

DatabasesClientListByServerResponse contains the response from method DatabasesClient.NewListByServerPager.

type ErrorAdditionalInfo

type ErrorAdditionalInfo struct {
	// READ-ONLY; The additional info.
	Info any

	// READ-ONLY; The additional info type.
	Type *string
}

ErrorAdditionalInfo - The resource management error additional info.

func (ErrorAdditionalInfo) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.

func (*ErrorAdditionalInfo) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.

type ErrorResponse

type ErrorResponse struct {
	// READ-ONLY; The error additional info.
	AdditionalInfo []*ErrorAdditionalInfo

	// READ-ONLY; The error code.
	Code *string

	// READ-ONLY; The error details.
	Details []*ErrorResponse

	// READ-ONLY; The error message.
	Message *string

	// READ-ONLY; The error target.
	Target *string
}

ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)

func (ErrorResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type FirewallRule

type FirewallRule struct {
	// REQUIRED; The properties of a firewall rule.
	Properties *FirewallRuleProperties

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

FirewallRule - Represents a server firewall rule.

func (FirewallRule) MarshalJSON

func (f FirewallRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FirewallRule.

func (*FirewallRule) UnmarshalJSON added in v1.1.0

func (f *FirewallRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRule.

type FirewallRuleListResult

type FirewallRuleListResult struct {
	// The list of firewall rules in a server.
	Value []*FirewallRule
}

FirewallRuleListResult - A list of firewall rules.

func (FirewallRuleListResult) MarshalJSON

func (f FirewallRuleListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FirewallRuleListResult.

func (*FirewallRuleListResult) UnmarshalJSON added in v1.1.0

func (f *FirewallRuleListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleListResult.

type FirewallRuleProperties

type FirewallRuleProperties struct {
	// REQUIRED; The end IP address of the server firewall rule. Must be IPv4 format.
	EndIPAddress *string

	// REQUIRED; The start IP address of the server firewall rule. Must be IPv4 format.
	StartIPAddress *string
}

FirewallRuleProperties - The properties of a server firewall rule.

func (FirewallRuleProperties) MarshalJSON added in v1.1.0

func (f FirewallRuleProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FirewallRuleProperties.

func (*FirewallRuleProperties) UnmarshalJSON added in v1.1.0

func (f *FirewallRuleProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleProperties.

type FirewallRulesClient

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

FirewallRulesClient contains the methods for the FirewallRules group. Don't use this type directly, use NewFirewallRulesClient() instead.

func NewFirewallRulesClient

func NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallRulesClient, error)

NewFirewallRulesClient creates a new instance of FirewallRulesClient with the specified values.

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

func (*FirewallRulesClient) BeginCreateOrUpdate

func (client *FirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule, options *FirewallRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[FirewallRulesClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates a new firewall rule or updates an existing firewall rule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • firewallRuleName - The name of the server firewall rule.
  • parameters - The required parameters for creating or updating a firewall rule.
  • options - FirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/FirewallRuleCreate.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "TestGroup", "testserver", "rule1", armmysql.FirewallRule{
		Properties: &armmysql.FirewallRuleProperties{
			EndIPAddress:   to.Ptr("255.255.255.255"),
			StartIPAddress: to.Ptr("0.0.0.0"),
		},
	}, 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.FirewallRule = armmysql.FirewallRule{
	// 	Name: to.Ptr("rule1"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/firewallRules"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/firewallRules/rule1"),
	// 	Properties: &armmysql.FirewallRuleProperties{
	// 		EndIPAddress: to.Ptr("255.255.255.255"),
	// 		StartIPAddress: to.Ptr("0.0.0.0"),
	// 	},
	// }
}
Output:

func (*FirewallRulesClient) BeginDelete

func (client *FirewallRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientBeginDeleteOptions) (*runtime.Poller[FirewallRulesClientDeleteResponse], error)

BeginDelete - Deletes a server firewall rule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • firewallRuleName - The name of the server firewall rule.
  • options - FirewallRulesClientBeginDeleteOptions contains the optional parameters for the FirewallRulesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/FirewallRuleDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewFirewallRulesClient().BeginDelete(ctx, "TestGroup", "testserver", "rule1", 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 (*FirewallRulesClient) Get

func (client *FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientGetOptions) (FirewallRulesClientGetResponse, error)

Get - Gets information about a server firewall rule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • firewallRuleName - The name of the server firewall rule.
  • options - FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/FirewallRuleGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewFirewallRulesClient().Get(ctx, "TestGroup", "testserver", "rule1", 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.FirewallRule = armmysql.FirewallRule{
	// 	Name: to.Ptr("rule1"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/firewallRules"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/firewallRules/rule1"),
	// 	Properties: &armmysql.FirewallRuleProperties{
	// 		EndIPAddress: to.Ptr("255.255.255.255"),
	// 		StartIPAddress: to.Ptr("0.0.0.0"),
	// 	},
	// }
}
Output:

func (*FirewallRulesClient) NewListByServerPager added in v0.5.0

func (client *FirewallRulesClient) NewListByServerPager(resourceGroupName string, serverName string, options *FirewallRulesClientListByServerOptions) *runtime.Pager[FirewallRulesClientListByServerResponse]

NewListByServerPager - List all the firewall rules in a given server.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - FirewallRulesClientListByServerOptions contains the optional parameters for the FirewallRulesClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/FirewallRuleListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewFirewallRulesClient().NewListByServerPager("TestGroup", "testserver", 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.FirewallRuleListResult = armmysql.FirewallRuleListResult{
		// 	Value: []*armmysql.FirewallRule{
		// 		{
		// 			Name: to.Ptr("rule1"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/firewallRules"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/firewallRules/rule1"),
		// 			Properties: &armmysql.FirewallRuleProperties{
		// 				EndIPAddress: to.Ptr("255.255.255.255"),
		// 				StartIPAddress: to.Ptr("0.0.0.0"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("rule2"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/firewallRules"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver/firewallRules/rule2"),
		// 			Properties: &armmysql.FirewallRuleProperties{
		// 				EndIPAddress: to.Ptr("255.0.0.0"),
		// 				StartIPAddress: to.Ptr("1.0.0.0"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type FirewallRulesClientBeginCreateOrUpdateOptions added in v0.3.0

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

FirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.BeginCreateOrUpdate method.

type FirewallRulesClientBeginDeleteOptions added in v0.3.0

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

FirewallRulesClientBeginDeleteOptions contains the optional parameters for the FirewallRulesClient.BeginDelete method.

type FirewallRulesClientCreateOrUpdateResponse added in v0.3.0

type FirewallRulesClientCreateOrUpdateResponse struct {
	// Represents a server firewall rule.
	FirewallRule
}

FirewallRulesClientCreateOrUpdateResponse contains the response from method FirewallRulesClient.BeginCreateOrUpdate.

type FirewallRulesClientDeleteResponse added in v0.3.0

type FirewallRulesClientDeleteResponse struct {
}

FirewallRulesClientDeleteResponse contains the response from method FirewallRulesClient.BeginDelete.

type FirewallRulesClientGetOptions added in v0.3.0

type FirewallRulesClientGetOptions struct {
}

FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method.

type FirewallRulesClientGetResponse added in v0.3.0

type FirewallRulesClientGetResponse struct {
	// Represents a server firewall rule.
	FirewallRule
}

FirewallRulesClientGetResponse contains the response from method FirewallRulesClient.Get.

type FirewallRulesClientListByServerOptions added in v0.3.0

type FirewallRulesClientListByServerOptions struct {
}

FirewallRulesClientListByServerOptions contains the optional parameters for the FirewallRulesClient.NewListByServerPager method.

type FirewallRulesClientListByServerResponse added in v0.3.0

type FirewallRulesClientListByServerResponse struct {
	// A list of firewall rules.
	FirewallRuleListResult
}

FirewallRulesClientListByServerResponse contains the response from method FirewallRulesClient.NewListByServerPager.

type GeoRedundantBackup

type GeoRedundantBackup string

GeoRedundantBackup - Enable Geo-redundant or not for server backup.

const (
	GeoRedundantBackupDisabled GeoRedundantBackup = "Disabled"
	GeoRedundantBackupEnabled  GeoRedundantBackup = "Enabled"
)

func PossibleGeoRedundantBackupValues

func PossibleGeoRedundantBackupValues() []GeoRedundantBackup

PossibleGeoRedundantBackupValues returns the possible values for the GeoRedundantBackup const type.

type IdentityType

type IdentityType string

IdentityType - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.

const (
	IdentityTypeSystemAssigned IdentityType = "SystemAssigned"
)

func PossibleIdentityTypeValues

func PossibleIdentityTypeValues() []IdentityType

PossibleIdentityTypeValues returns the possible values for the IdentityType const type.

type InfrastructureEncryption

type InfrastructureEncryption string

InfrastructureEncryption - Add a second layer of encryption for your data using new encryption algorithm which gives additional data protection. Value is optional but if passed in, must be 'Disabled' or 'Enabled'.

const (
	// InfrastructureEncryptionDisabled - Additional (2nd) layer of encryption for data at rest
	InfrastructureEncryptionDisabled InfrastructureEncryption = "Disabled"
	// InfrastructureEncryptionEnabled - Default value for single layer of encryption for data at rest.
	InfrastructureEncryptionEnabled InfrastructureEncryption = "Enabled"
)

func PossibleInfrastructureEncryptionValues

func PossibleInfrastructureEncryptionValues() []InfrastructureEncryption

PossibleInfrastructureEncryptionValues returns the possible values for the InfrastructureEncryption const type.

type LocationBasedPerformanceTierClient

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

LocationBasedPerformanceTierClient contains the methods for the LocationBasedPerformanceTier group. Don't use this type directly, use NewLocationBasedPerformanceTierClient() instead.

func NewLocationBasedPerformanceTierClient

func NewLocationBasedPerformanceTierClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationBasedPerformanceTierClient, error)

NewLocationBasedPerformanceTierClient creates a new instance of LocationBasedPerformanceTierClient with the specified values.

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

func (*LocationBasedPerformanceTierClient) NewListPager added in v0.5.0

NewListPager - List all the performance tiers at specified location in a given subscription.

Generated from API version 2017-12-01

  • locationName - The name of the location.
  • options - LocationBasedPerformanceTierClientListOptions contains the optional parameters for the LocationBasedPerformanceTierClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/PerformanceTiersListByLocation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLocationBasedPerformanceTierClient().NewListPager("WestUS", 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.PerformanceTierListResult = armmysql.PerformanceTierListResult{
		// 	Value: []*armmysql.PerformanceTierProperties{
		// 		{
		// 			ID: to.Ptr("Basic"),
		// 			MaxBackupRetentionDays: to.Ptr[int32](35),
		// 			MaxLargeStorageMB: to.Ptr[int32](0),
		// 			MaxStorageMB: to.Ptr[int32](2097152),
		// 			MinBackupRetentionDays: to.Ptr[int32](7),
		// 			MinLargeStorageMB: to.Ptr[int32](0),
		// 			MinStorageMB: to.Ptr[int32](5120),
		// 			ServiceLevelObjectives: []*armmysql.PerformanceTierServiceLevelObjectives{
		// 				{
		// 					Edition: to.Ptr("Basic"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("B_Gen5_1"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](1048576),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](1),
		// 				},
		// 				{
		// 					Edition: to.Ptr("Basic"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("B_Gen5_2"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](1048576),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](2),
		// 			}},
		// 		},
		// 		{
		// 			ID: to.Ptr("GeneralPurpose"),
		// 			MaxBackupRetentionDays: to.Ptr[int32](35),
		// 			MaxLargeStorageMB: to.Ptr[int32](16777216),
		// 			MaxStorageMB: to.Ptr[int32](16777216),
		// 			MinBackupRetentionDays: to.Ptr[int32](7),
		// 			MinLargeStorageMB: to.Ptr[int32](0),
		// 			MinStorageMB: to.Ptr[int32](5120),
		// 			ServiceLevelObjectives: []*armmysql.PerformanceTierServiceLevelObjectives{
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_2"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](2),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_4"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](4),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_8"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](8),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_16"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](16),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_32"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](32),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_64"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](32),
		// 			}},
		// 		},
		// 		{
		// 			ID: to.Ptr("MemoryOptimized"),
		// 			MaxBackupRetentionDays: to.Ptr[int32](35),
		// 			MaxLargeStorageMB: to.Ptr[int32](16777216),
		// 			MaxStorageMB: to.Ptr[int32](16777216),
		// 			MinBackupRetentionDays: to.Ptr[int32](7),
		// 			MinLargeStorageMB: to.Ptr[int32](0),
		// 			MinStorageMB: to.Ptr[int32](5120),
		// 			ServiceLevelObjectives: []*armmysql.PerformanceTierServiceLevelObjectives{
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_2"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](2),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_4"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](4),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_8"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](8),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_16"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](16),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_32"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](32),
		// 			}},
		// 	}},
		// }
	}
}
Output:

type LocationBasedPerformanceTierClientListOptions added in v0.3.0

type LocationBasedPerformanceTierClientListOptions struct {
}

LocationBasedPerformanceTierClientListOptions contains the optional parameters for the LocationBasedPerformanceTierClient.NewListPager method.

type LocationBasedPerformanceTierClientListResponse added in v0.3.0

type LocationBasedPerformanceTierClientListResponse struct {
	// A list of performance tiers.
	PerformanceTierListResult
}

LocationBasedPerformanceTierClientListResponse contains the response from method LocationBasedPerformanceTierClient.NewListPager.

type LocationBasedRecommendedActionSessionsOperationStatusClient

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

LocationBasedRecommendedActionSessionsOperationStatusClient contains the methods for the LocationBasedRecommendedActionSessionsOperationStatus group. Don't use this type directly, use NewLocationBasedRecommendedActionSessionsOperationStatusClient() instead.

func NewLocationBasedRecommendedActionSessionsOperationStatusClient

func NewLocationBasedRecommendedActionSessionsOperationStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationBasedRecommendedActionSessionsOperationStatusClient, error)

NewLocationBasedRecommendedActionSessionsOperationStatusClient creates a new instance of LocationBasedRecommendedActionSessionsOperationStatusClient with the specified values.

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

func (*LocationBasedRecommendedActionSessionsOperationStatusClient) Get

Get - Recommendation action session operation status. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • locationName - The name of the location.
  • operationID - The operation identifier.
  • options - LocationBasedRecommendedActionSessionsOperationStatusClientGetOptions contains the optional parameters for the LocationBasedRecommendedActionSessionsOperationStatusClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/RecommendedActionSessionOperationStatus.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLocationBasedRecommendedActionSessionsOperationStatusClient().Get(ctx, "WestUS", "aaaabbbb-cccc-dddd-0000-111122223333", 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.RecommendedActionSessionsOperationStatus = armmysql.RecommendedActionSessionsOperationStatus{
	// 	Name: to.Ptr("aaaabbbb-cccc-dddd-0000-111122223333"),
	// 	StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T17:15:00.000Z"); return t}()),
	// 	Status: to.Ptr("succeeded"),
	// }
}
Output:

type LocationBasedRecommendedActionSessionsOperationStatusClientGetOptions added in v0.3.0

type LocationBasedRecommendedActionSessionsOperationStatusClientGetOptions struct {
}

LocationBasedRecommendedActionSessionsOperationStatusClientGetOptions contains the optional parameters for the LocationBasedRecommendedActionSessionsOperationStatusClient.Get method.

type LocationBasedRecommendedActionSessionsOperationStatusClientGetResponse added in v0.3.0

type LocationBasedRecommendedActionSessionsOperationStatusClientGetResponse struct {
	// Recommendation action session operation status.
	RecommendedActionSessionsOperationStatus
}

LocationBasedRecommendedActionSessionsOperationStatusClientGetResponse contains the response from method LocationBasedRecommendedActionSessionsOperationStatusClient.Get.

type LocationBasedRecommendedActionSessionsResultClient

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

LocationBasedRecommendedActionSessionsResultClient contains the methods for the LocationBasedRecommendedActionSessionsResult group. Don't use this type directly, use NewLocationBasedRecommendedActionSessionsResultClient() instead.

func NewLocationBasedRecommendedActionSessionsResultClient

func NewLocationBasedRecommendedActionSessionsResultClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationBasedRecommendedActionSessionsResultClient, error)

NewLocationBasedRecommendedActionSessionsResultClient creates a new instance of LocationBasedRecommendedActionSessionsResultClient with the specified values.

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

func (*LocationBasedRecommendedActionSessionsResultClient) NewListPager added in v0.5.0

NewListPager - Recommendation action session operation result.

Generated from API version 2018-06-01

  • locationName - The name of the location.
  • operationID - The operation identifier.
  • options - LocationBasedRecommendedActionSessionsResultClientListOptions contains the optional parameters for the LocationBasedRecommendedActionSessionsResultClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/RecommendedActionSessionResult.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLocationBasedRecommendedActionSessionsResultClient().NewListPager("WestUS", "aaaabbbb-cccc-dddd-0000-111122223333", 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.RecommendationActionsResultList = armmysql.RecommendationActionsResultList{
		// 	Value: []*armmysql.RecommendationAction{
		// 		{
		// 			Name: to.Ptr("Index-1"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/advisors/recommendedActions"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-1"),
		// 			Properties: &armmysql.RecommendationActionProperties{
		// 				ActionID: to.Ptr[int32](1),
		// 				AdvisorName: to.Ptr("Index"),
		// 				CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T23:43:24.000Z"); return t}()),
		// 				ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-08T23:43:24.000Z"); return t}()),
		// 				Reason: to.Ptr("Column `movies_genres`.`movie_id` appear in Join On clause(s)."),
		// 				RecommendationType: to.Ptr("Add"),
		// 				SessionID: to.Ptr("c63c2114-e2a4-4c7a-98c1-85577d1a5d50"),
		// 				Details: map[string]*string{
		// 					"engine": to.Ptr("InnoDB"),
		// 					"indexColumns": to.Ptr("`movies_genres`.`movie_id`"),
		// 					"indexName": to.Ptr("idx_movie_id"),
		// 					"indexType": to.Ptr("BTREE"),
		// 					"parentTableName": to.Ptr("movies_genres"),
		// 					"queryIds": to.Ptr("779"),
		// 					"schemaName": to.Ptr("movies"),
		// 					"script": to.Ptr("alter table `movies`.`movies_genres` add index `idx_movie_id` (`movie_id`)"),
		// 					"tableName": to.Ptr("movies_genres"),
		// 				},
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Index-2"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/advisors/recommendedActions"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-2"),
		// 			Properties: &armmysql.RecommendationActionProperties{
		// 				ActionID: to.Ptr[int32](2),
		// 				AdvisorName: to.Ptr("Index"),
		// 				CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T23:43:24.000Z"); return t}()),
		// 				ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-08T23:43:24.000Z"); return t}()),
		// 				Reason: to.Ptr("Column `movies_genres`.`genre` appear in Group By clause(s)."),
		// 				RecommendationType: to.Ptr("Add"),
		// 				SessionID: to.Ptr("c63c2114-e2a4-4c7a-98c1-85577d1a5d50"),
		// 				Details: map[string]*string{
		// 					"engine": to.Ptr("InnoDB"),
		// 					"indexColumns": to.Ptr("`movies_genres`.`genre`"),
		// 					"indexName": to.Ptr("idx_genre"),
		// 					"indexType": to.Ptr("BTREE"),
		// 					"parentTableName": to.Ptr("movies_genres"),
		// 					"queryIds": to.Ptr("779"),
		// 					"schemaName": to.Ptr("movies"),
		// 					"script": to.Ptr("alter table `movies`.`movies_genres` add index `idx_genre` (`genre`)"),
		// 					"tableName": to.Ptr("movies_genres"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

type LocationBasedRecommendedActionSessionsResultClientListOptions added in v0.3.0

type LocationBasedRecommendedActionSessionsResultClientListOptions struct {
}

LocationBasedRecommendedActionSessionsResultClientListOptions contains the optional parameters for the LocationBasedRecommendedActionSessionsResultClient.NewListPager method.

type LocationBasedRecommendedActionSessionsResultClientListResponse added in v0.3.0

type LocationBasedRecommendedActionSessionsResultClientListResponse struct {
	// A list of recommendation actions.
	RecommendationActionsResultList
}

LocationBasedRecommendedActionSessionsResultClientListResponse contains the response from method LocationBasedRecommendedActionSessionsResultClient.NewListPager.

type LogFile

type LogFile struct {
	// The properties of the log file.
	Properties *LogFileProperties

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

LogFile - Represents a log file.

func (LogFile) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LogFile.

func (*LogFile) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LogFile.

type LogFileListResult

type LogFileListResult struct {
	// The list of log files.
	Value []*LogFile
}

LogFileListResult - A list of log files.

func (LogFileListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LogFileListResult.

func (*LogFileListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LogFileListResult.

type LogFileProperties

type LogFileProperties struct {
	// Size of the log file.
	SizeInKB *int64

	// Type of the log file.
	Type *string

	// The url to download the log file from.
	URL *string

	// READ-ONLY; Creation timestamp of the log file.
	CreatedTime *time.Time

	// READ-ONLY; Last modified timestamp of the log file.
	LastModifiedTime *time.Time
}

LogFileProperties - The properties of a log file.

func (LogFileProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LogFileProperties.

func (*LogFileProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type LogFileProperties.

type LogFilesClient

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

LogFilesClient contains the methods for the LogFiles group. Don't use this type directly, use NewLogFilesClient() instead.

func NewLogFilesClient

func NewLogFilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LogFilesClient, error)

NewLogFilesClient creates a new instance of LogFilesClient with the specified values.

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

func (*LogFilesClient) NewListByServerPager added in v0.5.0

func (client *LogFilesClient) NewListByServerPager(resourceGroupName string, serverName string, options *LogFilesClientListByServerOptions) *runtime.Pager[LogFilesClientListByServerResponse]

NewListByServerPager - List all the log files in a given server.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - LogFilesClientListByServerOptions contains the optional parameters for the LogFilesClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/LogFileListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLogFilesClient().NewListByServerPager("TestGroup", "testserver", 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.LogFileListResult = armmysql.LogFileListResult{
		// 	Value: []*armmysql.LogFile{
		// 		{
		// 			Name: to.Ptr("mysql-slow-mysqltestsvc1-2018022823.log"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/logFiles"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/logFiles/mysql-slow-mysqltestsvc1-2018022823.log"),
		// 			Properties: &armmysql.LogFileProperties{
		// 				Type: to.Ptr("slowlog"),
		// 				CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()),
		// 				LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T06:09:20.000Z"); return t}()),
		// 				SizeInKB: to.Ptr[int64](1),
		// 				URL: to.Ptr("https://wasd2prodwus1afse42.file.core.windows.net/833c99b2f36c47349e5554b903fe0440/serverlogs/mysql-slow-mysqltestsvc1-2018022823.log?sv=2015-04-05&sr=f&sig=D9Ga4N5Pa%2BPe5Bmjpvs7A0TPD%2FF7IZpk9e4KWR0jgpM%3D&se=2018-03-01T07%3A12%3A13Z&sp=r"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type LogFilesClientListByServerOptions added in v0.3.0

type LogFilesClientListByServerOptions struct {
}

LogFilesClientListByServerOptions contains the optional parameters for the LogFilesClient.NewListByServerPager method.

type LogFilesClientListByServerResponse added in v0.3.0

type LogFilesClientListByServerResponse struct {
	// A list of log files.
	LogFileListResult
}

LogFilesClientListByServerResponse contains the response from method LogFilesClient.NewListByServerPager.

type ManagementClient added in v0.3.0

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

ManagementClient contains the methods for the MySQLManagementClient group. Don't use this type directly, use NewManagementClient() instead.

func NewManagementClient added in v0.3.0

func NewManagementClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementClient, error)

NewManagementClient creates a new instance of ManagementClient with the specified values.

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

func (*ManagementClient) BeginCreateRecommendedActionSession added in v0.3.0

func (client *ManagementClient) BeginCreateRecommendedActionSession(ctx context.Context, resourceGroupName string, serverName string, advisorName string, databaseName string, options *ManagementClientBeginCreateRecommendedActionSessionOptions) (*runtime.Poller[ManagementClientCreateRecommendedActionSessionResponse], error)

BeginCreateRecommendedActionSession - Create recommendation action session for the advisor. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • advisorName - The advisor name for recommendation action.
  • databaseName - The name of the database.
  • options - ManagementClientBeginCreateRecommendedActionSessionOptions contains the optional parameters for the ManagementClient.BeginCreateRecommendedActionSession method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/RecommendedActionSessionCreate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewManagementClient().BeginCreateRecommendedActionSession(ctx, "testResourceGroupName", "testServerName", "Index", "someDatabaseName", 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 (*ManagementClient) ResetQueryPerformanceInsightData added in v0.3.0

func (client *ManagementClient) ResetQueryPerformanceInsightData(ctx context.Context, resourceGroupName string, serverName string, options *ManagementClientResetQueryPerformanceInsightDataOptions) (ManagementClientResetQueryPerformanceInsightDataResponse, error)

ResetQueryPerformanceInsightData - Reset data for Query Performance Insight. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ManagementClientResetQueryPerformanceInsightDataOptions contains the optional parameters for the ManagementClient.ResetQueryPerformanceInsightData method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/QueryPerformanceInsightResetData.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagementClient().ResetQueryPerformanceInsightData(ctx, "testResourceGroupName", "testServerName", 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.QueryPerformanceInsightResetDataResult = armmysql.QueryPerformanceInsightResetDataResult{
	// 	Message: to.Ptr("QPI reset data successful"),
	// 	Status: to.Ptr(armmysql.QueryPerformanceInsightResetDataResultStateSucceeded),
	// }
}
Output:

type ManagementClientBeginCreateRecommendedActionSessionOptions added in v0.3.0

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

ManagementClientBeginCreateRecommendedActionSessionOptions contains the optional parameters for the ManagementClient.BeginCreateRecommendedActionSession method.

type ManagementClientCreateRecommendedActionSessionResponse added in v0.3.0

type ManagementClientCreateRecommendedActionSessionResponse struct {
}

ManagementClientCreateRecommendedActionSessionResponse contains the response from method ManagementClient.BeginCreateRecommendedActionSession.

type ManagementClientResetQueryPerformanceInsightDataOptions added in v0.3.0

type ManagementClientResetQueryPerformanceInsightDataOptions struct {
}

ManagementClientResetQueryPerformanceInsightDataOptions contains the optional parameters for the ManagementClient.ResetQueryPerformanceInsightData method.

type ManagementClientResetQueryPerformanceInsightDataResponse added in v0.3.0

type ManagementClientResetQueryPerformanceInsightDataResponse struct {
	// Result of Query Performance Insight data reset.
	QueryPerformanceInsightResetDataResult
}

ManagementClientResetQueryPerformanceInsightDataResponse contains the response from method ManagementClient.ResetQueryPerformanceInsightData.

type MinimalTLSVersionEnum

type MinimalTLSVersionEnum string

MinimalTLSVersionEnum - Enforce a minimal Tls version for the server.

const (
	MinimalTLSVersionEnumTLS10                  MinimalTLSVersionEnum = "TLS1_0"
	MinimalTLSVersionEnumTLS11                  MinimalTLSVersionEnum = "TLS1_1"
	MinimalTLSVersionEnumTLS12                  MinimalTLSVersionEnum = "TLS1_2"
	MinimalTLSVersionEnumTLSEnforcementDisabled MinimalTLSVersionEnum = "TLSEnforcementDisabled"
)

func PossibleMinimalTLSVersionEnumValues

func PossibleMinimalTLSVersionEnumValues() []MinimalTLSVersionEnum

PossibleMinimalTLSVersionEnumValues returns the possible values for the MinimalTLSVersionEnum const type.

type NameAvailability

type NameAvailability struct {
	// Error Message.
	Message *string

	// Indicates whether the resource name is available.
	NameAvailable *bool

	// Reason for name being unavailable.
	Reason *string
}

NameAvailability - Represents a resource name availability.

func (NameAvailability) MarshalJSON added in v1.1.0

func (n NameAvailability) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NameAvailability.

func (*NameAvailability) UnmarshalJSON added in v1.1.0

func (n *NameAvailability) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailability.

type NameAvailabilityRequest

type NameAvailabilityRequest struct {
	// REQUIRED; Resource name to verify.
	Name *string

	// Resource type used for verification.
	Type *string
}

NameAvailabilityRequest - Request from client to check resource name availability.

func (NameAvailabilityRequest) MarshalJSON added in v1.1.0

func (n NameAvailabilityRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NameAvailabilityRequest.

func (*NameAvailabilityRequest) UnmarshalJSON added in v1.1.0

func (n *NameAvailabilityRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailabilityRequest.

type Operation

type Operation struct {
	// READ-ONLY; The localized display information for this particular operation or action.
	Display *OperationDisplay

	// READ-ONLY; The name of the operation being performed on this particular object.
	Name *string

	// READ-ONLY; The intended executor of the operation.
	Origin *OperationOrigin

	// READ-ONLY; Additional descriptions for the operation.
	Properties map[string]any
}

Operation - REST API operation definition.

func (Operation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// READ-ONLY; Operation description.
	Description *string

	// READ-ONLY; Localized friendly name for the operation.
	Operation *string

	// READ-ONLY; Operation resource provider name.
	Provider *string

	// READ-ONLY; Resource on which the operation is performed.
	Resource *string
}

OperationDisplay - Display metadata associated with the operation.

func (OperationDisplay) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// The list of resource provider operations.
	Value []*Operation
}

OperationListResult - A list of resource provider operations.

func (OperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationOrigin

type OperationOrigin string

OperationOrigin - The intended executor of the operation.

const (
	OperationOriginNotSpecified OperationOrigin = "NotSpecified"
	OperationOriginSystem       OperationOrigin = "system"
	OperationOriginUser         OperationOrigin = "user"
)

func PossibleOperationOriginValues

func PossibleOperationOriginValues() []OperationOrigin

PossibleOperationOriginValues returns the possible values for the OperationOrigin const type.

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) List

List - Lists all of the available REST API operations. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/OperationList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOperationsClient().List(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.OperationListResult = armmysql.OperationListResult{
	// 	Value: []*armmysql.Operation{
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforMySQL/locations/performanceTiers/read"),
	// 			Display: &armmysql.OperationDisplay{
	// 				Description: to.Ptr("Returns the list of Performance Tiers available."),
	// 				Operation: to.Ptr("List Performance Tiers"),
	// 				Provider: to.Ptr("Microsoft DB for MySQL"),
	// 				Resource: to.Ptr("Performance Tiers"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforMySQL/servers/firewallRules/read"),
	// 			Display: &armmysql.OperationDisplay{
	// 				Description: to.Ptr("Return the list of firewall rules for a server or gets the properties for the specified firewall rule."),
	// 				Operation: to.Ptr("List/Get Firewall Rules"),
	// 				Provider: to.Ptr("Microsoft DB for MySQL"),
	// 				Resource: to.Ptr("Firewall Rules"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforMySQL/servers/firewallRules/write"),
	// 			Display: &armmysql.OperationDisplay{
	// 				Description: to.Ptr("Creates a firewall rule with the specified parameters or update an existing rule."),
	// 				Operation: to.Ptr("Create/Update Firewall Rule"),
	// 				Provider: to.Ptr("Microsoft DB for MySQL"),
	// 				Resource: to.Ptr("Firewall Rules"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforMySQL/servers/firewallRules/delete"),
	// 			Display: &armmysql.OperationDisplay{
	// 				Description: to.Ptr("Deletes an existing firewall rule."),
	// 				Operation: to.Ptr("Delete Firewall Rule"),
	// 				Provider: to.Ptr("Microsoft DB for MySQL"),
	// 				Resource: to.Ptr("Firewall Rules"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforMySQL/servers/read"),
	// 			Display: &armmysql.OperationDisplay{
	// 				Description: to.Ptr("Return the list of servers or gets the properties for the specified server."),
	// 				Operation: to.Ptr("List/Get MySQL Servers"),
	// 				Provider: to.Ptr("Microsoft DB for MySQL"),
	// 				Resource: to.Ptr("MySQL Server"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforMySQL/servers/write"),
	// 			Display: &armmysql.OperationDisplay{
	// 				Description: to.Ptr("Creates a server with the specified parameters or update the properties or tags for the specified server."),
	// 				Operation: to.Ptr("Create/Update MySQL Server"),
	// 				Provider: to.Ptr("Microsoft DB for MySQL"),
	// 				Resource: to.Ptr("MySQL Server"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforMySQL/servers/delete"),
	// 			Display: &armmysql.OperationDisplay{
	// 				Description: to.Ptr("Deletes an existing server."),
	// 				Operation: to.Ptr("Delete MySQL Server"),
	// 				Provider: to.Ptr("Microsoft DB for MySQL"),
	// 				Resource: to.Ptr("MySQL Server"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforMySQL/performanceTiers/read"),
	// 			Display: &armmysql.OperationDisplay{
	// 				Description: to.Ptr("Returns the list of Performance Tiers available."),
	// 				Operation: to.Ptr("List Performance Tiers"),
	// 				Provider: to.Ptr("Microsoft DB for MySQL"),
	// 				Resource: to.Ptr("Performance Tiers"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforMySQL/servers/recoverableServers/read"),
	// 			Display: &armmysql.OperationDisplay{
	// 				Description: to.Ptr("Return the recoverable MySQL Server info"),
	// 				Operation: to.Ptr("Get Recoverable MySQL Server info"),
	// 				Provider: to.Ptr("Microsoft DB for MySQL"),
	// 				Resource: to.Ptr("Recoverable MySQL Server"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforMySQL/servers/providers/Microsoft.Insights/metricDefinitions/read"),
	// 			Display: &armmysql.OperationDisplay{
	// 				Description: to.Ptr("Return types of metrics that are available for databases"),
	// 				Operation: to.Ptr("Get database metric definitions"),
	// 				Provider: to.Ptr("Microsoft DB for MySQL"),
	// 				Resource: to.Ptr("Database Metric Definition"),
	// 			},
	// 			Properties: map[string]any{
	// 				"serviceSpecification": map[string]any{
	// 					"metricSpecifications":[]any{
	// 						map[string]any{
	// 							"name": "cpu_percent",
	// 							"aggregationType": "Average",
	// 							"displayDescription": "CPU percent",
	// 							"displayName": "CPU percent",
	// 							"fillGapWithZero": true,
	// 							"unit": "Percent",
	// 						},
	// 						map[string]any{
	// 							"name": "memory_percent",
	// 							"aggregationType": "Average",
	// 							"displayDescription": "Memory percent",
	// 							"displayName": "Memory percent",
	// 							"fillGapWithZero": true,
	// 							"unit": "Percent",
	// 						},
	// 						map[string]any{
	// 							"name": "io_consumption_percent",
	// 							"aggregationType": "Average",
	// 							"displayDescription": "IO percent",
	// 							"displayName": "IO percent",
	// 							"fillGapWithZero": true,
	// 							"unit": "Percent",
	// 						},
	// 						map[string]any{
	// 							"name": "storage_percent",
	// 							"aggregationType": "Average",
	// 							"displayDescription": "Storage percentage",
	// 							"displayName": "Storage percentage",
	// 							"unit": "Percent",
	// 						},
	// 						map[string]any{
	// 							"name": "storage_used",
	// 							"aggregationType": "Average",
	// 							"displayDescription": "Storage used",
	// 							"displayName": "Storage used",
	// 							"unit": "Bytes",
	// 						},
	// 						map[string]any{
	// 							"name": "storage_limit",
	// 							"aggregationType": "Average",
	// 							"displayDescription": "Storage limit",
	// 							"displayName": "Storage limit",
	// 							"unit": "Bytes",
	// 						},
	// 						map[string]any{
	// 							"name": "serverlog_storage_percent",
	// 							"aggregationType": "Average",
	// 							"displayDescription": "Server Log storage percent",
	// 							"displayName": "Server Log storage percent",
	// 							"unit": "Percent",
	// 						},
	// 						map[string]any{
	// 							"name": "serverlog_storage_usage",
	// 							"aggregationType": "Average",
	// 							"displayDescription": "Server Log storage used",
	// 							"displayName": "Server Log storage used",
	// 							"unit": "Bytes",
	// 						},
	// 						map[string]any{
	// 							"name": "serverlog_storage_limit",
	// 							"aggregationType": "Average",
	// 							"displayDescription": "Server Log storage limit",
	// 							"displayName": "Server Log storage limit",
	// 							"unit": "Bytes",
	// 						},
	// 						map[string]any{
	// 							"name": "active_connections",
	// 							"aggregationType": "Average",
	// 							"displayDescription": "Total active connections",
	// 							"displayName": "Total active connections",
	// 							"fillGapWithZero": true,
	// 							"unit": "Count",
	// 						},
	// 						map[string]any{
	// 							"name": "connections_failed",
	// 							"aggregationType": "Average",
	// 							"displayDescription": "Total failed connections",
	// 							"displayName": "Total failed connections",
	// 							"fillGapWithZero": true,
	// 							"unit": "Count",
	// 						},
	// 						map[string]any{
	// 							"name": "seconds_behind_master",
	// 							"aggregationType": "Average",
	// 							"displayDescription": "Replication lag in seconds",
	// 							"displayName": "Replication lag in seconds",
	// 							"fillGapWithZero": true,
	// 							"unit": "Count",
	// 						},
	// 					},
	// 				},
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforMySQL/servers/providers/Microsoft.Insights/diagnosticSettings/read"),
	// 			Display: &armmysql.OperationDisplay{
	// 				Description: to.Ptr("Gets the disagnostic setting for the resource"),
	// 				Operation: to.Ptr("Read diagnostic setting"),
	// 				Provider: to.Ptr("Microsoft DB for MySQL"),
	// 				Resource: to.Ptr("Database Metric Definition"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.DBforMySQL/servers/providers/Microsoft.Insights/diagnosticSettings/write"),
	// 			Display: &armmysql.OperationDisplay{
	// 				Description: to.Ptr("Creates or updates the diagnostic setting for the resource"),
	// 				Operation: to.Ptr("Write diagnostic setting"),
	// 				Provider: to.Ptr("Microsoft DB for MySQL"),
	// 				Resource: to.Ptr("Database Metric Definition"),
	// 			},
	// 	}},
	// }
}
Output:

type OperationsClientListOptions added in v0.3.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.3.0

type OperationsClientListResponse struct {
	// A list of resource provider operations.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type PerformanceTierListResult

type PerformanceTierListResult struct {
	// The list of performance tiers
	Value []*PerformanceTierProperties
}

PerformanceTierListResult - A list of performance tiers.

func (PerformanceTierListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PerformanceTierListResult.

func (*PerformanceTierListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PerformanceTierListResult.

type PerformanceTierProperties

type PerformanceTierProperties struct {
	// ID of the performance tier.
	ID *string

	// Maximum Backup retention in days for the performance tier edition
	MaxBackupRetentionDays *int32

	// Max storage allowed for a server.
	MaxLargeStorageMB *int32

	// Max storage allowed for a server.
	MaxStorageMB *int32

	// Minimum Backup retention in days for the performance tier edition
	MinBackupRetentionDays *int32

	// Max storage allowed for a server.
	MinLargeStorageMB *int32

	// Max storage allowed for a server.
	MinStorageMB *int32

	// Service level objectives associated with the performance tier
	ServiceLevelObjectives []*PerformanceTierServiceLevelObjectives
}

PerformanceTierProperties - Performance tier properties

func (PerformanceTierProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PerformanceTierProperties.

func (*PerformanceTierProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PerformanceTierProperties.

type PerformanceTierServiceLevelObjectives

type PerformanceTierServiceLevelObjectives struct {
	// Edition of the performance tier.
	Edition *string

	// Hardware generation associated with the service level objective
	HardwareGeneration *string

	// ID for the service level objective.
	ID *string

	// Maximum Backup retention in days for the performance tier edition
	MaxBackupRetentionDays *int32

	// Max storage allowed for a server.
	MaxStorageMB *int32

	// Minimum Backup retention in days for the performance tier edition
	MinBackupRetentionDays *int32

	// Max storage allowed for a server.
	MinStorageMB *int32

	// vCore associated with the service level objective
	VCore *int32
}

PerformanceTierServiceLevelObjectives - Service level objectives for performance tier.

func (PerformanceTierServiceLevelObjectives) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type PerformanceTierServiceLevelObjectives.

func (*PerformanceTierServiceLevelObjectives) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PerformanceTierServiceLevelObjectives.

type PrivateEndpointConnection

type PrivateEndpointConnection struct {
	// Resource properties.
	Properties *PrivateEndpointConnectionProperties

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

PrivateEndpointConnection - A private endpoint connection

func (PrivateEndpointConnection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection.

func (*PrivateEndpointConnection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection.

type PrivateEndpointConnectionListResult

type PrivateEndpointConnectionListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string

	// READ-ONLY; Array of results.
	Value []*PrivateEndpointConnection
}

PrivateEndpointConnectionListResult - A list of private endpoint connections.

func (PrivateEndpointConnectionListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult.

func (*PrivateEndpointConnectionListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult.

type PrivateEndpointConnectionProperties

type PrivateEndpointConnectionProperties struct {
	// Private endpoint which the connection belongs to.
	PrivateEndpoint *PrivateEndpointProperty

	// Connection state of the private endpoint connection.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty

	// READ-ONLY; State of the private endpoint connection.
	ProvisioningState *string
}

PrivateEndpointConnectionProperties - Properties of a private endpoint connection.

func (PrivateEndpointConnectionProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties.

func (*PrivateEndpointConnectionProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties.

type PrivateEndpointConnectionsClient

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

PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group. Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead.

func NewPrivateEndpointConnectionsClient

func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error)

NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values.

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

func (*PrivateEndpointConnectionsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/PrivateEndpointConnectionUpdate.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "Default", "test-svr", "private-endpoint-connection-name", armmysql.PrivateEndpointConnection{
		Properties: &armmysql.PrivateEndpointConnectionProperties{
			PrivateLinkServiceConnectionState: &armmysql.PrivateLinkServiceConnectionStateProperty{
				Description: to.Ptr("Approved by johndoe@contoso.com"),
				Status:      to.Ptr("Approved"),
			},
		},
	}, 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.PrivateEndpointConnection = armmysql.PrivateEndpointConnection{
	// 	Name: to.Ptr("private-endpoint-connection-name"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"),
	// 	Properties: &armmysql.PrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armmysql.PrivateEndpointProperty{
	// 			ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armmysql.PrivateLinkServiceConnectionStateProperty{
	// 			Description: to.Ptr("Approved by johndoe@contoso.com"),
	// 			ActionsRequired: to.Ptr("None"),
	// 			Status: to.Ptr("Approved"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionsClient) BeginDelete

func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)

BeginDelete - Deletes a private endpoint connection with a given name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/PrivateEndpointConnectionDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "Default", "test-svr", "private-endpoint-connection-name", 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 (*PrivateEndpointConnectionsClient) BeginUpdateTags

func (client *PrivateEndpointConnectionsClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters TagsObject, options *PrivateEndpointConnectionsClientBeginUpdateTagsOptions) (*runtime.Poller[PrivateEndpointConnectionsClientUpdateTagsResponse], error)

BeginUpdateTags - Updates private endpoint connection with the specified tags. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • parameters - Parameters supplied to the Update private endpoint connection Tags operation.
  • options - PrivateEndpointConnectionsClientBeginUpdateTagsOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginUpdateTags method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/PrivateEndpointConnectionUpdateTags.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginUpdateTags(ctx, "Default", "test-svr", "private-endpoint-connection-name", armmysql.TagsObject{
		Tags: map[string]*string{
			"key1": to.Ptr("val1"),
			"key2": to.Ptr("val2"),
		},
	}, 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.PrivateEndpointConnection = armmysql.PrivateEndpointConnection{
	// 	Name: to.Ptr("private-endpoint-connection-name"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"),
	// 	Properties: &armmysql.PrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armmysql.PrivateEndpointProperty{
	// 			ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armmysql.PrivateLinkServiceConnectionStateProperty{
	// 			Description: to.Ptr("Approved by johndoe@contoso.com"),
	// 			ActionsRequired: to.Ptr("None"),
	// 			Status: to.Ptr("Approved"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionsClient) Get

func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error)

Get - Gets a private endpoint connection. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • privateEndpointConnectionName - The name of the private endpoint connection.
  • options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/PrivateEndpointConnectionGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "Default", "test-svr", "private-endpoint-connection-name", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.PrivateEndpointConnection = armmysql.PrivateEndpointConnection{
	// 	Name: to.Ptr("private-endpoint-connection-name"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"),
	// 	Properties: &armmysql.PrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armmysql.PrivateEndpointProperty{
	// 			ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armmysql.PrivateLinkServiceConnectionStateProperty{
	// 			Description: to.Ptr("Auto-approved"),
	// 			ActionsRequired: to.Ptr("None"),
	// 			Status: to.Ptr("Approved"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionsClient) NewListByServerPager added in v0.5.0

NewListByServerPager - Gets all private endpoint connections on a server.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - PrivateEndpointConnectionsClientListByServerOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/PrivateEndpointConnectionList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByServerPager("Default", "test-svr", 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.PrivateEndpointConnectionListResult = armmysql.PrivateEndpointConnectionListResult{
		// 	Value: []*armmysql.PrivateEndpointConnection{
		// 		{
		// 			Name: to.Ptr("private-endpoint-connection-name"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/privateEndpointConnections"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"),
		// 			Properties: &armmysql.PrivateEndpointConnectionProperties{
		// 				PrivateEndpoint: &armmysql.PrivateEndpointProperty{
		// 					ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
		// 				},
		// 				PrivateLinkServiceConnectionState: &armmysql.PrivateLinkServiceConnectionStateProperty{
		// 					Description: to.Ptr("Auto-approved"),
		// 					ActionsRequired: to.Ptr("None"),
		// 					Status: to.Ptr("Approved"),
		// 				},
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("private-endpoint-connection-name-2"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/privateEndpointConnections"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"),
		// 			Properties: &armmysql.PrivateEndpointConnectionProperties{
		// 				PrivateEndpoint: &armmysql.PrivateEndpointProperty{
		// 					ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"),
		// 				},
		// 				PrivateLinkServiceConnectionState: &armmysql.PrivateLinkServiceConnectionStateProperty{
		// 					Description: to.Ptr("Auto-approved"),
		// 					ActionsRequired: to.Ptr("None"),
		// 					Status: to.Ptr("Approved"),
		// 				},
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions added in v0.3.0

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

PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate method.

type PrivateEndpointConnectionsClientBeginDeleteOptions added in v0.3.0

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

PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete method.

type PrivateEndpointConnectionsClientBeginUpdateTagsOptions added in v0.3.0

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

PrivateEndpointConnectionsClientBeginUpdateTagsOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginUpdateTags method.

type PrivateEndpointConnectionsClientCreateOrUpdateResponse added in v0.3.0

type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct {
	// A private endpoint connection
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate.

type PrivateEndpointConnectionsClientDeleteResponse added in v0.3.0

type PrivateEndpointConnectionsClientDeleteResponse struct {
}

PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete.

type PrivateEndpointConnectionsClientGetOptions added in v0.3.0

type PrivateEndpointConnectionsClientGetOptions struct {
}

PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.

type PrivateEndpointConnectionsClientGetResponse added in v0.3.0

type PrivateEndpointConnectionsClientGetResponse struct {
	// A private endpoint connection
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get.

type PrivateEndpointConnectionsClientListByServerOptions added in v0.3.0

type PrivateEndpointConnectionsClientListByServerOptions struct {
}

PrivateEndpointConnectionsClientListByServerOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServerPager method.

type PrivateEndpointConnectionsClientListByServerResponse added in v0.3.0

type PrivateEndpointConnectionsClientListByServerResponse struct {
	// A list of private endpoint connections.
	PrivateEndpointConnectionListResult
}

PrivateEndpointConnectionsClientListByServerResponse contains the response from method PrivateEndpointConnectionsClient.NewListByServerPager.

type PrivateEndpointConnectionsClientUpdateTagsResponse added in v0.3.0

type PrivateEndpointConnectionsClientUpdateTagsResponse struct {
	// A private endpoint connection
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientUpdateTagsResponse contains the response from method PrivateEndpointConnectionsClient.BeginUpdateTags.

type PrivateEndpointProperty

type PrivateEndpointProperty struct {
	// Resource id of the private endpoint.
	ID *string
}

func (PrivateEndpointProperty) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointProperty.

func (*PrivateEndpointProperty) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointProperty.

type PrivateEndpointProvisioningState

type PrivateEndpointProvisioningState string

PrivateEndpointProvisioningState - State of the private endpoint connection.

const (
	PrivateEndpointProvisioningStateApproving PrivateEndpointProvisioningState = "Approving"
	PrivateEndpointProvisioningStateDropping  PrivateEndpointProvisioningState = "Dropping"
	PrivateEndpointProvisioningStateFailed    PrivateEndpointProvisioningState = "Failed"
	PrivateEndpointProvisioningStateReady     PrivateEndpointProvisioningState = "Ready"
	PrivateEndpointProvisioningStateRejecting PrivateEndpointProvisioningState = "Rejecting"
)

func PossiblePrivateEndpointProvisioningStateValues

func PossiblePrivateEndpointProvisioningStateValues() []PrivateEndpointProvisioningState

PossiblePrivateEndpointProvisioningStateValues returns the possible values for the PrivateEndpointProvisioningState const type.

type PrivateLinkResource

type PrivateLinkResource struct {
	// 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; The private link resource group id.
	Properties *PrivateLinkResourceProperties

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

PrivateLinkResource - A private link resource

func (PrivateLinkResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource.

func (*PrivateLinkResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource.

type PrivateLinkResourceListResult

type PrivateLinkResourceListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string

	// READ-ONLY; Array of results.
	Value []*PrivateLinkResource
}

PrivateLinkResourceListResult - A list of private link resources

func (PrivateLinkResourceListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult.

func (*PrivateLinkResourceListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult.

type PrivateLinkResourceProperties

type PrivateLinkResourceProperties struct {
	// READ-ONLY; The private link resource group id.
	GroupID *string

	// READ-ONLY; The private link resource required member names.
	RequiredMembers []*string
}

PrivateLinkResourceProperties - Properties of a private link resource.

func (PrivateLinkResourceProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties.

func (*PrivateLinkResourceProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties.

type PrivateLinkResourcesClient

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

PrivateLinkResourcesClient contains the methods for the PrivateLinkResources group. Don't use this type directly, use NewPrivateLinkResourcesClient() instead.

func NewPrivateLinkResourcesClient

func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error)

NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values.

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

func (*PrivateLinkResourcesClient) Get

Get - Gets a private link resource for MySQL server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • groupName - The name of the private link resource.
  • options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/PrivateLinkResourcesGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "Default", "test-svr", "plr", 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.PrivateLinkResource = armmysql.PrivateLinkResource{
	// 	Name: to.Ptr("plr"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/privateLinkResources"),
	// 	ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateLinkResources/plr"),
	// 	Properties: &armmysql.PrivateLinkResourceProperties{
	// 		GroupID: to.Ptr("mysqlServer"),
	// 		RequiredMembers: []*string{
	// 			to.Ptr("mysqlServer")},
	// 		},
	// 	}
}
Output:

func (*PrivateLinkResourcesClient) NewListByServerPager added in v0.5.0

NewListByServerPager - Gets the private link resources for MySQL server.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - PrivateLinkResourcesClientListByServerOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/PrivateLinkResourcesList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPrivateLinkResourcesClient().NewListByServerPager("Default", "test-svr", 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.PrivateLinkResourceListResult = armmysql.PrivateLinkResourceListResult{
		// 	Value: []*armmysql.PrivateLinkResource{
		// 		{
		// 			Name: to.Ptr("plr"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/privateLinkResources"),
		// 			ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.DBforMySQL/servers/test-svr/privateLinkResources/plr"),
		// 			Properties: &armmysql.PrivateLinkResourceProperties{
		// 				GroupID: to.Ptr("mysqlServer"),
		// 				RequiredMembers: []*string{
		// 					to.Ptr("mysqlServer")},
		// 				},
		// 		}},
		// 	}
	}
}
Output:

type PrivateLinkResourcesClientGetOptions added in v0.3.0

type PrivateLinkResourcesClientGetOptions struct {
}

PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method.

type PrivateLinkResourcesClientGetResponse added in v0.3.0

type PrivateLinkResourcesClientGetResponse struct {
	// A private link resource
	PrivateLinkResource
}

PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get.

type PrivateLinkResourcesClientListByServerOptions added in v0.3.0

type PrivateLinkResourcesClientListByServerOptions struct {
}

PrivateLinkResourcesClientListByServerOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByServerPager method.

type PrivateLinkResourcesClientListByServerResponse added in v0.3.0

type PrivateLinkResourcesClientListByServerResponse struct {
	// A list of private link resources
	PrivateLinkResourceListResult
}

PrivateLinkResourcesClientListByServerResponse contains the response from method PrivateLinkResourcesClient.NewListByServerPager.

type PrivateLinkServiceConnectionStateActionsRequire

type PrivateLinkServiceConnectionStateActionsRequire string

PrivateLinkServiceConnectionStateActionsRequire - The actions required for private link service connection.

const (
	PrivateLinkServiceConnectionStateActionsRequireNone PrivateLinkServiceConnectionStateActionsRequire = "None"
)

func PossiblePrivateLinkServiceConnectionStateActionsRequireValues

func PossiblePrivateLinkServiceConnectionStateActionsRequireValues() []PrivateLinkServiceConnectionStateActionsRequire

PossiblePrivateLinkServiceConnectionStateActionsRequireValues returns the possible values for the PrivateLinkServiceConnectionStateActionsRequire const type.

type PrivateLinkServiceConnectionStateProperty

type PrivateLinkServiceConnectionStateProperty struct {
	// REQUIRED; The private link service connection description.
	Description *string

	// REQUIRED; The private link service connection status.
	Status *string

	// READ-ONLY; The actions required for private link service connection.
	ActionsRequired *string
}

func (PrivateLinkServiceConnectionStateProperty) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionStateProperty.

func (*PrivateLinkServiceConnectionStateProperty) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionStateProperty.

type PrivateLinkServiceConnectionStateStatus

type PrivateLinkServiceConnectionStateStatus string

PrivateLinkServiceConnectionStateStatus - The private link service connection status.

const (
	PrivateLinkServiceConnectionStateStatusApproved     PrivateLinkServiceConnectionStateStatus = "Approved"
	PrivateLinkServiceConnectionStateStatusDisconnected PrivateLinkServiceConnectionStateStatus = "Disconnected"
	PrivateLinkServiceConnectionStateStatusPending      PrivateLinkServiceConnectionStateStatus = "Pending"
	PrivateLinkServiceConnectionStateStatusRejected     PrivateLinkServiceConnectionStateStatus = "Rejected"
)

func PossiblePrivateLinkServiceConnectionStateStatusValues

func PossiblePrivateLinkServiceConnectionStateStatusValues() []PrivateLinkServiceConnectionStateStatus

PossiblePrivateLinkServiceConnectionStateStatusValues returns the possible values for the PrivateLinkServiceConnectionStateStatus const type.

type ProxyResource

type ProxyResource struct {
	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location

func (ProxyResource) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ProxyResource.

func (*ProxyResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.

type PublicNetworkAccessEnum

type PublicNetworkAccessEnum string

PublicNetworkAccessEnum - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'

const (
	PublicNetworkAccessEnumDisabled PublicNetworkAccessEnum = "Disabled"
	PublicNetworkAccessEnumEnabled  PublicNetworkAccessEnum = "Enabled"
)

func PossiblePublicNetworkAccessEnumValues

func PossiblePublicNetworkAccessEnumValues() []PublicNetworkAccessEnum

PossiblePublicNetworkAccessEnumValues returns the possible values for the PublicNetworkAccessEnum const type.

type QueryPerformanceInsightResetDataResult

type QueryPerformanceInsightResetDataResult struct {
	// operation message.
	Message *string

	// Indicates result of the operation.
	Status *QueryPerformanceInsightResetDataResultState
}

QueryPerformanceInsightResetDataResult - Result of Query Performance Insight data reset.

func (QueryPerformanceInsightResetDataResult) MarshalJSON added in v1.1.0

func (q QueryPerformanceInsightResetDataResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryPerformanceInsightResetDataResult.

func (*QueryPerformanceInsightResetDataResult) UnmarshalJSON added in v1.1.0

func (q *QueryPerformanceInsightResetDataResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryPerformanceInsightResetDataResult.

type QueryPerformanceInsightResetDataResultState

type QueryPerformanceInsightResetDataResultState string

QueryPerformanceInsightResetDataResultState - Indicates result of the operation.

const (
	QueryPerformanceInsightResetDataResultStateFailed    QueryPerformanceInsightResetDataResultState = "Failed"
	QueryPerformanceInsightResetDataResultStateSucceeded QueryPerformanceInsightResetDataResultState = "Succeeded"
)

func PossibleQueryPerformanceInsightResetDataResultStateValues

func PossibleQueryPerformanceInsightResetDataResultStateValues() []QueryPerformanceInsightResetDataResultState

PossibleQueryPerformanceInsightResetDataResultStateValues returns the possible values for the QueryPerformanceInsightResetDataResultState const type.

type QueryStatistic

type QueryStatistic struct {
	// The properties of a query statistic.
	Properties *QueryStatisticProperties

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

QueryStatistic - Represents a Query Statistic.

func (QueryStatistic) MarshalJSON

func (q QueryStatistic) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryStatistic.

func (*QueryStatistic) UnmarshalJSON added in v1.1.0

func (q *QueryStatistic) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryStatistic.

type QueryStatisticProperties

type QueryStatisticProperties struct {
	// Aggregation function name.
	AggregationFunction *string

	// The list of database names.
	DatabaseNames []*string

	// Observation end time.
	EndTime *time.Time

	// Metric display name.
	MetricDisplayName *string

	// Metric name.
	MetricName *string

	// Metric value.
	MetricValue *float64

	// Metric value unit.
	MetricValueUnit *string

	// Number of query executions in this time interval.
	QueryExecutionCount *int64

	// Database query identifier.
	QueryID *string

	// Observation start time.
	StartTime *time.Time
}

QueryStatisticProperties - The properties of a query statistic.

func (QueryStatisticProperties) MarshalJSON

func (q QueryStatisticProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryStatisticProperties.

func (*QueryStatisticProperties) UnmarshalJSON

func (q *QueryStatisticProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryStatisticProperties.

type QueryText

type QueryText struct {
	// The properties of a query text.
	Properties *QueryTextProperties

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

QueryText - Represents a Query Text.

func (QueryText) MarshalJSON

func (q QueryText) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryText.

func (*QueryText) UnmarshalJSON added in v1.1.0

func (q *QueryText) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryText.

type QueryTextProperties

type QueryTextProperties struct {
	// Query identifier unique to the server.
	QueryID *string

	// Query text.
	QueryText *string
}

QueryTextProperties - The properties of a query text.

func (QueryTextProperties) MarshalJSON added in v1.1.0

func (q QueryTextProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryTextProperties.

func (*QueryTextProperties) UnmarshalJSON added in v1.1.0

func (q *QueryTextProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryTextProperties.

type QueryTextsClient

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

QueryTextsClient contains the methods for the QueryTexts group. Don't use this type directly, use NewQueryTextsClient() instead.

func NewQueryTextsClient

func NewQueryTextsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QueryTextsClient, error)

NewQueryTextsClient creates a new instance of QueryTextsClient with the specified values.

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

func (*QueryTextsClient) Get

func (client *QueryTextsClient) Get(ctx context.Context, resourceGroupName string, serverName string, queryID string, options *QueryTextsClientGetOptions) (QueryTextsClientGetResponse, error)

Get - Retrieve the Query-Store query texts for the queryId. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • queryID - The Query-Store query identifier.
  • options - QueryTextsClientGetOptions contains the optional parameters for the QueryTextsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/QueryTextsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewQueryTextsClient().Get(ctx, "testResourceGroupName", "testServerName", "1", 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.QueryText = armmysql.QueryText{
	// 	Name: to.Ptr("1"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/queryTexts"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/queryTexts/1"),
	// 	Properties: &armmysql.QueryTextProperties{
	// 		QueryID: to.Ptr("1"),
	// 		QueryText: to.Ptr("UPDATE `performance_schema`.`setup_instruments` SET `ENABLED` = ? , `TIMED` = ? WHERE NAME = ?"),
	// 	},
	// }
}
Output:

func (*QueryTextsClient) NewListByServerPager added in v0.5.0

func (client *QueryTextsClient) NewListByServerPager(resourceGroupName string, serverName string, queryIDs []string, options *QueryTextsClientListByServerOptions) *runtime.Pager[QueryTextsClientListByServerResponse]

NewListByServerPager - Retrieve the Query-Store query texts for specified queryIds.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • queryIDs - The query identifiers
  • options - QueryTextsClientListByServerOptions contains the optional parameters for the QueryTextsClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/QueryTextsListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewQueryTextsClient().NewListByServerPager("testResourceGroupName", "testServerName", []string{
		"1",
		"2"}, 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.QueryTextsResultList = armmysql.QueryTextsResultList{
		// 	Value: []*armmysql.QueryText{
		// 		{
		// 			Name: to.Ptr("1"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/queryTexts"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/queryTexts/1"),
		// 			Properties: &armmysql.QueryTextProperties{
		// 				QueryID: to.Ptr("1"),
		// 				QueryText: to.Ptr("UPDATE `performance_schema`.`setup_instruments` SET `ENABLED` = ? , `TIMED` = ? WHERE NAME = ?"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("2"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/queryTexts"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/queryTexts/2"),
		// 			Properties: &armmysql.QueryTextProperties{
		// 				QueryID: to.Ptr("2"),
		// 				QueryText: to.Ptr("UPDATE `performance_schema`.`setup_instruments` SET `ENABLED` = ? , `TIMED` = ? WHERE NAME LIKE ?"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type QueryTextsClientGetOptions added in v0.3.0

type QueryTextsClientGetOptions struct {
}

QueryTextsClientGetOptions contains the optional parameters for the QueryTextsClient.Get method.

type QueryTextsClientGetResponse added in v0.3.0

type QueryTextsClientGetResponse struct {
	// Represents a Query Text.
	QueryText
}

QueryTextsClientGetResponse contains the response from method QueryTextsClient.Get.

type QueryTextsClientListByServerOptions added in v0.3.0

type QueryTextsClientListByServerOptions struct {
}

QueryTextsClientListByServerOptions contains the optional parameters for the QueryTextsClient.NewListByServerPager method.

type QueryTextsClientListByServerResponse added in v0.3.0

type QueryTextsClientListByServerResponse struct {
	// A list of query texts.
	QueryTextsResultList
}

QueryTextsClientListByServerResponse contains the response from method QueryTextsClient.NewListByServerPager.

type QueryTextsResultList

type QueryTextsResultList struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string

	// READ-ONLY; The list of query texts.
	Value []*QueryText
}

QueryTextsResultList - A list of query texts.

func (QueryTextsResultList) MarshalJSON

func (q QueryTextsResultList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryTextsResultList.

func (*QueryTextsResultList) UnmarshalJSON added in v1.1.0

func (q *QueryTextsResultList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryTextsResultList.

type RecommendationAction

type RecommendationAction struct {
	// The properties of a recommendation action.
	Properties *RecommendationActionProperties

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

RecommendationAction - Represents a Recommendation Action.

func (RecommendationAction) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RecommendationAction.

func (*RecommendationAction) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type RecommendationAction.

type RecommendationActionProperties

type RecommendationActionProperties struct {
	// Recommendation action identifier.
	ActionID *int32

	// Advisor name.
	AdvisorName *string

	// Recommendation action creation time.
	CreatedTime *time.Time

	// Recommendation action details.
	Details map[string]*string

	// Recommendation action expiration time.
	ExpirationTime *time.Time

	// Recommendation action reason.
	Reason *string

	// Recommendation action type.
	RecommendationType *string

	// Recommendation action session identifier.
	SessionID *string
}

RecommendationActionProperties - The properties of a recommendation action.

func (RecommendationActionProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RecommendationActionProperties.

func (*RecommendationActionProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RecommendationActionProperties.

type RecommendationActionsResultList

type RecommendationActionsResultList struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string

	// READ-ONLY; The list of recommendation action advisors.
	Value []*RecommendationAction
}

RecommendationActionsResultList - A list of recommendation actions.

func (RecommendationActionsResultList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RecommendationActionsResultList.

func (*RecommendationActionsResultList) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type RecommendationActionsResultList.

type RecommendedActionSessionsOperationStatus

type RecommendedActionSessionsOperationStatus struct {
	// Operation identifier.
	Name *string

	// Operation start time.
	StartTime *time.Time

	// Operation status.
	Status *string
}

RecommendedActionSessionsOperationStatus - Recommendation action session operation status.

func (RecommendedActionSessionsOperationStatus) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type RecommendedActionSessionsOperationStatus.

func (*RecommendedActionSessionsOperationStatus) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionSessionsOperationStatus.

type RecommendedActionsClient

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

RecommendedActionsClient contains the methods for the RecommendedActions group. Don't use this type directly, use NewRecommendedActionsClient() instead.

func NewRecommendedActionsClient

func NewRecommendedActionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RecommendedActionsClient, error)

NewRecommendedActionsClient creates a new instance of RecommendedActionsClient with the specified values.

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

func (*RecommendedActionsClient) Get

func (client *RecommendedActionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, advisorName string, recommendedActionName string, options *RecommendedActionsClientGetOptions) (RecommendedActionsClientGetResponse, error)

Get - Retrieve recommended actions from the advisor. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • advisorName - The advisor name for recommendation action.
  • recommendedActionName - The recommended action name.
  • options - RecommendedActionsClientGetOptions contains the optional parameters for the RecommendedActionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/RecommendedActionsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecommendedActionsClient().Get(ctx, "testResourceGroupName", "testServerName", "Index", "Index-1", 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.RecommendationAction = armmysql.RecommendationAction{
	// 	Name: to.Ptr("Index-1"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/advisors/recommendedActions"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-1"),
	// 	Properties: &armmysql.RecommendationActionProperties{
	// 		ActionID: to.Ptr[int32](1),
	// 		AdvisorName: to.Ptr("Index"),
	// 		CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T23:43:24.000Z"); return t}()),
	// 		ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-08T23:43:24.000Z"); return t}()),
	// 		Reason: to.Ptr("Column `movies_genres`.`movie_id` appear in Join On clause(s)."),
	// 		RecommendationType: to.Ptr("Add"),
	// 		SessionID: to.Ptr("c63c2114-e2a4-4c7a-98c1-85577d1a5d50"),
	// 		Details: map[string]*string{
	// 			"engine": to.Ptr("InnoDB"),
	// 			"indexColumns": to.Ptr("`movies_genres`.`movie_id`"),
	// 			"indexName": to.Ptr("idx_movie_id"),
	// 			"indexType": to.Ptr("BTREE"),
	// 			"parentTableName": to.Ptr("movies_genres"),
	// 			"queryIds": to.Ptr("779"),
	// 			"schemaName": to.Ptr("movies"),
	// 			"script": to.Ptr("alter table `movies`.`movies_genres` add index `idx_movie_id` (`movie_id`)"),
	// 			"tableName": to.Ptr("movies_genres"),
	// 		},
	// 	},
	// }
}
Output:

func (*RecommendedActionsClient) NewListByServerPager added in v0.5.0

func (client *RecommendedActionsClient) NewListByServerPager(resourceGroupName string, serverName string, advisorName string, options *RecommendedActionsClientListByServerOptions) *runtime.Pager[RecommendedActionsClientListByServerResponse]

NewListByServerPager - Retrieve recommended actions from the advisor.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • advisorName - The advisor name for recommendation action.
  • options - RecommendedActionsClientListByServerOptions contains the optional parameters for the RecommendedActionsClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/RecommendedActionsListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRecommendedActionsClient().NewListByServerPager("testResourceGroupName", "testServerName", "Index", &armmysql.RecommendedActionsClientListByServerOptions{SessionID: 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.RecommendationActionsResultList = armmysql.RecommendationActionsResultList{
		// 	Value: []*armmysql.RecommendationAction{
		// 		{
		// 			Name: to.Ptr("Index-1"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/advisors/recommendedActions"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-1"),
		// 			Properties: &armmysql.RecommendationActionProperties{
		// 				ActionID: to.Ptr[int32](1),
		// 				AdvisorName: to.Ptr("Index"),
		// 				CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T23:43:24.000Z"); return t}()),
		// 				ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-08T23:43:24.000Z"); return t}()),
		// 				Reason: to.Ptr("Column `movies_genres`.`movie_id` appear in Join On clause(s)."),
		// 				RecommendationType: to.Ptr("Add"),
		// 				SessionID: to.Ptr("c63c2114-e2a4-4c7a-98c1-85577d1a5d50"),
		// 				Details: map[string]*string{
		// 					"engine": to.Ptr("InnoDB"),
		// 					"indexColumns": to.Ptr("`movies_genres`.`movie_id`"),
		// 					"indexName": to.Ptr("idx_movie_id"),
		// 					"indexType": to.Ptr("BTREE"),
		// 					"parentTableName": to.Ptr("movies_genres"),
		// 					"queryIds": to.Ptr("779"),
		// 					"schemaName": to.Ptr("movies"),
		// 					"script": to.Ptr("alter table `movies`.`movies_genres` add index `idx_movie_id` (`movie_id`)"),
		// 					"tableName": to.Ptr("movies_genres"),
		// 				},
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Index-2"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/advisors/recommendedActions"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-2"),
		// 			Properties: &armmysql.RecommendationActionProperties{
		// 				ActionID: to.Ptr[int32](2),
		// 				AdvisorName: to.Ptr("Index"),
		// 				CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T23:43:24.000Z"); return t}()),
		// 				ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-08T23:43:24.000Z"); return t}()),
		// 				Reason: to.Ptr("Column `movies_genres`.`genre` appear in Group By clause(s)."),
		// 				RecommendationType: to.Ptr("Add"),
		// 				SessionID: to.Ptr("c63c2114-e2a4-4c7a-98c1-85577d1a5d50"),
		// 				Details: map[string]*string{
		// 					"engine": to.Ptr("InnoDB"),
		// 					"indexColumns": to.Ptr("`movies_genres`.`genre`"),
		// 					"indexName": to.Ptr("idx_genre"),
		// 					"indexType": to.Ptr("BTREE"),
		// 					"parentTableName": to.Ptr("movies_genres"),
		// 					"queryIds": to.Ptr("779"),
		// 					"schemaName": to.Ptr("movies"),
		// 					"script": to.Ptr("alter table `movies`.`movies_genres` add index `idx_genre` (`genre`)"),
		// 					"tableName": to.Ptr("movies_genres"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

type RecommendedActionsClientGetOptions added in v0.3.0

type RecommendedActionsClientGetOptions struct {
}

RecommendedActionsClientGetOptions contains the optional parameters for the RecommendedActionsClient.Get method.

type RecommendedActionsClientGetResponse added in v0.3.0

type RecommendedActionsClientGetResponse struct {
	// Represents a Recommendation Action.
	RecommendationAction
}

RecommendedActionsClientGetResponse contains the response from method RecommendedActionsClient.Get.

type RecommendedActionsClientListByServerOptions added in v0.3.0

type RecommendedActionsClientListByServerOptions struct {
	// The recommendation action session identifier.
	SessionID *string
}

RecommendedActionsClientListByServerOptions contains the optional parameters for the RecommendedActionsClient.NewListByServerPager method.

type RecommendedActionsClientListByServerResponse added in v0.3.0

type RecommendedActionsClientListByServerResponse struct {
	// A list of recommendation actions.
	RecommendationActionsResultList
}

RecommendedActionsClientListByServerResponse contains the response from method RecommendedActionsClient.NewListByServerPager.

type RecoverableServerProperties

type RecoverableServerProperties struct {
	// READ-ONLY; Edition of the performance tier.
	Edition *string

	// READ-ONLY; Hardware generation associated with the service level objective
	HardwareGeneration *string

	// READ-ONLY; The last available backup date time.
	LastAvailableBackupDateTime *string

	// READ-ONLY; The service level objective
	ServiceLevelObjective *string

	// READ-ONLY; vCore associated with the service level objective
	VCore *int32

	// READ-ONLY; The MySQL version
	Version *string
}

RecoverableServerProperties - The recoverable server's properties.

func (RecoverableServerProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type RecoverableServerProperties.

func (*RecoverableServerProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableServerProperties.

type RecoverableServerResource

type RecoverableServerResource struct {
	// Resource properties.
	Properties *RecoverableServerProperties

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

RecoverableServerResource - A recoverable server resource.

func (RecoverableServerResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RecoverableServerResource.

func (*RecoverableServerResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableServerResource.

type RecoverableServersClient

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

RecoverableServersClient contains the methods for the RecoverableServers group. Don't use this type directly, use NewRecoverableServersClient() instead.

func NewRecoverableServersClient

func NewRecoverableServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RecoverableServersClient, error)

NewRecoverableServersClient creates a new instance of RecoverableServersClient with the specified values.

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

func (*RecoverableServersClient) Get

Get - Gets a recoverable MySQL Server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - RecoverableServersClientGetOptions contains the optional parameters for the RecoverableServersClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/RecoverableServersGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecoverableServersClient().Get(ctx, "testrg", "testsvc4", 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.RecoverableServerResource = armmysql.RecoverableServerResource{
	// 	Name: to.Ptr("recoverableServers"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/recoverableServers"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/testsvc4/recoverableServers"),
	// 	Properties: &armmysql.RecoverableServerProperties{
	// 		Edition: to.Ptr("GeneralPurpose"),
	// 		HardwareGeneration: to.Ptr("Gen5"),
	// 		LastAvailableBackupDateTime: to.Ptr("2020-11-20T01:06:29.78Z"),
	// 		ServiceLevelObjective: to.Ptr("GP_Gen5_2"),
	// 		VCore: to.Ptr[int32](2),
	// 		Version: to.Ptr("5.7"),
	// 	},
	// }
}
Output:

type RecoverableServersClientGetOptions added in v0.3.0

type RecoverableServersClientGetOptions struct {
}

RecoverableServersClientGetOptions contains the optional parameters for the RecoverableServersClient.Get method.

type RecoverableServersClientGetResponse added in v0.3.0

type RecoverableServersClientGetResponse struct {
	// A recoverable server resource.
	RecoverableServerResource
}

RecoverableServersClientGetResponse contains the response from method RecoverableServersClient.Get.

type ReplicasClient

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

ReplicasClient contains the methods for the Replicas group. Don't use this type directly, use NewReplicasClient() instead.

func NewReplicasClient

func NewReplicasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReplicasClient, error)

NewReplicasClient creates a new instance of ReplicasClient with the specified values.

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

func (*ReplicasClient) NewListByServerPager added in v0.5.0

func (client *ReplicasClient) NewListByServerPager(resourceGroupName string, serverName string, options *ReplicasClientListByServerOptions) *runtime.Pager[ReplicasClientListByServerResponse]

NewListByServerPager - List all the replicas for a given server.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ReplicasClientListByServerOptions contains the optional parameters for the ReplicasClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ReplicasListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewReplicasClient().NewListByServerPager("TestGroup", "testmaster", 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.ServerListResult = armmysql.ServerListResult{
		// 	Value: []*armmysql.Server{
		// 		{
		// 			Name: to.Ptr("testserver"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver"),
		// 			Location: to.Ptr("northeurope"),
		// 			Tags: map[string]*string{
		// 				"elasticServer": to.Ptr("1"),
		// 			},
		// 			Properties: &armmysql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("cloudsa"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-11T23:56:54.300Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("testserver.mysql.database.azure.com"),
		// 				MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testmaster"),
		// 				ReplicaCapacity: to.Ptr[int32](0),
		// 				ReplicationRole: to.Ptr("Replica"),
		// 				SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled),
		// 				StorageProfile: &armmysql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](35),
		// 					GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled),
		// 					StorageMB: to.Ptr[int32](256000),
		// 				},
		// 				UserVisibleState: to.Ptr(armmysql.ServerStateReady),
		// 				Version: to.Ptr(armmysql.ServerVersionFive6),
		// 			},
		// 			SKU: &armmysql.SKU{
		// 				Name: to.Ptr("GP_Gen4_2"),
		// 				Capacity: to.Ptr[int32](2),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armmysql.SKUTierGeneralPurpose),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testserver1"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver1"),
		// 			Location: to.Ptr("northeurope"),
		// 			Tags: map[string]*string{
		// 				"elasticServer": to.Ptr("1"),
		// 			},
		// 			Properties: &armmysql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("cloudsa"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-11T23:56:54.300Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("testserver1.mysql.database.azure.com"),
		// 				MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testmaster"),
		// 				ReplicaCapacity: to.Ptr[int32](0),
		// 				ReplicationRole: to.Ptr("Replica"),
		// 				SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled),
		// 				StorageProfile: &armmysql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](35),
		// 					GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled),
		// 					StorageMB: to.Ptr[int32](256000),
		// 				},
		// 				UserVisibleState: to.Ptr(armmysql.ServerStateReady),
		// 				Version: to.Ptr(armmysql.ServerVersionFive6),
		// 			},
		// 			SKU: &armmysql.SKU{
		// 				Name: to.Ptr("GP_Gen4_2"),
		// 				Capacity: to.Ptr[int32](2),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armmysql.SKUTierGeneralPurpose),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testserver2"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testserver2"),
		// 			Location: to.Ptr("northeurope"),
		// 			Tags: map[string]*string{
		// 				"elasticServer": to.Ptr("1"),
		// 			},
		// 			Properties: &armmysql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("cloudsa"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-11T23:56:54.300Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("testserver2.mysql.database.azure.com"),
		// 				MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/testmaster"),
		// 				ReplicaCapacity: to.Ptr[int32](0),
		// 				ReplicationRole: to.Ptr("Replica"),
		// 				SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled),
		// 				StorageProfile: &armmysql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](35),
		// 					GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled),
		// 					StorageMB: to.Ptr[int32](256000),
		// 				},
		// 				UserVisibleState: to.Ptr(armmysql.ServerStateReady),
		// 				Version: to.Ptr(armmysql.ServerVersionFive6),
		// 			},
		// 			SKU: &armmysql.SKU{
		// 				Name: to.Ptr("GP_Gen4_2"),
		// 				Capacity: to.Ptr[int32](2),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armmysql.SKUTierGeneralPurpose),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ReplicasClientListByServerOptions added in v0.3.0

type ReplicasClientListByServerOptions struct {
}

ReplicasClientListByServerOptions contains the optional parameters for the ReplicasClient.NewListByServerPager method.

type ReplicasClientListByServerResponse added in v0.3.0

type ReplicasClientListByServerResponse struct {
	// A list of servers.
	ServerListResult
}

ReplicasClientListByServerResponse contains the response from method ReplicasClient.NewListByServerPager.

type Resource

type Resource struct {
	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

Resource - Common fields that are returned in the response for all Azure Resource Manager resources

func (Resource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type ResourceIdentity

type ResourceIdentity struct {
	// The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal
	// for the resource.
	Type *IdentityType

	// READ-ONLY; The Azure Active Directory principal id.
	PrincipalID *string

	// READ-ONLY; The Azure Active Directory tenant id.
	TenantID *string
}

ResourceIdentity - Azure Active Directory identity configuration for a resource.

func (ResourceIdentity) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ResourceIdentity.

func (*ResourceIdentity) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceIdentity.

type SKU

type SKU struct {
	// REQUIRED; The name of the sku, typically, tier + family + cores, e.g. BGen41, GPGen58.
	Name *string

	// The scale up/out capacity, representing server's compute units.
	Capacity *int32

	// The family of hardware.
	Family *string

	// The size code, to be interpreted by resource as appropriate.
	Size *string

	// The tier of the particular SKU, e.g. Basic.
	Tier *SKUTier
}

SKU - Billing information related properties of a server.

func (SKU) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SKU.

func (*SKU) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKU.

type SKUTier

type SKUTier string

SKUTier - The tier of the particular SKU, e.g. Basic.

const (
	SKUTierBasic           SKUTier = "Basic"
	SKUTierGeneralPurpose  SKUTier = "GeneralPurpose"
	SKUTierMemoryOptimized SKUTier = "MemoryOptimized"
)

func PossibleSKUTierValues

func PossibleSKUTierValues() []SKUTier

PossibleSKUTierValues returns the possible values for the SKUTier const type.

type SSLEnforcementEnum

type SSLEnforcementEnum string

SSLEnforcementEnum - Enable ssl enforcement or not when connect to server.

const (
	SSLEnforcementEnumDisabled SSLEnforcementEnum = "Disabled"
	SSLEnforcementEnumEnabled  SSLEnforcementEnum = "Enabled"
)

func PossibleSSLEnforcementEnumValues

func PossibleSSLEnforcementEnumValues() []SSLEnforcementEnum

PossibleSSLEnforcementEnumValues returns the possible values for the SSLEnforcementEnum const type.

type SecurityAlertPolicyName

type SecurityAlertPolicyName string
const (
	SecurityAlertPolicyNameDefault SecurityAlertPolicyName = "Default"
)

func PossibleSecurityAlertPolicyNameValues

func PossibleSecurityAlertPolicyNameValues() []SecurityAlertPolicyName

PossibleSecurityAlertPolicyNameValues returns the possible values for the SecurityAlertPolicyName const type.

type SecurityAlertPolicyProperties

type SecurityAlertPolicyProperties struct {
	// REQUIRED; Specifies the state of the policy, whether it is enabled or disabled.
	State *ServerSecurityAlertPolicyState

	// Specifies an array of alerts that are disabled. Allowed values are: SqlInjection, SqlInjectionVulnerability, AccessAnomaly
	DisabledAlerts []*string

	// Specifies that the alert is sent to the account administrators.
	EmailAccountAdmins *bool

	// Specifies an array of e-mail addresses to which the alert is sent.
	EmailAddresses []*string

	// Specifies the number of days to keep in the Threat Detection audit logs.
	RetentionDays *int32

	// Specifies the identifier key of the Threat Detection audit storage account.
	StorageAccountAccessKey *string

	// Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat
	// Detection audit logs.
	StorageEndpoint *string
}

SecurityAlertPolicyProperties - Properties of a security alert policy.

func (SecurityAlertPolicyProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SecurityAlertPolicyProperties.

func (*SecurityAlertPolicyProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertPolicyProperties.

type Server

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

	// The Azure Active Directory identity of the server.
	Identity *ResourceIdentity

	// Properties of the server.
	Properties *ServerProperties

	// The SKU (pricing tier) of the server.
	SKU *SKU

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

Server - Represents a server.

func (Server) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Server.

func (*Server) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Server.

type ServerAdministratorProperties

type ServerAdministratorProperties struct {
	// CONSTANT; The type of administrator.
	// Field has constant value "ActiveDirectory", any specified value is ignored.
	AdministratorType *string

	// REQUIRED; The server administrator login account name.
	Login *string

	// REQUIRED; The server administrator Sid (Secure ID).
	Sid *string

	// REQUIRED; The server Active Directory Administrator tenant id.
	TenantID *string
}

ServerAdministratorProperties - The properties of an server Administrator.

func (ServerAdministratorProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServerAdministratorProperties.

func (*ServerAdministratorProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerAdministratorProperties.

type ServerAdministratorResource

type ServerAdministratorResource struct {
	// Properties of the server AAD administrator.
	Properties *ServerAdministratorProperties

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ServerAdministratorResource - Represents a and external administrator to be created.

func (ServerAdministratorResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerAdministratorResource.

func (*ServerAdministratorResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerAdministratorResource.

type ServerAdministratorResourceListResult

type ServerAdministratorResourceListResult struct {
	// The list of server Active Directory Administrators for the server.
	Value []*ServerAdministratorResource
}

ServerAdministratorResourceListResult - The response to a list Active Directory Administrators request.

func (ServerAdministratorResourceListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerAdministratorResourceListResult.

func (*ServerAdministratorResourceListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerAdministratorResourceListResult.

type ServerAdministratorsClient

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

ServerAdministratorsClient contains the methods for the ServerAdministrators group. Don't use this type directly, use NewServerAdministratorsClient() instead.

func NewServerAdministratorsClient

func NewServerAdministratorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerAdministratorsClient, error)

NewServerAdministratorsClient creates a new instance of ServerAdministratorsClient with the specified values.

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

func (*ServerAdministratorsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or update active directory administrator on an existing server. The update action will overwrite the existing administrator. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • properties - The required parameters for creating or updating an AAD server administrator.
  • options - ServerAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAdministratorsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerAdminCreateUpdate.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServerAdministratorsClient().BeginCreateOrUpdate(ctx, "testrg", "mysqltestsvc4", armmysql.ServerAdministratorResource{
		Properties: &armmysql.ServerAdministratorProperties{
			AdministratorType: to.Ptr("ActiveDirectory"),
			Login:             to.Ptr("bob@contoso.com"),
			Sid:               to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
			TenantID:          to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
		},
	}, 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.ServerAdministratorResource = armmysql.ServerAdministratorResource{
	// 	Name: to.Ptr("activeDirectory"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/administrators"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc4/administrators/activeDirectory"),
	// 	Properties: &armmysql.ServerAdministratorProperties{
	// 		AdministratorType: to.Ptr("ActiveDirectory"),
	// 		Login: to.Ptr("bob@contoso.com"),
	// 		Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
	// 		TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
	// 	},
	// }
}
Output:

func (*ServerAdministratorsClient) BeginDelete

BeginDelete - Deletes server active directory administrator. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServerAdministratorsClientBeginDeleteOptions contains the optional parameters for the ServerAdministratorsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerAdminDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServerAdministratorsClient().BeginDelete(ctx, "testrg", "mysqltestsvc4", 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 (*ServerAdministratorsClient) Get

Get - Gets information about a AAD server administrator. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServerAdministratorsClientGetOptions contains the optional parameters for the ServerAdministratorsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerAdminGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServerAdministratorsClient().Get(ctx, "testrg", "mysqltestsvc4", 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.ServerAdministratorResource = armmysql.ServerAdministratorResource{
	// 	Name: to.Ptr("activeDirectory"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/administrators"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc4/administrators/activeDirectory"),
	// 	Properties: &armmysql.ServerAdministratorProperties{
	// 		AdministratorType: to.Ptr("ActiveDirectory"),
	// 		Login: to.Ptr("bob@contoso.com"),
	// 		Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
	// 		TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
	// 	},
	// }
}
Output:

func (*ServerAdministratorsClient) NewListPager added in v0.5.0

NewListPager - Returns a list of server Administrators.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServerAdministratorsClientListOptions contains the optional parameters for the ServerAdministratorsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerAdminList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServerAdministratorsClient().NewListPager("testrg", "mysqltestsvc4", 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.ServerAdministratorResourceListResult = armmysql.ServerAdministratorResourceListResult{
		// 	Value: []*armmysql.ServerAdministratorResource{
		// 		{
		// 			Name: to.Ptr("ActiveDirectory"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/administrators"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc4/administrators/activeDirectory"),
		// 			Properties: &armmysql.ServerAdministratorProperties{
		// 				AdministratorType: to.Ptr("ActiveDirectory"),
		// 				Login: to.Ptr("bob@contoso.com"),
		// 				Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
		// 				TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ServerAdministratorsClientBeginCreateOrUpdateOptions added in v0.3.0

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

ServerAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAdministratorsClient.BeginCreateOrUpdate method.

type ServerAdministratorsClientBeginDeleteOptions added in v0.3.0

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

ServerAdministratorsClientBeginDeleteOptions contains the optional parameters for the ServerAdministratorsClient.BeginDelete method.

type ServerAdministratorsClientCreateOrUpdateResponse added in v0.3.0

type ServerAdministratorsClientCreateOrUpdateResponse struct {
	// Represents a and external administrator to be created.
	ServerAdministratorResource
}

ServerAdministratorsClientCreateOrUpdateResponse contains the response from method ServerAdministratorsClient.BeginCreateOrUpdate.

type ServerAdministratorsClientDeleteResponse added in v0.3.0

type ServerAdministratorsClientDeleteResponse struct {
}

ServerAdministratorsClientDeleteResponse contains the response from method ServerAdministratorsClient.BeginDelete.

type ServerAdministratorsClientGetOptions added in v0.3.0

type ServerAdministratorsClientGetOptions struct {
}

ServerAdministratorsClientGetOptions contains the optional parameters for the ServerAdministratorsClient.Get method.

type ServerAdministratorsClientGetResponse added in v0.3.0

type ServerAdministratorsClientGetResponse struct {
	// Represents a and external administrator to be created.
	ServerAdministratorResource
}

ServerAdministratorsClientGetResponse contains the response from method ServerAdministratorsClient.Get.

type ServerAdministratorsClientListOptions added in v0.3.0

type ServerAdministratorsClientListOptions struct {
}

ServerAdministratorsClientListOptions contains the optional parameters for the ServerAdministratorsClient.NewListPager method.

type ServerAdministratorsClientListResponse added in v0.3.0

type ServerAdministratorsClientListResponse struct {
	// The response to a list Active Directory Administrators request.
	ServerAdministratorResourceListResult
}

ServerAdministratorsClientListResponse contains the response from method ServerAdministratorsClient.NewListPager.

type ServerBasedPerformanceTierClient

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

ServerBasedPerformanceTierClient contains the methods for the ServerBasedPerformanceTier group. Don't use this type directly, use NewServerBasedPerformanceTierClient() instead.

func NewServerBasedPerformanceTierClient

func NewServerBasedPerformanceTierClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerBasedPerformanceTierClient, error)

NewServerBasedPerformanceTierClient creates a new instance of ServerBasedPerformanceTierClient with the specified values.

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

func (*ServerBasedPerformanceTierClient) NewListPager added in v0.5.0

NewListPager - List all the performance tiers for a MySQL server.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServerBasedPerformanceTierClientListOptions contains the optional parameters for the ServerBasedPerformanceTierClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/PerformanceTiersListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServerBasedPerformanceTierClient().NewListPager("testrg", "mysqltestsvc1", 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.PerformanceTierListResult = armmysql.PerformanceTierListResult{
		// 	Value: []*armmysql.PerformanceTierProperties{
		// 		{
		// 			ID: to.Ptr("Basic"),
		// 			MaxBackupRetentionDays: to.Ptr[int32](35),
		// 			MaxLargeStorageMB: to.Ptr[int32](0),
		// 			MaxStorageMB: to.Ptr[int32](2097152),
		// 			MinBackupRetentionDays: to.Ptr[int32](7),
		// 			MinLargeStorageMB: to.Ptr[int32](0),
		// 			MinStorageMB: to.Ptr[int32](5120),
		// 			ServiceLevelObjectives: []*armmysql.PerformanceTierServiceLevelObjectives{
		// 				{
		// 					Edition: to.Ptr("Basic"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("B_Gen5_1"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](1048576),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](1),
		// 				},
		// 				{
		// 					Edition: to.Ptr("Basic"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("B_Gen5_2"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](1048576),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](2),
		// 			}},
		// 		},
		// 		{
		// 			ID: to.Ptr("GeneralPurpose"),
		// 			MaxBackupRetentionDays: to.Ptr[int32](35),
		// 			MaxLargeStorageMB: to.Ptr[int32](16777216),
		// 			MaxStorageMB: to.Ptr[int32](16777216),
		// 			MinBackupRetentionDays: to.Ptr[int32](7),
		// 			MinLargeStorageMB: to.Ptr[int32](0),
		// 			MinStorageMB: to.Ptr[int32](5120),
		// 			ServiceLevelObjectives: []*armmysql.PerformanceTierServiceLevelObjectives{
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_2"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](2),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_4"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](4),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_8"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](8),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_16"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](16),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_32"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](32),
		// 				},
		// 				{
		// 					Edition: to.Ptr("GeneralPurpose"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("GP_Gen5_64"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](32),
		// 			}},
		// 		},
		// 		{
		// 			ID: to.Ptr("MemoryOptimized"),
		// 			MaxBackupRetentionDays: to.Ptr[int32](35),
		// 			MaxLargeStorageMB: to.Ptr[int32](16777216),
		// 			MaxStorageMB: to.Ptr[int32](16777216),
		// 			MinBackupRetentionDays: to.Ptr[int32](7),
		// 			MinLargeStorageMB: to.Ptr[int32](0),
		// 			MinStorageMB: to.Ptr[int32](5120),
		// 			ServiceLevelObjectives: []*armmysql.PerformanceTierServiceLevelObjectives{
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_2"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](2),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_4"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](4),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_8"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](8),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_16"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](16),
		// 				},
		// 				{
		// 					Edition: to.Ptr("MemoryOptimized"),
		// 					HardwareGeneration: to.Ptr("Gen5"),
		// 					ID: to.Ptr("MO_Gen5_32"),
		// 					MaxBackupRetentionDays: to.Ptr[int32](35),
		// 					MaxStorageMB: to.Ptr[int32](2097152),
		// 					MinBackupRetentionDays: to.Ptr[int32](7),
		// 					MinStorageMB: to.Ptr[int32](5120),
		// 					VCore: to.Ptr[int32](32),
		// 			}},
		// 	}},
		// }
	}
}
Output:

type ServerBasedPerformanceTierClientListOptions added in v0.3.0

type ServerBasedPerformanceTierClientListOptions struct {
}

ServerBasedPerformanceTierClientListOptions contains the optional parameters for the ServerBasedPerformanceTierClient.NewListPager method.

type ServerBasedPerformanceTierClientListResponse added in v0.3.0

type ServerBasedPerformanceTierClientListResponse struct {
	// A list of performance tiers.
	PerformanceTierListResult
}

ServerBasedPerformanceTierClientListResponse contains the response from method ServerBasedPerformanceTierClient.NewListPager.

type ServerForCreate

type ServerForCreate struct {
	// REQUIRED; The location the resource resides in.
	Location *string

	// REQUIRED; Properties of the server.
	Properties ServerPropertiesForCreateClassification

	// The Azure Active Directory identity of the server.
	Identity *ResourceIdentity

	// The SKU (pricing tier) of the server.
	SKU *SKU

	// Application-specific metadata in the form of key-value pairs.
	Tags map[string]*string
}

ServerForCreate - Represents a server to be created.

func (ServerForCreate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerForCreate.

func (*ServerForCreate) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerForCreate.

type ServerKey

type ServerKey struct {
	// Properties of the ServerKey Resource.
	Properties *ServerKeyProperties

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

	// READ-ONLY; Kind of encryption protector used to protect the key.
	Kind *string

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

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

ServerKey - A MySQL Server key.

func (ServerKey) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerKey.

func (*ServerKey) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerKey.

type ServerKeyListResult

type ServerKeyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string

	// READ-ONLY; A list of MySQL Server keys.
	Value []*ServerKey
}

ServerKeyListResult - A list of MySQL Server keys.

func (ServerKeyListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerKeyListResult.

func (*ServerKeyListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerKeyListResult.

type ServerKeyProperties

type ServerKeyProperties struct {
	// REQUIRED; The key type like 'AzureKeyVault'.
	ServerKeyType *ServerKeyType

	// The URI of the key.
	URI *string

	// READ-ONLY; The key creation date.
	CreationDate *time.Time
}

ServerKeyProperties - Properties for a key execution.

func (ServerKeyProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerKeyProperties.

func (*ServerKeyProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerKeyProperties.

type ServerKeyType

type ServerKeyType string

ServerKeyType - The key type like 'AzureKeyVault'.

const (
	ServerKeyTypeAzureKeyVault ServerKeyType = "AzureKeyVault"
)

func PossibleServerKeyTypeValues

func PossibleServerKeyTypeValues() []ServerKeyType

PossibleServerKeyTypeValues returns the possible values for the ServerKeyType const type.

type ServerKeysClient

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

ServerKeysClient contains the methods for the ServerKeys group. Don't use this type directly, use NewServerKeysClient() instead.

func NewServerKeysClient

func NewServerKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerKeysClient, error)

NewServerKeysClient creates a new instance of ServerKeysClient with the specified values.

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

func (*ServerKeysClient) BeginCreateOrUpdate

func (client *ServerKeysClient) BeginCreateOrUpdate(ctx context.Context, serverName string, keyName string, resourceGroupName string, parameters ServerKey, options *ServerKeysClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerKeysClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates a MySQL Server key. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-01-01

  • serverName - The name of the server.
  • keyName - The name of the MySQL Server key to be operated on (updated or created).
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • parameters - The requested MySQL Server key resource state.
  • options - ServerKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerKeysClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2020-01-01/examples/ServerKeyCreateOrUpdate.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServerKeysClient().BeginCreateOrUpdate(ctx, "testserver", "someVault_someKey_01234567890123456789012345678901", "testrg", armmysql.ServerKey{
		Properties: &armmysql.ServerKeyProperties{
			ServerKeyType: to.Ptr(armmysql.ServerKeyTypeAzureKeyVault),
			URI:           to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"),
		},
	}, 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.ServerKey = armmysql.ServerKey{
	// 	Name: to.Ptr("omeVault_someKey_01234567890123456789012345678901"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/keys"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/testserver/keys/someVault_someKey_01234567890123456789012345678901"),
	// 	Kind: to.Ptr("azurekeyvault"),
	// 	Properties: &armmysql.ServerKeyProperties{
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-01T00:00:00.000Z"); return t}()),
	// 		ServerKeyType: to.Ptr(armmysql.ServerKeyTypeAzureKeyVault),
	// 		URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"),
	// 	},
	// }
}
Output:

func (*ServerKeysClient) BeginDelete

func (client *ServerKeysClient) BeginDelete(ctx context.Context, serverName string, keyName string, resourceGroupName string, options *ServerKeysClientBeginDeleteOptions) (*runtime.Poller[ServerKeysClientDeleteResponse], error)

BeginDelete - Deletes the MySQL Server key with the given name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-01-01

  • serverName - The name of the server.
  • keyName - The name of the MySQL Server key to be deleted.
  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - ServerKeysClientBeginDeleteOptions contains the optional parameters for the ServerKeysClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2020-01-01/examples/ServerKeyDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServerKeysClient().BeginDelete(ctx, "testserver", "someVault_someKey_01234567890123456789012345678901", "testrg", 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 (*ServerKeysClient) Get

func (client *ServerKeysClient) Get(ctx context.Context, resourceGroupName string, serverName string, keyName string, options *ServerKeysClientGetOptions) (ServerKeysClientGetResponse, error)

Get - Gets a MySQL Server key. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-01-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • keyName - The name of the MySQL Server key to be retrieved.
  • options - ServerKeysClientGetOptions contains the optional parameters for the ServerKeysClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2020-01-01/examples/ServerKeyGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServerKeysClient().Get(ctx, "testrg", "testserver", "someVault_someKey_01234567890123456789012345678901", 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.ServerKey = armmysql.ServerKey{
	// 	Name: to.Ptr("someVault_someKey_01234567890123456789012345678901"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/keys"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/testserver/keys/someVault_someKey_01234567890123456789012345678901"),
	// 	Kind: to.Ptr("azurekeyvault"),
	// 	Properties: &armmysql.ServerKeyProperties{
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00.000Z"); return t}()),
	// 		ServerKeyType: to.Ptr(armmysql.ServerKeyTypeAzureKeyVault),
	// 		URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"),
	// 	},
	// }
}
Output:

func (*ServerKeysClient) NewListPager added in v0.5.0

func (client *ServerKeysClient) NewListPager(resourceGroupName string, serverName string, options *ServerKeysClientListOptions) *runtime.Pager[ServerKeysClientListResponse]

NewListPager - Gets a list of Server keys.

Generated from API version 2020-01-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServerKeysClientListOptions contains the optional parameters for the ServerKeysClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2020-01-01/examples/ServerKeyList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServerKeysClient().NewListPager("testrg", "testserver", 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.ServerKeyListResult = armmysql.ServerKeyListResult{
		// 	Value: []*armmysql.ServerKey{
		// 		{
		// 			Name: to.Ptr("someVault_someKey_01234567890123456789012345678901"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/keys"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/testserver/keys/someVault_someKey_01234567890123456789012345678901"),
		// 			Kind: to.Ptr("azurekeyvault"),
		// 			Properties: &armmysql.ServerKeyProperties{
		// 				CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00.000Z"); return t}()),
		// 				ServerKeyType: to.Ptr(armmysql.ServerKeyTypeAzureKeyVault),
		// 				URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ServerKeysClientBeginCreateOrUpdateOptions added in v0.3.0

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

ServerKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerKeysClient.BeginCreateOrUpdate method.

type ServerKeysClientBeginDeleteOptions added in v0.3.0

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

ServerKeysClientBeginDeleteOptions contains the optional parameters for the ServerKeysClient.BeginDelete method.

type ServerKeysClientCreateOrUpdateResponse added in v0.3.0

type ServerKeysClientCreateOrUpdateResponse struct {
	// A MySQL Server key.
	ServerKey
}

ServerKeysClientCreateOrUpdateResponse contains the response from method ServerKeysClient.BeginCreateOrUpdate.

type ServerKeysClientDeleteResponse added in v0.3.0

type ServerKeysClientDeleteResponse struct {
}

ServerKeysClientDeleteResponse contains the response from method ServerKeysClient.BeginDelete.

type ServerKeysClientGetOptions added in v0.3.0

type ServerKeysClientGetOptions struct {
}

ServerKeysClientGetOptions contains the optional parameters for the ServerKeysClient.Get method.

type ServerKeysClientGetResponse added in v0.3.0

type ServerKeysClientGetResponse struct {
	// A MySQL Server key.
	ServerKey
}

ServerKeysClientGetResponse contains the response from method ServerKeysClient.Get.

type ServerKeysClientListOptions added in v0.3.0

type ServerKeysClientListOptions struct {
}

ServerKeysClientListOptions contains the optional parameters for the ServerKeysClient.NewListPager method.

type ServerKeysClientListResponse added in v0.3.0

type ServerKeysClientListResponse struct {
	// A list of MySQL Server keys.
	ServerKeyListResult
}

ServerKeysClientListResponse contains the response from method ServerKeysClient.NewListPager.

type ServerListResult

type ServerListResult struct {
	// The list of servers
	Value []*Server
}

ServerListResult - A list of servers.

func (ServerListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerListResult.

func (*ServerListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerListResult.

type ServerParametersClient

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

ServerParametersClient contains the methods for the ServerParameters group. Don't use this type directly, use NewServerParametersClient() instead.

func NewServerParametersClient

func NewServerParametersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerParametersClient, error)

NewServerParametersClient creates a new instance of ServerParametersClient with the specified values.

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

func (*ServerParametersClient) BeginListUpdateConfigurations

BeginListUpdateConfigurations - Update a list of configurations in a given server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • value - The parameters for updating a list of server configuration.
  • options - ServerParametersClientBeginListUpdateConfigurationsOptions contains the optional parameters for the ServerParametersClient.BeginListUpdateConfigurations method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ConfigurationsUpdateByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServerParametersClient().BeginListUpdateConfigurations(ctx, "testrg", "mysqltestsvc1", armmysql.ConfigurationListResult{}, 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.ConfigurationListResult = armmysql.ConfigurationListResult{
	// 	Value: []*armmysql.Configuration{
	// 		{
	// 			Name: to.Ptr("event_scheduler"),
	// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
	// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/event_scheduler"),
	// 			Properties: &armmysql.ConfigurationProperties{
	// 				Description: to.Ptr("Indicates the status of the Event Scheduler."),
	// 				AllowedValues: to.Ptr("ON,OFF,DISABLED"),
	// 				DataType: to.Ptr("Enumeration"),
	// 				DefaultValue: to.Ptr("OFF"),
	// 				Source: to.Ptr("system-default"),
	// 				Value: to.Ptr("OFF"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("div_precision_increment"),
	// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/configurations"),
	// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1/configurations/div_precision_increment"),
	// 			Properties: &armmysql.ConfigurationProperties{
	// 				Description: to.Ptr("Number of digits by which to increase the scale of the result of division operations."),
	// 				AllowedValues: to.Ptr("0-30"),
	// 				DataType: to.Ptr("Integer"),
	// 				DefaultValue: to.Ptr("4"),
	// 				Source: to.Ptr("system-default"),
	// 				Value: to.Ptr("4"),
	// 			},
	// 	}},
	// }
}
Output:

type ServerParametersClientBeginListUpdateConfigurationsOptions added in v0.3.0

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

ServerParametersClientBeginListUpdateConfigurationsOptions contains the optional parameters for the ServerParametersClient.BeginListUpdateConfigurations method.

type ServerParametersClientListUpdateConfigurationsResponse added in v0.3.0

type ServerParametersClientListUpdateConfigurationsResponse struct {
	// A list of server configurations.
	ConfigurationListResult
}

ServerParametersClientListUpdateConfigurationsResponse contains the response from method ServerParametersClient.BeginListUpdateConfigurations.

type ServerPrivateEndpointConnection

type ServerPrivateEndpointConnection struct {
	// READ-ONLY; Resource Id of the private endpoint connection.
	ID *string

	// READ-ONLY; Private endpoint connection properties
	Properties *ServerPrivateEndpointConnectionProperties
}

ServerPrivateEndpointConnection - A private endpoint connection under a server

func (ServerPrivateEndpointConnection) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServerPrivateEndpointConnection.

func (*ServerPrivateEndpointConnection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPrivateEndpointConnection.

type ServerPrivateEndpointConnectionProperties

type ServerPrivateEndpointConnectionProperties struct {
	// Private endpoint which the connection belongs to.
	PrivateEndpoint *PrivateEndpointProperty

	// Connection state of the private endpoint connection.
	PrivateLinkServiceConnectionState *ServerPrivateLinkServiceConnectionStateProperty

	// READ-ONLY; State of the private endpoint connection.
	ProvisioningState *PrivateEndpointProvisioningState
}

ServerPrivateEndpointConnectionProperties - Properties of a private endpoint connection.

func (ServerPrivateEndpointConnectionProperties) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type ServerPrivateEndpointConnectionProperties.

func (*ServerPrivateEndpointConnectionProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPrivateEndpointConnectionProperties.

type ServerPrivateLinkServiceConnectionStateProperty

type ServerPrivateLinkServiceConnectionStateProperty struct {
	// REQUIRED; The private link service connection description.
	Description *string

	// REQUIRED; The private link service connection status.
	Status *PrivateLinkServiceConnectionStateStatus

	// READ-ONLY; The actions required for private link service connection.
	ActionsRequired *PrivateLinkServiceConnectionStateActionsRequire
}

func (ServerPrivateLinkServiceConnectionStateProperty) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type ServerPrivateLinkServiceConnectionStateProperty.

func (*ServerPrivateLinkServiceConnectionStateProperty) UnmarshalJSON added in v1.1.0

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPrivateLinkServiceConnectionStateProperty.

type ServerProperties

type ServerProperties struct {
	// The administrator's login name of a server. Can only be specified when the server is being created (and is required for
	// creation).
	AdministratorLogin *string

	// Earliest restore point creation time (ISO8601 format)
	EarliestRestoreDate *time.Time

	// The fully qualified domain name of a server.
	FullyQualifiedDomainName *string

	// Status showing whether the server enabled infrastructure encryption.
	InfrastructureEncryption *InfrastructureEncryption

	// The master server id of a replica server.
	MasterServerID *string

	// Enforce a minimal Tls version for the server.
	MinimalTLSVersion *MinimalTLSVersionEnum

	// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	PublicNetworkAccess *PublicNetworkAccessEnum

	// The maximum number of replicas that a master server can have.
	ReplicaCapacity *int32

	// The replication role of the server.
	ReplicationRole *string

	// Enable ssl enforcement or not when connect to server.
	SSLEnforcement *SSLEnforcementEnum

	// Storage profile of a server.
	StorageProfile *StorageProfile

	// A state of a server that is visible to user.
	UserVisibleState *ServerState

	// Server version.
	Version *ServerVersion

	// READ-ONLY; Status showing whether the server data encryption is enabled with customer-managed keys.
	ByokEnforcement *string

	// READ-ONLY; List of private endpoint connections on a server
	PrivateEndpointConnections []*ServerPrivateEndpointConnection
}

ServerProperties - The properties of a server.

func (ServerProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerProperties.

func (*ServerProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerProperties.

type ServerPropertiesForCreate

type ServerPropertiesForCreate struct {
	// REQUIRED; The mode to create a new server.
	CreateMode *CreateMode

	// Status showing whether the server enabled infrastructure encryption.
	InfrastructureEncryption *InfrastructureEncryption

	// Enforce a minimal Tls version for the server.
	MinimalTLSVersion *MinimalTLSVersionEnum

	// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	PublicNetworkAccess *PublicNetworkAccessEnum

	// Enable ssl enforcement or not when connect to server.
	SSLEnforcement *SSLEnforcementEnum

	// Storage profile of a server.
	StorageProfile *StorageProfile

	// Server version.
	Version *ServerVersion
}

ServerPropertiesForCreate - The properties used to create a new server.

func (*ServerPropertiesForCreate) GetServerPropertiesForCreate

func (s *ServerPropertiesForCreate) GetServerPropertiesForCreate() *ServerPropertiesForCreate

GetServerPropertiesForCreate implements the ServerPropertiesForCreateClassification interface for type ServerPropertiesForCreate.

func (ServerPropertiesForCreate) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForCreate.

func (*ServerPropertiesForCreate) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForCreate.

type ServerPropertiesForCreateClassification

type ServerPropertiesForCreateClassification interface {
	// GetServerPropertiesForCreate returns the ServerPropertiesForCreate content of the underlying type.
	GetServerPropertiesForCreate() *ServerPropertiesForCreate
}

ServerPropertiesForCreateClassification provides polymorphic access to related types. Call the interface's GetServerPropertiesForCreate() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *ServerPropertiesForCreate, *ServerPropertiesForDefaultCreate, *ServerPropertiesForGeoRestore, *ServerPropertiesForReplica, - *ServerPropertiesForRestore

type ServerPropertiesForDefaultCreate

type ServerPropertiesForDefaultCreate struct {
	// REQUIRED; The administrator's login name of a server. Can only be specified when the server is being created (and is required
	// for creation). The login name is required when updating password.
	AdministratorLogin *string

	// REQUIRED; The password of the administrator login.
	AdministratorLoginPassword *string

	// REQUIRED; The mode to create a new server.
	CreateMode *CreateMode

	// Status showing whether the server enabled infrastructure encryption.
	InfrastructureEncryption *InfrastructureEncryption

	// Enforce a minimal Tls version for the server.
	MinimalTLSVersion *MinimalTLSVersionEnum

	// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	PublicNetworkAccess *PublicNetworkAccessEnum

	// Enable ssl enforcement or not when connect to server.
	SSLEnforcement *SSLEnforcementEnum

	// Storage profile of a server.
	StorageProfile *StorageProfile

	// Server version.
	Version *ServerVersion
}

ServerPropertiesForDefaultCreate - The properties used to create a new server.

func (*ServerPropertiesForDefaultCreate) GetServerPropertiesForCreate added in v0.3.0

func (s *ServerPropertiesForDefaultCreate) GetServerPropertiesForCreate() *ServerPropertiesForCreate

GetServerPropertiesForCreate implements the ServerPropertiesForCreateClassification interface for type ServerPropertiesForDefaultCreate.

func (ServerPropertiesForDefaultCreate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForDefaultCreate.

func (*ServerPropertiesForDefaultCreate) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForDefaultCreate.

type ServerPropertiesForGeoRestore

type ServerPropertiesForGeoRestore struct {
	// REQUIRED; The mode to create a new server.
	CreateMode *CreateMode

	// REQUIRED; The source server id to restore from.
	SourceServerID *string

	// Status showing whether the server enabled infrastructure encryption.
	InfrastructureEncryption *InfrastructureEncryption

	// Enforce a minimal Tls version for the server.
	MinimalTLSVersion *MinimalTLSVersionEnum

	// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	PublicNetworkAccess *PublicNetworkAccessEnum

	// Enable ssl enforcement or not when connect to server.
	SSLEnforcement *SSLEnforcementEnum

	// Storage profile of a server.
	StorageProfile *StorageProfile

	// Server version.
	Version *ServerVersion
}

ServerPropertiesForGeoRestore - The properties used to create a new server by restoring to a different region from a geo replicated backup.

func (*ServerPropertiesForGeoRestore) GetServerPropertiesForCreate added in v0.3.0

func (s *ServerPropertiesForGeoRestore) GetServerPropertiesForCreate() *ServerPropertiesForCreate

GetServerPropertiesForCreate implements the ServerPropertiesForCreateClassification interface for type ServerPropertiesForGeoRestore.

func (ServerPropertiesForGeoRestore) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForGeoRestore.

func (*ServerPropertiesForGeoRestore) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForGeoRestore.

type ServerPropertiesForReplica

type ServerPropertiesForReplica struct {
	// REQUIRED; The mode to create a new server.
	CreateMode *CreateMode

	// REQUIRED; The master server id to create replica from.
	SourceServerID *string

	// Status showing whether the server enabled infrastructure encryption.
	InfrastructureEncryption *InfrastructureEncryption

	// Enforce a minimal Tls version for the server.
	MinimalTLSVersion *MinimalTLSVersionEnum

	// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	PublicNetworkAccess *PublicNetworkAccessEnum

	// Enable ssl enforcement or not when connect to server.
	SSLEnforcement *SSLEnforcementEnum

	// Storage profile of a server.
	StorageProfile *StorageProfile

	// Server version.
	Version *ServerVersion
}

ServerPropertiesForReplica - The properties to create a new replica.

func (*ServerPropertiesForReplica) GetServerPropertiesForCreate added in v0.3.0

func (s *ServerPropertiesForReplica) GetServerPropertiesForCreate() *ServerPropertiesForCreate

GetServerPropertiesForCreate implements the ServerPropertiesForCreateClassification interface for type ServerPropertiesForReplica.

func (ServerPropertiesForReplica) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForReplica.

func (*ServerPropertiesForReplica) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForReplica.

type ServerPropertiesForRestore

type ServerPropertiesForRestore struct {
	// REQUIRED; The mode to create a new server.
	CreateMode *CreateMode

	// REQUIRED; Restore point creation time (ISO8601 format), specifying the time to restore from.
	RestorePointInTime *time.Time

	// REQUIRED; The source server id to restore from.
	SourceServerID *string

	// Status showing whether the server enabled infrastructure encryption.
	InfrastructureEncryption *InfrastructureEncryption

	// Enforce a minimal Tls version for the server.
	MinimalTLSVersion *MinimalTLSVersionEnum

	// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	PublicNetworkAccess *PublicNetworkAccessEnum

	// Enable ssl enforcement or not when connect to server.
	SSLEnforcement *SSLEnforcementEnum

	// Storage profile of a server.
	StorageProfile *StorageProfile

	// Server version.
	Version *ServerVersion
}

ServerPropertiesForRestore - The properties used to create a new server by restoring from a backup.

func (*ServerPropertiesForRestore) GetServerPropertiesForCreate added in v0.3.0

func (s *ServerPropertiesForRestore) GetServerPropertiesForCreate() *ServerPropertiesForCreate

GetServerPropertiesForCreate implements the ServerPropertiesForCreateClassification interface for type ServerPropertiesForRestore.

func (ServerPropertiesForRestore) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerPropertiesForRestore.

func (*ServerPropertiesForRestore) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForRestore.

type ServerSecurityAlertPoliciesClient

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

ServerSecurityAlertPoliciesClient contains the methods for the ServerSecurityAlertPolicies group. Don't use this type directly, use NewServerSecurityAlertPoliciesClient() instead.

func NewServerSecurityAlertPoliciesClient

func NewServerSecurityAlertPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerSecurityAlertPoliciesClient, error)

NewServerSecurityAlertPoliciesClient creates a new instance of ServerSecurityAlertPoliciesClient with the specified values.

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

func (*ServerSecurityAlertPoliciesClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates a threat detection policy. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • securityAlertPolicyName - The name of the threat detection policy.
  • parameters - The server security alert policy.
  • options - ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate method.
Example (UpdateAServersThreatDetectionPolicyWithAllParameters)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerSecurityAlertsCreateMax.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServerSecurityAlertPoliciesClient().BeginCreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", armmysql.SecurityAlertPolicyNameDefault, armmysql.ServerSecurityAlertPolicy{
		Properties: &armmysql.SecurityAlertPolicyProperties{
			DisabledAlerts: []*string{
				to.Ptr("Access_Anomaly"),
				to.Ptr("Usage_Anomaly")},
			EmailAccountAdmins: to.Ptr(true),
			EmailAddresses: []*string{
				to.Ptr("testSecurityAlert@microsoft.com")},
			RetentionDays:           to.Ptr[int32](5),
			State:                   to.Ptr(armmysql.ServerSecurityAlertPolicyStateEnabled),
			StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="),
			StorageEndpoint:         to.Ptr("https://mystorage.blob.core.windows.net"),
		},
	}, 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.ServerSecurityAlertPolicy = armmysql.ServerSecurityAlertPolicy{
	// 	Name: to.Ptr("Default"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/securityAlertPolicies"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforMySQL/servers/securityalert-6440/securityAlertPolicies/default"),
	// 	Properties: &armmysql.SecurityAlertPolicyProperties{
	// 		DisabledAlerts: []*string{
	// 			to.Ptr("Access_Anomaly"),
	// 			to.Ptr("Usage_Anomaly")},
	// 			EmailAccountAdmins: to.Ptr(true),
	// 			EmailAddresses: []*string{
	// 				to.Ptr("testSecurityAlert@microsoft.com")},
	// 				RetentionDays: to.Ptr[int32](5),
	// 				State: to.Ptr(armmysql.ServerSecurityAlertPolicyStateEnabled),
	// 				StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"),
	// 			},
	// 		}
}
Output:

Example (UpdateAServersThreatDetectionPolicyWithMinimalParameters)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerSecurityAlertsCreateMin.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServerSecurityAlertPoliciesClient().BeginCreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", armmysql.SecurityAlertPolicyNameDefault, armmysql.ServerSecurityAlertPolicy{
		Properties: &armmysql.SecurityAlertPolicyProperties{
			EmailAccountAdmins: to.Ptr(true),
			State:              to.Ptr(armmysql.ServerSecurityAlertPolicyStateDisabled),
		},
	}, 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.ServerSecurityAlertPolicy = armmysql.ServerSecurityAlertPolicy{
	// 	Name: to.Ptr("Default"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/securityAlertPolicies"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforMySQL/servers/securityalert-6440/securityAlertPolicies/default"),
	// 	Properties: &armmysql.SecurityAlertPolicyProperties{
	// 		DisabledAlerts: []*string{
	// 		},
	// 		EmailAccountAdmins: to.Ptr(true),
	// 		EmailAddresses: []*string{
	// 		},
	// 		RetentionDays: to.Ptr[int32](0),
	// 		State: to.Ptr(armmysql.ServerSecurityAlertPolicyStateEnabled),
	// 		StorageEndpoint: to.Ptr(""),
	// 	},
	// }
}
Output:

func (*ServerSecurityAlertPoliciesClient) Get

Get - Get a server's security alert policy. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • securityAlertPolicyName - The name of the security alert policy.
  • options - ServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerSecurityAlertsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServerSecurityAlertPoliciesClient().Get(ctx, "securityalert-4799", "securityalert-6440", armmysql.SecurityAlertPolicyNameDefault, 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.ServerSecurityAlertPolicy = armmysql.ServerSecurityAlertPolicy{
	// 	Name: to.Ptr("Default"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/securityAlertPolicies"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforMySQL/servers/securityalert-6440/securityAlertPolicies/default"),
	// 	Properties: &armmysql.SecurityAlertPolicyProperties{
	// 		DisabledAlerts: []*string{
	// 			to.Ptr("Access_Anomaly")},
	// 			EmailAccountAdmins: to.Ptr(true),
	// 			EmailAddresses: []*string{
	// 				to.Ptr("test@microsoft.com;user@microsoft.com")},
	// 				RetentionDays: to.Ptr[int32](0),
	// 				State: to.Ptr(armmysql.ServerSecurityAlertPolicyStateDisabled),
	// 				StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"),
	// 			},
	// 		}
}
Output:

func (*ServerSecurityAlertPoliciesClient) NewListByServerPager added in v0.5.0

NewListByServerPager - Get the server's threat detection policies.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServerSecurityAlertPoliciesClientListByServerOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerSecurityAlertsListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServerSecurityAlertPoliciesClient().NewListByServerPager("securityalert-4799", "securityalert-6440", 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.ServerSecurityAlertPolicyListResult = armmysql.ServerSecurityAlertPolicyListResult{
		// 	Value: []*armmysql.ServerSecurityAlertPolicy{
		// 		{
		// 			Name: to.Ptr("Default"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/securityAlertPolicies"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.DBforMySQL/servers/securityalert-6440/securityAlertPolicies"),
		// 			Properties: &armmysql.SecurityAlertPolicyProperties{
		// 				DisabledAlerts: []*string{
		// 					to.Ptr("Access_Anomaly")},
		// 					EmailAccountAdmins: to.Ptr(true),
		// 					EmailAddresses: []*string{
		// 						to.Ptr("test@microsoft.com;user@microsoft.com")},
		// 						RetentionDays: to.Ptr[int32](0),
		// 						State: to.Ptr(armmysql.ServerSecurityAlertPolicyStateDisabled),
		// 						StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"),
		// 					},
		// 			}},
		// 		}
	}
}
Output:

type ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions added in v0.3.0

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

ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate method.

type ServerSecurityAlertPoliciesClientCreateOrUpdateResponse added in v0.3.0

type ServerSecurityAlertPoliciesClientCreateOrUpdateResponse struct {
	// A server security alert policy.
	ServerSecurityAlertPolicy
}

ServerSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate.

type ServerSecurityAlertPoliciesClientGetOptions added in v0.3.0

type ServerSecurityAlertPoliciesClientGetOptions struct {
}

ServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.Get method.

type ServerSecurityAlertPoliciesClientGetResponse added in v0.3.0

type ServerSecurityAlertPoliciesClientGetResponse struct {
	// A server security alert policy.
	ServerSecurityAlertPolicy
}

ServerSecurityAlertPoliciesClientGetResponse contains the response from method ServerSecurityAlertPoliciesClient.Get.

type ServerSecurityAlertPoliciesClientListByServerOptions added in v0.3.0

type ServerSecurityAlertPoliciesClientListByServerOptions struct {
}

ServerSecurityAlertPoliciesClientListByServerOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.NewListByServerPager method.

type ServerSecurityAlertPoliciesClientListByServerResponse added in v0.3.0

type ServerSecurityAlertPoliciesClientListByServerResponse struct {
	// A list of the server's security alert policies.
	ServerSecurityAlertPolicyListResult
}

ServerSecurityAlertPoliciesClientListByServerResponse contains the response from method ServerSecurityAlertPoliciesClient.NewListByServerPager.

type ServerSecurityAlertPolicy

type ServerSecurityAlertPolicy struct {
	// Resource properties.
	Properties *SecurityAlertPolicyProperties

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ServerSecurityAlertPolicy - A server security alert policy.

func (ServerSecurityAlertPolicy) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerSecurityAlertPolicy.

func (*ServerSecurityAlertPolicy) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerSecurityAlertPolicy.

type ServerSecurityAlertPolicyListResult

type ServerSecurityAlertPolicyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string

	// READ-ONLY; Array of results.
	Value []*ServerSecurityAlertPolicy
}

ServerSecurityAlertPolicyListResult - A list of the server's security alert policies.

func (ServerSecurityAlertPolicyListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerSecurityAlertPolicyListResult.

func (*ServerSecurityAlertPolicyListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerSecurityAlertPolicyListResult.

type ServerSecurityAlertPolicyState

type ServerSecurityAlertPolicyState string

ServerSecurityAlertPolicyState - Specifies the state of the policy, whether it is enabled or disabled.

const (
	ServerSecurityAlertPolicyStateDisabled ServerSecurityAlertPolicyState = "Disabled"
	ServerSecurityAlertPolicyStateEnabled  ServerSecurityAlertPolicyState = "Enabled"
)

func PossibleServerSecurityAlertPolicyStateValues

func PossibleServerSecurityAlertPolicyStateValues() []ServerSecurityAlertPolicyState

PossibleServerSecurityAlertPolicyStateValues returns the possible values for the ServerSecurityAlertPolicyState const type.

type ServerState

type ServerState string

ServerState - A state of a server that is visible to user.

const (
	ServerStateDisabled     ServerState = "Disabled"
	ServerStateDropping     ServerState = "Dropping"
	ServerStateInaccessible ServerState = "Inaccessible"
	ServerStateReady        ServerState = "Ready"
)

func PossibleServerStateValues

func PossibleServerStateValues() []ServerState

PossibleServerStateValues returns the possible values for the ServerState const type.

type ServerUpdateParameters

type ServerUpdateParameters struct {
	// The Azure Active Directory identity of the server.
	Identity *ResourceIdentity

	// The properties that can be updated for a server.
	Properties *ServerUpdateParametersProperties

	// The SKU (pricing tier) of the server.
	SKU *SKU

	// Application-specific metadata in the form of key-value pairs.
	Tags map[string]*string
}

ServerUpdateParameters - Parameters allowed to update for a server.

func (ServerUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerUpdateParameters.

func (*ServerUpdateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerUpdateParameters.

type ServerUpdateParametersProperties

type ServerUpdateParametersProperties struct {
	// The password of the administrator login.
	AdministratorLoginPassword *string

	// Enforce a minimal Tls version for the server.
	MinimalTLSVersion *MinimalTLSVersionEnum

	// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	PublicNetworkAccess *PublicNetworkAccessEnum

	// The replication role of the server.
	ReplicationRole *string

	// Enable ssl enforcement or not when connect to server.
	SSLEnforcement *SSLEnforcementEnum

	// Storage profile of a server.
	StorageProfile *StorageProfile

	// The version of a server.
	Version *ServerVersion
}

ServerUpdateParametersProperties - The properties that can be updated for a server.

func (ServerUpdateParametersProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServerUpdateParametersProperties.

func (*ServerUpdateParametersProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerUpdateParametersProperties.

type ServerUpgradeParameters

type ServerUpgradeParameters struct {
	// The properties that can be updated for a server.
	Properties *ServerUpgradeParametersProperties
}

func (ServerUpgradeParameters) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServerUpgradeParameters.

func (*ServerUpgradeParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerUpgradeParameters.

type ServerUpgradeParametersProperties

type ServerUpgradeParametersProperties struct {
	// Represents an server storage profile.
	TargetServerVersion *string
}

ServerUpgradeParametersProperties - The properties that can be updated for a server.

func (ServerUpgradeParametersProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServerUpgradeParametersProperties.

func (*ServerUpgradeParametersProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerUpgradeParametersProperties.

type ServerVersion

type ServerVersion string

ServerVersion - The version of a server.

const (
	ServerVersionEight0 ServerVersion = "8.0"
	ServerVersionFive6  ServerVersion = "5.6"
	ServerVersionFive7  ServerVersion = "5.7"
)

func PossibleServerVersionValues

func PossibleServerVersionValues() []ServerVersion

PossibleServerVersionValues returns the possible values for the ServerVersion const type.

type ServersClient

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

ServersClient contains the methods for the Servers group. Don't use this type directly, use NewServersClient() instead.

func NewServersClient

func NewServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServersClient, error)

NewServersClient creates a new instance of ServersClient with the specified values.

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

func (*ServersClient) BeginCreate

func (client *ServersClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForCreate, options *ServersClientBeginCreateOptions) (*runtime.Poller[ServersClientCreateResponse], error)

BeginCreate - Creates a new server or updates an existing server. The update action will overwrite the existing server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • parameters - The required parameters for creating or updating a server.
  • options - ServersClientBeginCreateOptions contains the optional parameters for the ServersClient.BeginCreate method.
Example (CreateADatabaseAsAPointInTimeRestore)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerCreatePointInTimeRestore.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armmysql.ServerForCreate{
		Location: to.Ptr("brazilsouth"),
		Properties: &armmysql.ServerPropertiesForRestore{
			CreateMode:         to.Ptr(armmysql.CreateModePointInTimeRestore),
			RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-14T00:00:37.467Z"); return t }()),
			SourceServerID:     to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/servers/sourceserver"),
		},
		SKU: &armmysql.SKU{
			Name:     to.Ptr("GP_Gen5_2"),
			Capacity: to.Ptr[int32](2),
			Family:   to.Ptr("Gen5"),
			Tier:     to.Ptr(armmysql.SKUTierGeneralPurpose),
		},
		Tags: map[string]*string{
			"ElasticServer": to.Ptr("1"),
		},
	}, 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.Server = armmysql.Server{
	// 	Name: to.Ptr("targetserver"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/targetserver"),
	// 	Location: to.Ptr("brazilsouth"),
	// 	Tags: map[string]*string{
	// 		"elasticServer": to.Ptr("1"),
	// 	},
	// 	Properties: &armmysql.ServerProperties{
	// 		AdministratorLogin: to.Ptr("cloudsa"),
	// 		EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T18:02:41.577Z"); return t}()),
	// 		FullyQualifiedDomainName: to.Ptr("targetserver.mysql.database.azure.com"),
	// 		SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled),
	// 		StorageProfile: &armmysql.StorageProfile{
	// 			BackupRetentionDays: to.Ptr[int32](7),
	// 			GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled),
	// 			StorageMB: to.Ptr[int32](128000),
	// 		},
	// 		UserVisibleState: to.Ptr(armmysql.ServerStateReady),
	// 		Version: to.Ptr(armmysql.ServerVersionFive7),
	// 	},
	// 	SKU: &armmysql.SKU{
	// 		Name: to.Ptr("GP_Gen5_2"),
	// 		Capacity: to.Ptr[int32](2),
	// 		Family: to.Ptr("Gen5"),
	// 		Tier: to.Ptr(armmysql.SKUTierGeneralPurpose),
	// 	},
	// }
}
Output:

Example (CreateANewServer)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerCreate.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "testrg", "mysqltestsvc4", armmysql.ServerForCreate{
		Location: to.Ptr("westus"),
		Properties: &armmysql.ServerPropertiesForDefaultCreate{
			CreateMode:     to.Ptr(armmysql.CreateModeDefault),
			SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled),
			StorageProfile: &armmysql.StorageProfile{
				BackupRetentionDays: to.Ptr[int32](7),
				GeoRedundantBackup:  to.Ptr(armmysql.GeoRedundantBackupEnabled),
				StorageMB:           to.Ptr[int32](128000),
			},
			AdministratorLogin:         to.Ptr("cloudsa"),
			AdministratorLoginPassword: to.Ptr("<administratorLoginPassword>"),
		},
		SKU: &armmysql.SKU{
			Name:     to.Ptr("GP_Gen5_2"),
			Capacity: to.Ptr[int32](2),
			Family:   to.Ptr("Gen5"),
			Tier:     to.Ptr(armmysql.SKUTierGeneralPurpose),
		},
		Tags: map[string]*string{
			"ElasticServer": to.Ptr("1"),
		},
	}, 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.Server = armmysql.Server{
	// 	Name: to.Ptr("mysqltestsvc4"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc4"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"elasticServer": to.Ptr("1"),
	// 	},
	// 	Properties: &armmysql.ServerProperties{
	// 		AdministratorLogin: to.Ptr("cloudsa"),
	// 		EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T18:02:41.577Z"); return t}()),
	// 		FullyQualifiedDomainName: to.Ptr("mysqltestsvc4.mysql.database.azure.com"),
	// 		SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled),
	// 		StorageProfile: &armmysql.StorageProfile{
	// 			BackupRetentionDays: to.Ptr[int32](7),
	// 			GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled),
	// 			StorageMB: to.Ptr[int32](128000),
	// 		},
	// 		UserVisibleState: to.Ptr(armmysql.ServerStateReady),
	// 		Version: to.Ptr(armmysql.ServerVersionFive7),
	// 	},
	// 	SKU: &armmysql.SKU{
	// 		Name: to.Ptr("GP_Gen5_2"),
	// 		Capacity: to.Ptr[int32](2),
	// 		Family: to.Ptr("Gen5"),
	// 		Tier: to.Ptr(armmysql.SKUTierGeneralPurpose),
	// 	},
	// }
}
Output:

Example (CreateAReplicaServer)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerCreateReplicaMode.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armmysql.ServerForCreate{
		Location: to.Ptr("westus"),
		Properties: &armmysql.ServerPropertiesForReplica{
			CreateMode:     to.Ptr(armmysql.CreateModeReplica),
			SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMySQL/servers/masterserver"),
		},
	}, 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.Server = armmysql.Server{
	// 	Name: to.Ptr("targetserver"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TargetResourceGroup/providers/Microsoft.DBforMySQL/servers/targetserver"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"ElasticServer": to.Ptr("1"),
	// 	},
	// 	Properties: &armmysql.ServerProperties{
	// 		AdministratorLogin: to.Ptr("cloudsa"),
	// 		EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T18:02:41.577Z"); return t}()),
	// 		FullyQualifiedDomainName: to.Ptr("targetserver.mysql.database.azure.com"),
	// 		MasterServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMySQL/servers/masterserver"),
	// 		ReplicaCapacity: to.Ptr[int32](0),
	// 		ReplicationRole: to.Ptr("Replica"),
	// 		SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled),
	// 		StorageProfile: &armmysql.StorageProfile{
	// 			BackupRetentionDays: to.Ptr[int32](14),
	// 			GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled),
	// 			StorageMB: to.Ptr[int32](128000),
	// 		},
	// 		UserVisibleState: to.Ptr(armmysql.ServerStateReady),
	// 		Version: to.Ptr(armmysql.ServerVersionFive7),
	// 	},
	// 	SKU: &armmysql.SKU{
	// 		Name: to.Ptr("GP_Gen5_2"),
	// 		Capacity: to.Ptr[int32](2),
	// 		Family: to.Ptr("Gen5"),
	// 		Tier: to.Ptr(armmysql.SKUTierGeneralPurpose),
	// 	},
	// }
}
Output:

Example (CreateAServerAsAGeoRestore)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerCreateGeoRestoreMode.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginCreate(ctx, "TargetResourceGroup", "targetserver", armmysql.ServerForCreate{
		Location: to.Ptr("westus"),
		Properties: &armmysql.ServerPropertiesForGeoRestore{
			CreateMode:     to.Ptr(armmysql.CreateModeGeoRestore),
			SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/servers/sourceserver"),
		},
		SKU: &armmysql.SKU{
			Name:     to.Ptr("GP_Gen5_2"),
			Capacity: to.Ptr[int32](2),
			Family:   to.Ptr("Gen5"),
			Tier:     to.Ptr(armmysql.SKUTierGeneralPurpose),
		},
		Tags: map[string]*string{
			"ElasticServer": to.Ptr("1"),
		},
	}, 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.Server = armmysql.Server{
	// 	Name: to.Ptr("targetserver"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/targetserver"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"elasticServer": to.Ptr("1"),
	// 	},
	// 	Properties: &armmysql.ServerProperties{
	// 		AdministratorLogin: to.Ptr("cloudsa"),
	// 		EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T18:02:41.577Z"); return t}()),
	// 		FullyQualifiedDomainName: to.Ptr("targetserver.mysql.database.azure.com"),
	// 		SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled),
	// 		StorageProfile: &armmysql.StorageProfile{
	// 			BackupRetentionDays: to.Ptr[int32](14),
	// 			GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled),
	// 			StorageMB: to.Ptr[int32](128000),
	// 		},
	// 		UserVisibleState: to.Ptr(armmysql.ServerStateReady),
	// 		Version: to.Ptr(armmysql.ServerVersionFive7),
	// 	},
	// 	SKU: &armmysql.SKU{
	// 		Name: to.Ptr("GP_Gen5_2"),
	// 		Capacity: to.Ptr[int32](2),
	// 		Family: to.Ptr("Gen5"),
	// 		Tier: to.Ptr(armmysql.SKUTierGeneralPurpose),
	// 	},
	// }
}
Output:

func (*ServersClient) BeginDelete

func (client *ServersClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (*runtime.Poller[ServersClientDeleteResponse], error)

BeginDelete - Deletes a server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginDelete(ctx, "TestGroup", "testserver", 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 (*ServersClient) BeginRestart

func (client *ServersClient) BeginRestart(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginRestartOptions) (*runtime.Poller[ServersClientRestartResponse], error)

BeginRestart - Restarts a server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServersClientBeginRestartOptions contains the optional parameters for the ServersClient.BeginRestart method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerRestart.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginRestart(ctx, "TestGroup", "testserver", 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 (*ServersClient) BeginStart

func (client *ServersClient) BeginStart(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStartOptions) (*runtime.Poller[ServersClientStartResponse], error)

BeginStart - Starts a stopped server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-01-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServersClientBeginStartOptions contains the optional parameters for the ServersClient.BeginStart method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2020-01-01/examples/ServerStart.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginStart(ctx, "TestGroup", "testserver", 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 (*ServersClient) BeginStop

func (client *ServersClient) BeginStop(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginStopOptions) (*runtime.Poller[ServersClientStopResponse], error)

BeginStop - Stops a running server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-01-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServersClientBeginStopOptions contains the optional parameters for the ServersClient.BeginStop method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2020-01-01/examples/ServerStop.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginStop(ctx, "TestGroup", "testserver", 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 (*ServersClient) BeginUpdate

func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdateParameters, options *ServersClientBeginUpdateOptions) (*runtime.Poller[ServersClientUpdateResponse], error)

BeginUpdate - Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • parameters - The required parameters for updating a server.
  • options - ServersClientBeginUpdateOptions contains the optional parameters for the ServersClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerUpdate.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "testrg", "mysqltestsvc4", armmysql.ServerUpdateParameters{
		Properties: &armmysql.ServerUpdateParametersProperties{
			AdministratorLoginPassword: to.Ptr("<administratorLoginPassword>"),
			SSLEnforcement:             to.Ptr(armmysql.SSLEnforcementEnumDisabled),
		},
	}, 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.Server = armmysql.Server{
	// 	Name: to.Ptr("mysqltestsvc4"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc4"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"ElasticServer": to.Ptr("1"),
	// 	},
	// 	Properties: &armmysql.ServerProperties{
	// 		AdministratorLogin: to.Ptr("cloudsa"),
	// 		EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T18:02:41.577Z"); return t}()),
	// 		FullyQualifiedDomainName: to.Ptr("mysqltestsvc4.mysql.database.azure.com"),
	// 		SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumDisabled),
	// 		StorageProfile: &armmysql.StorageProfile{
	// 			BackupRetentionDays: to.Ptr[int32](7),
	// 			GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled),
	// 			StorageMB: to.Ptr[int32](128000),
	// 		},
	// 		UserVisibleState: to.Ptr(armmysql.ServerStateReady),
	// 		Version: to.Ptr(armmysql.ServerVersionFive7),
	// 	},
	// 	SKU: &armmysql.SKU{
	// 		Name: to.Ptr("GP_Gen4_2"),
	// 		Capacity: to.Ptr[int32](2),
	// 		Family: to.Ptr("Gen4"),
	// 		Tier: to.Ptr(armmysql.SKUTierGeneralPurpose),
	// 	},
	// }
}
Output:

func (*ServersClient) BeginUpgrade

func (client *ServersClient) BeginUpgrade(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpgradeParameters, options *ServersClientBeginUpgradeOptions) (*runtime.Poller[ServersClientUpgradeResponse], error)

BeginUpgrade - Upgrade server version. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-01-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • parameters - The required parameters for updating a server.
  • options - ServersClientBeginUpgradeOptions contains the optional parameters for the ServersClient.BeginUpgrade method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2020-01-01/examples/ServerUpgrade.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServersClient().BeginUpgrade(ctx, "TestGroup", "testserver", armmysql.ServerUpgradeParameters{
		Properties: &armmysql.ServerUpgradeParametersProperties{
			TargetServerVersion: to.Ptr("5.7"),
		},
	}, 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 (*ServersClient) Get

func (client *ServersClient) Get(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientGetOptions) (ServersClientGetResponse, error)

Get - Gets information about a server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - ServersClientGetOptions contains the optional parameters for the ServersClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServersClient().Get(ctx, "testrg", "mysqltestsvc4", 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.Server = armmysql.Server{
	// 	Name: to.Ptr("mysqltestsvc4"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc4"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"ElasticServer": to.Ptr("1"),
	// 	},
	// 	Properties: &armmysql.ServerProperties{
	// 		AdministratorLogin: to.Ptr("cloudsa"),
	// 		EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-14T18:02:41.577Z"); return t}()),
	// 		FullyQualifiedDomainName: to.Ptr("mysqltestsvc4.mysql.database.azure.com"),
	// 		MasterServerID: to.Ptr(""),
	// 		PrivateEndpointConnections: []*armmysql.ServerPrivateEndpointConnection{
	// 			{
	// 				ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc4/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"),
	// 				Properties: &armmysql.ServerPrivateEndpointConnectionProperties{
	// 					PrivateEndpoint: &armmysql.PrivateEndpointProperty{
	// 						ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
	// 					},
	// 					PrivateLinkServiceConnectionState: &armmysql.ServerPrivateLinkServiceConnectionStateProperty{
	// 						Description: to.Ptr("Auto-approved"),
	// 						ActionsRequired: to.Ptr(armmysql.PrivateLinkServiceConnectionStateActionsRequireNone),
	// 						Status: to.Ptr(armmysql.PrivateLinkServiceConnectionStateStatusApproved),
	// 					},
	// 					ProvisioningState: to.Ptr(armmysql.PrivateEndpointProvisioningState("Succeeded")),
	// 				},
	// 		}},
	// 		PublicNetworkAccess: to.Ptr(armmysql.PublicNetworkAccessEnumEnabled),
	// 		ReplicaCapacity: to.Ptr[int32](5),
	// 		ReplicationRole: to.Ptr("None"),
	// 		SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled),
	// 		StorageProfile: &armmysql.StorageProfile{
	// 			BackupRetentionDays: to.Ptr[int32](7),
	// 			GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled),
	// 			StorageMB: to.Ptr[int32](128000),
	// 		},
	// 		UserVisibleState: to.Ptr(armmysql.ServerStateReady),
	// 		Version: to.Ptr(armmysql.ServerVersionFive7),
	// 	},
	// 	SKU: &armmysql.SKU{
	// 		Name: to.Ptr("GP_Gen4_2"),
	// 		Capacity: to.Ptr[int32](2),
	// 		Family: to.Ptr("Gen4"),
	// 		Tier: to.Ptr(armmysql.SKUTierGeneralPurpose),
	// 	},
	// }
}
Output:

func (*ServersClient) NewListByResourceGroupPager added in v0.5.0

func (client *ServersClient) NewListByResourceGroupPager(resourceGroupName string, options *ServersClientListByResourceGroupOptions) *runtime.Pager[ServersClientListByResourceGroupResponse]

NewListByResourceGroupPager - List all the servers in a given resource group.

Generated from API version 2017-12-01

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServersClient().NewListByResourceGroupPager("testrg", 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.ServerListResult = armmysql.ServerListResult{
		// 	Value: []*armmysql.Server{
		// 		{
		// 			Name: to.Ptr("mysqltestsvc1"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armmysql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("testuser"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-07T18:17:35.729Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("mysqltestsvc1.mysql.database.azure.com"),
		// 				PrivateEndpointConnections: []*armmysql.ServerPrivateEndpointConnection{
		// 				},
		// 				PublicNetworkAccess: to.Ptr(armmysql.PublicNetworkAccessEnumEnabled),
		// 				SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled),
		// 				StorageProfile: &armmysql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](7),
		// 					GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupDisabled),
		// 					StorageMB: to.Ptr[int32](5120),
		// 				},
		// 				UserVisibleState: to.Ptr(armmysql.ServerStateReady),
		// 				Version: to.Ptr(armmysql.ServerVersionFive7),
		// 			},
		// 			SKU: &armmysql.SKU{
		// 				Name: to.Ptr("B_Gen4_1"),
		// 				Capacity: to.Ptr[int32](1),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armmysql.SKUTierBasic),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("mysqltstsvc2"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltstsvc2"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armmysql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("testuser"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-07T18:17:35.729Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("mysqltstsvc2.mysql.database.azure.com"),
		// 				PrivateEndpointConnections: []*armmysql.ServerPrivateEndpointConnection{
		// 					{
		// 						ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltstsvc2/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"),
		// 						Properties: &armmysql.ServerPrivateEndpointConnectionProperties{
		// 							PrivateEndpoint: &armmysql.PrivateEndpointProperty{
		// 								ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
		// 							},
		// 							PrivateLinkServiceConnectionState: &armmysql.ServerPrivateLinkServiceConnectionStateProperty{
		// 								Description: to.Ptr("Auto-approved"),
		// 								ActionsRequired: to.Ptr(armmysql.PrivateLinkServiceConnectionStateActionsRequireNone),
		// 								Status: to.Ptr(armmysql.PrivateLinkServiceConnectionStateStatusApproved),
		// 							},
		// 							ProvisioningState: to.Ptr(armmysql.PrivateEndpointProvisioningState("Succeeded")),
		// 						},
		// 				}},
		// 				PublicNetworkAccess: to.Ptr(armmysql.PublicNetworkAccessEnumEnabled),
		// 				SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled),
		// 				StorageProfile: &armmysql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](7),
		// 					GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupDisabled),
		// 					StorageMB: to.Ptr[int32](5120),
		// 				},
		// 				UserVisibleState: to.Ptr(armmysql.ServerStateReady),
		// 				Version: to.Ptr(armmysql.ServerVersionFive7),
		// 			},
		// 			SKU: &armmysql.SKU{
		// 				Name: to.Ptr("GP_Gen4_2"),
		// 				Capacity: to.Ptr[int32](2),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armmysql.SKUTierGeneralPurpose),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ServersClient) NewListPager added in v0.5.0

NewListPager - List all the servers in a given subscription.

Generated from API version 2017-12-01

  • options - ServersClientListOptions contains the optional parameters for the ServersClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/ServerList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServersClient().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.ServerListResult = armmysql.ServerListResult{
		// 	Value: []*armmysql.Server{
		// 		{
		// 			Name: to.Ptr("mysqltestsvc1"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc1"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armmysql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("testuser"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-28T23:56:02.627Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("mysqltestsvc1.mysql.database.azure.com"),
		// 				PrivateEndpointConnections: []*armmysql.ServerPrivateEndpointConnection{
		// 				},
		// 				PublicNetworkAccess: to.Ptr(armmysql.PublicNetworkAccessEnumEnabled),
		// 				SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled),
		// 				StorageProfile: &armmysql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](7),
		// 					GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupDisabled),
		// 					StorageMB: to.Ptr[int32](5120),
		// 				},
		// 				UserVisibleState: to.Ptr(armmysql.ServerStateReady),
		// 				Version: to.Ptr(armmysql.ServerVersionFive7),
		// 			},
		// 			SKU: &armmysql.SKU{
		// 				Name: to.Ptr("B_Gen4_2"),
		// 				Capacity: to.Ptr[int32](2),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armmysql.SKUTierBasic),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("mysqltstsvc2"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltstsvc2"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armmysql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("testuser"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-28T23:56:54.300Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("mysqltstsvc2.mysql.database.azure.com"),
		// 				PrivateEndpointConnections: []*armmysql.ServerPrivateEndpointConnection{
		// 					{
		// 						ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltstsvc2/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"),
		// 						Properties: &armmysql.ServerPrivateEndpointConnectionProperties{
		// 							PrivateEndpoint: &armmysql.PrivateEndpointProperty{
		// 								ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
		// 							},
		// 							PrivateLinkServiceConnectionState: &armmysql.ServerPrivateLinkServiceConnectionStateProperty{
		// 								Description: to.Ptr("Auto-approved"),
		// 								ActionsRequired: to.Ptr(armmysql.PrivateLinkServiceConnectionStateActionsRequireNone),
		// 								Status: to.Ptr(armmysql.PrivateLinkServiceConnectionStateStatusApproved),
		// 							},
		// 							ProvisioningState: to.Ptr(armmysql.PrivateEndpointProvisioningState("Succeeded")),
		// 						},
		// 				}},
		// 				PublicNetworkAccess: to.Ptr(armmysql.PublicNetworkAccessEnumEnabled),
		// 				SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled),
		// 				StorageProfile: &armmysql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](7),
		// 					GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupDisabled),
		// 					StorageMB: to.Ptr[int32](5120),
		// 				},
		// 				UserVisibleState: to.Ptr(armmysql.ServerStateReady),
		// 				Version: to.Ptr(armmysql.ServerVersionFive7),
		// 			},
		// 			SKU: &armmysql.SKU{
		// 				Name: to.Ptr("GP_Gen4_2"),
		// 				Capacity: to.Ptr[int32](2),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armmysql.SKUTierGeneralPurpose),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("mysqltestsvc3"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg1/providers/Microsoft.DBforMySQL/servers/mysqltestsvc3"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armmysql.ServerProperties{
		// 				AdministratorLogin: to.Ptr("testuser"),
		// 				EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-28T23:59:44.847Z"); return t}()),
		// 				FullyQualifiedDomainName: to.Ptr("mysqltestsvc3.mysql.database.azure.com"),
		// 				PrivateEndpointConnections: []*armmysql.ServerPrivateEndpointConnection{
		// 					{
		// 						ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/servers/mysqltestsvc3/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"),
		// 						Properties: &armmysql.ServerPrivateEndpointConnectionProperties{
		// 							PrivateEndpoint: &armmysql.PrivateEndpointProperty{
		// 								ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"),
		// 							},
		// 							PrivateLinkServiceConnectionState: &armmysql.ServerPrivateLinkServiceConnectionStateProperty{
		// 								Description: to.Ptr("Auto-approved"),
		// 								ActionsRequired: to.Ptr(armmysql.PrivateLinkServiceConnectionStateActionsRequireNone),
		// 								Status: to.Ptr(armmysql.PrivateLinkServiceConnectionStateStatusApproved),
		// 							},
		// 							ProvisioningState: to.Ptr(armmysql.PrivateEndpointProvisioningState("Succeeded")),
		// 						},
		// 				}},
		// 				PublicNetworkAccess: to.Ptr(armmysql.PublicNetworkAccessEnumEnabled),
		// 				SSLEnforcement: to.Ptr(armmysql.SSLEnforcementEnumEnabled),
		// 				StorageProfile: &armmysql.StorageProfile{
		// 					BackupRetentionDays: to.Ptr[int32](35),
		// 					GeoRedundantBackup: to.Ptr(armmysql.GeoRedundantBackupEnabled),
		// 					StorageMB: to.Ptr[int32](102400),
		// 				},
		// 				UserVisibleState: to.Ptr(armmysql.ServerStateReady),
		// 				Version: to.Ptr(armmysql.ServerVersionFive7),
		// 			},
		// 			SKU: &armmysql.SKU{
		// 				Name: to.Ptr("GP_Gen4_4"),
		// 				Capacity: to.Ptr[int32](4),
		// 				Family: to.Ptr("Gen4"),
		// 				Tier: to.Ptr(armmysql.SKUTierGeneralPurpose),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ServersClientBeginCreateOptions added in v0.3.0

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

ServersClientBeginCreateOptions contains the optional parameters for the ServersClient.BeginCreate method.

type ServersClientBeginDeleteOptions added in v0.3.0

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

ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method.

type ServersClientBeginRestartOptions added in v0.3.0

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

ServersClientBeginRestartOptions contains the optional parameters for the ServersClient.BeginRestart method.

type ServersClientBeginStartOptions added in v0.3.0

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

ServersClientBeginStartOptions contains the optional parameters for the ServersClient.BeginStart method.

type ServersClientBeginStopOptions added in v0.3.0

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

ServersClientBeginStopOptions contains the optional parameters for the ServersClient.BeginStop method.

type ServersClientBeginUpdateOptions added in v0.3.0

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

ServersClientBeginUpdateOptions contains the optional parameters for the ServersClient.BeginUpdate method.

type ServersClientBeginUpgradeOptions added in v0.3.0

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

ServersClientBeginUpgradeOptions contains the optional parameters for the ServersClient.BeginUpgrade method.

type ServersClientCreateResponse added in v0.3.0

type ServersClientCreateResponse struct {
	// Represents a server.
	Server
}

ServersClientCreateResponse contains the response from method ServersClient.BeginCreate.

type ServersClientDeleteResponse added in v0.3.0

type ServersClientDeleteResponse struct {
}

ServersClientDeleteResponse contains the response from method ServersClient.BeginDelete.

type ServersClientGetOptions added in v0.3.0

type ServersClientGetOptions struct {
}

ServersClientGetOptions contains the optional parameters for the ServersClient.Get method.

type ServersClientGetResponse added in v0.3.0

type ServersClientGetResponse struct {
	// Represents a server.
	Server
}

ServersClientGetResponse contains the response from method ServersClient.Get.

type ServersClientListByResourceGroupOptions added in v0.3.0

type ServersClientListByResourceGroupOptions struct {
}

ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager method.

type ServersClientListByResourceGroupResponse added in v0.3.0

type ServersClientListByResourceGroupResponse struct {
	// A list of servers.
	ServerListResult
}

ServersClientListByResourceGroupResponse contains the response from method ServersClient.NewListByResourceGroupPager.

type ServersClientListOptions added in v0.3.0

type ServersClientListOptions struct {
}

ServersClientListOptions contains the optional parameters for the ServersClient.NewListPager method.

type ServersClientListResponse added in v0.3.0

type ServersClientListResponse struct {
	// A list of servers.
	ServerListResult
}

ServersClientListResponse contains the response from method ServersClient.NewListPager.

type ServersClientRestartResponse added in v0.3.0

type ServersClientRestartResponse struct {
}

ServersClientRestartResponse contains the response from method ServersClient.BeginRestart.

type ServersClientStartResponse added in v0.3.0

type ServersClientStartResponse struct {
}

ServersClientStartResponse contains the response from method ServersClient.BeginStart.

type ServersClientStopResponse added in v0.3.0

type ServersClientStopResponse struct {
}

ServersClientStopResponse contains the response from method ServersClient.BeginStop.

type ServersClientUpdateResponse added in v0.3.0

type ServersClientUpdateResponse struct {
	// Represents a server.
	Server
}

ServersClientUpdateResponse contains the response from method ServersClient.BeginUpdate.

type ServersClientUpgradeResponse added in v0.3.0

type ServersClientUpgradeResponse struct {
}

ServersClientUpgradeResponse contains the response from method ServersClient.BeginUpgrade.

type StorageAutogrow

type StorageAutogrow string

StorageAutogrow - Enable Storage Auto Grow.

const (
	StorageAutogrowDisabled StorageAutogrow = "Disabled"
	StorageAutogrowEnabled  StorageAutogrow = "Enabled"
)

func PossibleStorageAutogrowValues

func PossibleStorageAutogrowValues() []StorageAutogrow

PossibleStorageAutogrowValues returns the possible values for the StorageAutogrow const type.

type StorageProfile

type StorageProfile struct {
	// Backup retention days for the server.
	BackupRetentionDays *int32

	// Enable Geo-redundant or not for server backup.
	GeoRedundantBackup *GeoRedundantBackup

	// Enable Storage Auto Grow.
	StorageAutogrow *StorageAutogrow

	// Max storage allowed for a server.
	StorageMB *int32
}

StorageProfile - Storage Profile properties of a server

func (StorageProfile) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type StorageProfile.

func (*StorageProfile) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type StorageProfile.

type TagsObject

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

TagsObject - Tags object for patch operations.

func (TagsObject) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TagsObject.

func (*TagsObject) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagsObject.

type TopQueryStatisticsClient

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

TopQueryStatisticsClient contains the methods for the TopQueryStatistics group. Don't use this type directly, use NewTopQueryStatisticsClient() instead.

func NewTopQueryStatisticsClient

func NewTopQueryStatisticsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TopQueryStatisticsClient, error)

NewTopQueryStatisticsClient creates a new instance of TopQueryStatisticsClient with the specified values.

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

func (*TopQueryStatisticsClient) Get

func (client *TopQueryStatisticsClient) Get(ctx context.Context, resourceGroupName string, serverName string, queryStatisticID string, options *TopQueryStatisticsClientGetOptions) (TopQueryStatisticsClientGetResponse, error)

Get - Retrieve the query statistic for specified identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • queryStatisticID - The Query Statistic identifier.
  • options - TopQueryStatisticsClientGetOptions contains the optional parameters for the TopQueryStatisticsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/TopQueryStatisticsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTopQueryStatisticsClient().Get(ctx, "testResourceGroupName", "testServerName", "66-636923268000000000-636923277000000000-avg-duration", 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.QueryStatistic = armmysql.QueryStatistic{
	// 	Name: to.Ptr("66-636923268000000000-636923277000000000-avg-duration"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/queryStatistics"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/queryStatistic/66-636923268000000000-636923277000000000-avg-duration"),
	// 	Properties: &armmysql.QueryStatisticProperties{
	// 		AggregationFunction: to.Ptr("avg"),
	// 		DatabaseNames: []*string{
	// 			to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/databases/mysql")},
	// 			EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T17:15:00.000Z"); return t}()),
	// 			MetricDisplayName: to.Ptr("Query duration"),
	// 			MetricName: to.Ptr("duration"),
	// 			MetricValue: to.Ptr[float64](123.301446136),
	// 			MetricValueUnit: to.Ptr("milliseconds"),
	// 			QueryExecutionCount: to.Ptr[int64](1),
	// 			QueryID: to.Ptr("66"),
	// 			StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T17:00:00.000Z"); return t}()),
	// 		},
	// 	}
}
Output:

func (*TopQueryStatisticsClient) NewListByServerPager added in v0.5.0

NewListByServerPager - Retrieve the Query-Store top queries for specified metric and aggregation.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • parameters - The required parameters for retrieving top query statistics.
  • options - TopQueryStatisticsClientListByServerOptions contains the optional parameters for the TopQueryStatisticsClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/TopQueryStatisticsListByServer.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTopQueryStatisticsClient().NewListByServerPager("testResourceGroupName", "testServerName", armmysql.TopQueryStatisticsInput{
		Properties: &armmysql.TopQueryStatisticsInputProperties{
			AggregationFunction:  to.Ptr("avg"),
			AggregationWindow:    to.Ptr("PT15M"),
			NumberOfTopQueries:   to.Ptr[int32](5),
			ObservationEndTime:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T20:00:00.000Z"); return t }()),
			ObservationStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T20:00:00.000Z"); return t }()),
			ObservedMetric:       to.Ptr("duration"),
		},
	}, 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.TopQueryStatisticsResultList = armmysql.TopQueryStatisticsResultList{
		// 	Value: []*armmysql.QueryStatistic{
		// 		{
		// 			Name: to.Ptr("66-636923268000000000-636923277000000000-avg-duration"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/queryStatistics"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/queryStatistic/66-636923268000000000-636923277000000000-avg-duration"),
		// 			Properties: &armmysql.QueryStatisticProperties{
		// 				AggregationFunction: to.Ptr("avg"),
		// 				DatabaseNames: []*string{
		// 					to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/databases/mysql")},
		// 					EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T17:15:00.000Z"); return t}()),
		// 					MetricDisplayName: to.Ptr("Query duration"),
		// 					MetricName: to.Ptr("duration"),
		// 					MetricValue: to.Ptr[float64](123.301446136),
		// 					MetricValueUnit: to.Ptr("milliseconds"),
		// 					QueryExecutionCount: to.Ptr[int64](1),
		// 					QueryID: to.Ptr("66"),
		// 					StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T17:00:00.000Z"); return t}()),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("66-636924483000000000-636924492000000000-avg-duration"),
		// 				Type: to.Ptr("Microsoft.DBforMySQL/servers/queryStatistics"),
		// 				ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/queryStatistic/66-636924483000000000-636924492000000000-avg-duration"),
		// 				Properties: &armmysql.QueryStatisticProperties{
		// 					AggregationFunction: to.Ptr("avg"),
		// 					DatabaseNames: []*string{
		// 						to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/databases/mysql")},
		// 						EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-03T03:00:00.000Z"); return t}()),
		// 						MetricDisplayName: to.Ptr("Query duration"),
		// 						MetricName: to.Ptr("duration"),
		// 						MetricValue: to.Ptr[float64](1712.301446136),
		// 						MetricValueUnit: to.Ptr("milliseconds"),
		// 						QueryExecutionCount: to.Ptr[int64](1),
		// 						QueryID: to.Ptr("66"),
		// 						StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-03T02:45:00.000Z"); return t}()),
		// 					},
		// 			}},
		// 		}
	}
}
Output:

type TopQueryStatisticsClientGetOptions added in v0.3.0

type TopQueryStatisticsClientGetOptions struct {
}

TopQueryStatisticsClientGetOptions contains the optional parameters for the TopQueryStatisticsClient.Get method.

type TopQueryStatisticsClientGetResponse added in v0.3.0

type TopQueryStatisticsClientGetResponse struct {
	// Represents a Query Statistic.
	QueryStatistic
}

TopQueryStatisticsClientGetResponse contains the response from method TopQueryStatisticsClient.Get.

type TopQueryStatisticsClientListByServerOptions added in v0.3.0

type TopQueryStatisticsClientListByServerOptions struct {
}

TopQueryStatisticsClientListByServerOptions contains the optional parameters for the TopQueryStatisticsClient.NewListByServerPager method.

type TopQueryStatisticsClientListByServerResponse added in v0.3.0

type TopQueryStatisticsClientListByServerResponse struct {
	// A list of query statistics.
	TopQueryStatisticsResultList
}

TopQueryStatisticsClientListByServerResponse contains the response from method TopQueryStatisticsClient.NewListByServerPager.

type TopQueryStatisticsInput

type TopQueryStatisticsInput struct {
	// REQUIRED; The properties of a wait statistics input.
	Properties *TopQueryStatisticsInputProperties
}

TopQueryStatisticsInput - Input to get top query statistics

func (TopQueryStatisticsInput) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type TopQueryStatisticsInput.

func (*TopQueryStatisticsInput) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TopQueryStatisticsInput.

type TopQueryStatisticsInputProperties

type TopQueryStatisticsInputProperties struct {
	// REQUIRED; Aggregation function name.
	AggregationFunction *string

	// REQUIRED; Aggregation interval type in ISO 8601 format.
	AggregationWindow *string

	// REQUIRED; Max number of top queries to return.
	NumberOfTopQueries *int32

	// REQUIRED; Observation end time.
	ObservationEndTime *time.Time

	// REQUIRED; Observation start time.
	ObservationStartTime *time.Time

	// REQUIRED; Observed metric name.
	ObservedMetric *string
}

TopQueryStatisticsInputProperties - The properties for input to get top query statistics

func (TopQueryStatisticsInputProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TopQueryStatisticsInputProperties.

func (*TopQueryStatisticsInputProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type TopQueryStatisticsInputProperties.

type TopQueryStatisticsResultList

type TopQueryStatisticsResultList struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string

	// READ-ONLY; The list of top query statistics.
	Value []*QueryStatistic
}

TopQueryStatisticsResultList - A list of query statistics.

func (TopQueryStatisticsResultList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TopQueryStatisticsResultList.

func (*TopQueryStatisticsResultList) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TopQueryStatisticsResultList.

type TrackedResource

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

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'

func (TrackedResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TrackedResource.

func (*TrackedResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.

type VirtualNetworkRule

type VirtualNetworkRule struct {
	// Resource properties.
	Properties *VirtualNetworkRuleProperties

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

VirtualNetworkRule - A virtual network rule.

func (VirtualNetworkRule) MarshalJSON

func (v VirtualNetworkRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRule.

func (*VirtualNetworkRule) UnmarshalJSON added in v1.1.0

func (v *VirtualNetworkRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRule.

type VirtualNetworkRuleListResult

type VirtualNetworkRuleListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string

	// READ-ONLY; Array of results.
	Value []*VirtualNetworkRule
}

VirtualNetworkRuleListResult - A list of virtual network rules.

func (VirtualNetworkRuleListResult) MarshalJSON

func (v VirtualNetworkRuleListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleListResult.

func (*VirtualNetworkRuleListResult) UnmarshalJSON added in v1.1.0

func (v *VirtualNetworkRuleListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRuleListResult.

type VirtualNetworkRuleProperties

type VirtualNetworkRuleProperties struct {
	// REQUIRED; The ARM resource id of the virtual network subnet.
	VirtualNetworkSubnetID *string

	// Create firewall rule before the virtual network has vnet service endpoint enabled.
	IgnoreMissingVnetServiceEndpoint *bool

	// READ-ONLY; Virtual Network Rule State
	State *VirtualNetworkRuleState
}

VirtualNetworkRuleProperties - Properties of a virtual network rule.

func (VirtualNetworkRuleProperties) MarshalJSON added in v1.1.0

func (v VirtualNetworkRuleProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleProperties.

func (*VirtualNetworkRuleProperties) UnmarshalJSON added in v1.1.0

func (v *VirtualNetworkRuleProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRuleProperties.

type VirtualNetworkRuleState

type VirtualNetworkRuleState string

VirtualNetworkRuleState - Virtual Network Rule State

const (
	VirtualNetworkRuleStateDeleting     VirtualNetworkRuleState = "Deleting"
	VirtualNetworkRuleStateInProgress   VirtualNetworkRuleState = "InProgress"
	VirtualNetworkRuleStateInitializing VirtualNetworkRuleState = "Initializing"
	VirtualNetworkRuleStateReady        VirtualNetworkRuleState = "Ready"
	VirtualNetworkRuleStateUnknown      VirtualNetworkRuleState = "Unknown"
)

func PossibleVirtualNetworkRuleStateValues

func PossibleVirtualNetworkRuleStateValues() []VirtualNetworkRuleState

PossibleVirtualNetworkRuleStateValues returns the possible values for the VirtualNetworkRuleState const type.

type VirtualNetworkRulesClient

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

VirtualNetworkRulesClient contains the methods for the VirtualNetworkRules group. Don't use this type directly, use NewVirtualNetworkRulesClient() instead.

func NewVirtualNetworkRulesClient

func NewVirtualNetworkRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkRulesClient, error)

NewVirtualNetworkRulesClient creates a new instance of VirtualNetworkRulesClient with the specified values.

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

func (*VirtualNetworkRulesClient) BeginCreateOrUpdate

func (client *VirtualNetworkRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule, options *VirtualNetworkRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworkRulesClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates an existing virtual network rule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • virtualNetworkRuleName - The name of the virtual network rule.
  • parameters - The requested virtual Network Rule Resource state.
  • options - VirtualNetworkRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/VirtualNetworkRulesCreateOrUpdate.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/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualNetworkRulesClient().BeginCreateOrUpdate(ctx, "TestGroup", "vnet-test-svr", "vnet-firewall-rule", armmysql.VirtualNetworkRule{
		Properties: &armmysql.VirtualNetworkRuleProperties{
			IgnoreMissingVnetServiceEndpoint: to.Ptr(false),
			VirtualNetworkSubnetID:           to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"),
		},
	}, 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.VirtualNetworkRule = armmysql.VirtualNetworkRule{
	// 	Name: to.Ptr("vnet-firewall-rule"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/virtualNetworkRules"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"),
	// 	Properties: &armmysql.VirtualNetworkRuleProperties{
	// 		IgnoreMissingVnetServiceEndpoint: to.Ptr(false),
	// 		VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"),
	// 	},
	// }
}
Output:

func (*VirtualNetworkRulesClient) BeginDelete

func (client *VirtualNetworkRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkRulesClientDeleteResponse], error)

BeginDelete - Deletes the virtual network rule with the given name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • virtualNetworkRuleName - The name of the virtual network rule.
  • options - VirtualNetworkRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/VirtualNetworkRulesDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualNetworkRulesClient().BeginDelete(ctx, "TestGroup", "vnet-test-svr", "vnet-firewall-rule", 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 (*VirtualNetworkRulesClient) Get

func (client *VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientGetOptions) (VirtualNetworkRulesClientGetResponse, error)

Get - Gets a virtual network rule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • virtualNetworkRuleName - The name of the virtual network rule.
  • options - VirtualNetworkRulesClientGetOptions contains the optional parameters for the VirtualNetworkRulesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/VirtualNetworkRulesGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualNetworkRulesClient().Get(ctx, "TestGroup", "vnet-test-svr", "vnet-firewall-rule", 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.VirtualNetworkRule = armmysql.VirtualNetworkRule{
	// 	Name: to.Ptr("vnet-firewall-rule"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/virtualNetworkRules"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"),
	// 	Properties: &armmysql.VirtualNetworkRuleProperties{
	// 		IgnoreMissingVnetServiceEndpoint: to.Ptr(false),
	// 		State: to.Ptr(armmysql.VirtualNetworkRuleStateReady),
	// 		VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"),
	// 	},
	// }
}
Output:

func (*VirtualNetworkRulesClient) NewListByServerPager added in v0.5.0

NewListByServerPager - Gets a list of virtual network rules in a server.

Generated from API version 2017-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • options - VirtualNetworkRulesClientListByServerOptions contains the optional parameters for the VirtualNetworkRulesClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2017-12-01/examples/VirtualNetworkRulesList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualNetworkRulesClient().NewListByServerPager("TestGroup", "vnet-test-svr", 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.VirtualNetworkRuleListResult = armmysql.VirtualNetworkRuleListResult{
		// 	Value: []*armmysql.VirtualNetworkRule{
		// 		{
		// 			Name: to.Ptr("vnet-firewall-rule"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/virtualNetworkRules"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"),
		// 			Properties: &armmysql.VirtualNetworkRuleProperties{
		// 				IgnoreMissingVnetServiceEndpoint: to.Ptr(false),
		// 				State: to.Ptr(armmysql.VirtualNetworkRuleStateReady),
		// 				VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("vnet-firewall-rule"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/virtualNetworkRules"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforMySQL/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"),
		// 			Properties: &armmysql.VirtualNetworkRuleProperties{
		// 				IgnoreMissingVnetServiceEndpoint: to.Ptr(false),
		// 				State: to.Ptr(armmysql.VirtualNetworkRuleStateReady),
		// 				VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type VirtualNetworkRulesClientBeginCreateOrUpdateOptions added in v0.3.0

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

VirtualNetworkRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginCreateOrUpdate method.

type VirtualNetworkRulesClientBeginDeleteOptions added in v0.3.0

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

VirtualNetworkRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginDelete method.

type VirtualNetworkRulesClientCreateOrUpdateResponse added in v0.3.0

type VirtualNetworkRulesClientCreateOrUpdateResponse struct {
	// A virtual network rule.
	VirtualNetworkRule
}

VirtualNetworkRulesClientCreateOrUpdateResponse contains the response from method VirtualNetworkRulesClient.BeginCreateOrUpdate.

type VirtualNetworkRulesClientDeleteResponse added in v0.3.0

type VirtualNetworkRulesClientDeleteResponse struct {
}

VirtualNetworkRulesClientDeleteResponse contains the response from method VirtualNetworkRulesClient.BeginDelete.

type VirtualNetworkRulesClientGetOptions added in v0.3.0

type VirtualNetworkRulesClientGetOptions struct {
}

VirtualNetworkRulesClientGetOptions contains the optional parameters for the VirtualNetworkRulesClient.Get method.

type VirtualNetworkRulesClientGetResponse added in v0.3.0

type VirtualNetworkRulesClientGetResponse struct {
	// A virtual network rule.
	VirtualNetworkRule
}

VirtualNetworkRulesClientGetResponse contains the response from method VirtualNetworkRulesClient.Get.

type VirtualNetworkRulesClientListByServerOptions added in v0.3.0

type VirtualNetworkRulesClientListByServerOptions struct {
}

VirtualNetworkRulesClientListByServerOptions contains the optional parameters for the VirtualNetworkRulesClient.NewListByServerPager method.

type VirtualNetworkRulesClientListByServerResponse added in v0.3.0

type VirtualNetworkRulesClientListByServerResponse struct {
	// A list of virtual network rules.
	VirtualNetworkRuleListResult
}

VirtualNetworkRulesClientListByServerResponse contains the response from method VirtualNetworkRulesClient.NewListByServerPager.

type WaitStatistic

type WaitStatistic struct {
	// The properties of a wait statistic.
	Properties *WaitStatisticProperties

	// 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

WaitStatistic - Represents a Wait Statistic.

func (WaitStatistic) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type WaitStatistic.

func (*WaitStatistic) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type WaitStatistic.

type WaitStatisticProperties

type WaitStatisticProperties struct {
	// Wait event count observed in this time interval.
	Count *int64

	// Database Name.
	DatabaseName *string

	// Observation end time.
	EndTime *time.Time

	// Wait event name.
	EventName *string

	// Wait event type name.
	EventTypeName *string

	// Database query identifier.
	QueryID *int64

	// Observation start time.
	StartTime *time.Time

	// Total time of wait in milliseconds in this time interval.
	TotalTimeInMs *float64

	// Database user identifier.
	UserID *int64
}

WaitStatisticProperties - The properties of a wait statistic.

func (WaitStatisticProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type WaitStatisticProperties.

func (*WaitStatisticProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type WaitStatisticProperties.

type WaitStatisticsClient

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

WaitStatisticsClient contains the methods for the WaitStatistics group. Don't use this type directly, use NewWaitStatisticsClient() instead.

func NewWaitStatisticsClient

func NewWaitStatisticsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WaitStatisticsClient, error)

NewWaitStatisticsClient creates a new instance of WaitStatisticsClient with the specified values.

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

func (*WaitStatisticsClient) Get

func (client *WaitStatisticsClient) Get(ctx context.Context, resourceGroupName string, serverName string, waitStatisticsID string, options *WaitStatisticsClientGetOptions) (WaitStatisticsClientGetResponse, error)

Get - Retrieve wait statistics for specified identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • waitStatisticsID - The Wait Statistic identifier.
  • options - WaitStatisticsClientGetOptions contains the optional parameters for the WaitStatisticsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/WaitStatisticsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWaitStatisticsClient().Get(ctx, "testResourceGroupName", "testServerName", "636927606000000000-636927615000000000-send-wait/io/socket/sql/client_connection-2--0", 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.WaitStatistic = armmysql.WaitStatistic{
	// 	Name: to.Ptr("636927606000000000-636927615000000000-send-wait/io/socket/sql/client_connection-2--0"),
	// 	Type: to.Ptr("Microsoft.DBforMySQL/servers/waitStatistics"),
	// 	ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/waitStatistics/636927606000000000-636927615000000000-send-wait/io/socket/sql/client_connection-2--0"),
	// 	Properties: &armmysql.WaitStatisticProperties{
	// 		Count: to.Ptr[int64](3),
	// 		DatabaseName: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/databases/mysql"),
	// 		EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-06T17:45:00.000Z"); return t}()),
	// 		EventName: to.Ptr("wait/io/socket/sql/client_connection"),
	// 		EventTypeName: to.Ptr("send"),
	// 		QueryID: to.Ptr[int64](2),
	// 		StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-06T17:30:00.000Z"); return t}()),
	// 		TotalTimeInMs: to.Ptr[float64](12.345),
	// 		UserID: to.Ptr[int64](0),
	// 	},
	// }
}
Output:

func (*WaitStatisticsClient) NewListByServerPager added in v0.5.0

func (client *WaitStatisticsClient) NewListByServerPager(resourceGroupName string, serverName string, parameters WaitStatisticsInput, options *WaitStatisticsClientListByServerOptions) *runtime.Pager[WaitStatisticsClientListByServerResponse]

NewListByServerPager - Retrieve wait statistics for specified aggregation window.

Generated from API version 2018-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serverName - The name of the server.
  • parameters - The required parameters for retrieving wait statistics.
  • options - WaitStatisticsClientListByServerOptions contains the optional parameters for the WaitStatisticsClient.NewListByServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mysql/resource-manager/Microsoft.DBforMySQL/stable/2018-06-01/examples/WaitStatisticsListByServer.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmysql.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewWaitStatisticsClient().NewListByServerPager("testResourceGroupName", "testServerName", armmysql.WaitStatisticsInput{
		Properties: &armmysql.WaitStatisticsInputProperties{
			AggregationWindow:    to.Ptr("PT15M"),
			ObservationEndTime:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T20:00:00.000Z"); return t }()),
			ObservationStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T20:00:00.000Z"); return t }()),
		},
	}, 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.WaitStatisticsResultList = armmysql.WaitStatisticsResultList{
		// 	Value: []*armmysql.WaitStatistic{
		// 		{
		// 			Name: to.Ptr("636927606000000000-636927615000000000-send-wait/io/socket/sql/client_connection-2--0"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/waitStatistics"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/waitStatistics/636927606000000000-636927615000000000-send-wait/io/socket/sql/client_connection-2--0"),
		// 			Properties: &armmysql.WaitStatisticProperties{
		// 				Count: to.Ptr[int64](2),
		// 				DatabaseName: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforMySQL/servers/testServerName/databases/mysql"),
		// 				EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-06T17:45:00.000Z"); return t}()),
		// 				EventName: to.Ptr("wait/io/socket/sql/client_connection"),
		// 				EventTypeName: to.Ptr("send"),
		// 				QueryID: to.Ptr[int64](2),
		// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-06T17:30:00.000Z"); return t}()),
		// 				TotalTimeInMs: to.Ptr[float64](12.345),
		// 				UserID: to.Ptr[int64](0),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("636927606000000000-636927615000000000-lock-wait/synch/mutex/mysys/THR_LOCK::mutex-2--0"),
		// 			Type: to.Ptr("Microsoft.DBforMySQL/servers/waitStatistics"),
		// 			ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/hyshim-test/providers/Microsoft.DBforMySQL/servers/hyshim-wait-stats-fix/waitStatistics/636927606000000000-636927615000000000-lock-wait/synch/mutex/mysys/THR_LOCK::mutex-2--0"),
		// 			Properties: &armmysql.WaitStatisticProperties{
		// 				Count: to.Ptr[int64](4),
		// 				DatabaseName: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/hyshim-test/providers/Microsoft.DBforMySQL/servers/hyshim-wait-stats-fix/databases/"),
		// 				EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-06T17:45:00.000Z"); return t}()),
		// 				EventName: to.Ptr("wait/synch/mutex/mysys/THR_LOCK::mutex"),
		// 				EventTypeName: to.Ptr("lock"),
		// 				QueryID: to.Ptr[int64](2),
		// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-06T17:30:00.000Z"); return t}()),
		// 				TotalTimeInMs: to.Ptr[float64](56.789),
		// 				UserID: to.Ptr[int64](0),
		// 			},
		// 	}},
		// }
	}
}
Output:

type WaitStatisticsClientGetOptions added in v0.3.0

type WaitStatisticsClientGetOptions struct {
}

WaitStatisticsClientGetOptions contains the optional parameters for the WaitStatisticsClient.Get method.

type WaitStatisticsClientGetResponse added in v0.3.0

type WaitStatisticsClientGetResponse struct {
	// Represents a Wait Statistic.
	WaitStatistic
}

WaitStatisticsClientGetResponse contains the response from method WaitStatisticsClient.Get.

type WaitStatisticsClientListByServerOptions added in v0.3.0

type WaitStatisticsClientListByServerOptions struct {
}

WaitStatisticsClientListByServerOptions contains the optional parameters for the WaitStatisticsClient.NewListByServerPager method.

type WaitStatisticsClientListByServerResponse added in v0.3.0

type WaitStatisticsClientListByServerResponse struct {
	// A list of wait statistics.
	WaitStatisticsResultList
}

WaitStatisticsClientListByServerResponse contains the response from method WaitStatisticsClient.NewListByServerPager.

type WaitStatisticsInput

type WaitStatisticsInput struct {
	// REQUIRED; The properties of a wait statistics input.
	Properties *WaitStatisticsInputProperties
}

WaitStatisticsInput - Input to get wait statistics

func (WaitStatisticsInput) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type WaitStatisticsInput.

func (*WaitStatisticsInput) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type WaitStatisticsInput.

type WaitStatisticsInputProperties

type WaitStatisticsInputProperties struct {
	// REQUIRED; Aggregation interval type in ISO 8601 format.
	AggregationWindow *string

	// REQUIRED; Observation end time.
	ObservationEndTime *time.Time

	// REQUIRED; Observation start time.
	ObservationStartTime *time.Time
}

WaitStatisticsInputProperties - The properties for input to get wait statistics

func (WaitStatisticsInputProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type WaitStatisticsInputProperties.

func (*WaitStatisticsInputProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type WaitStatisticsInputProperties.

type WaitStatisticsResultList

type WaitStatisticsResultList struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string

	// READ-ONLY; The list of wait statistics.
	Value []*WaitStatistic
}

WaitStatisticsResultList - A list of wait statistics.

func (WaitStatisticsResultList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type WaitStatisticsResultList.

func (*WaitStatisticsResultList) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type WaitStatisticsResultList.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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