armsqlvirtualmachine

package module
v0.0.0-...-45adee8 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 14 Imported by: 0

README

Azure SQL Server on Azure Virtual Machines Module for Go

The armsqlvirtualmachine module provides operations for working with Azure SQL Server on Azure Virtual Machines.

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 SQL Server on Azure Virtual Machines module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure SQL Server on Azure Virtual Machines. 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 SQL Server on Azure Virtual Machines 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 := armsqlvirtualmachine.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 := armsqlvirtualmachine.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.NewSQLVirtualMachinesClient()

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 SQL Server on Azure Virtual Machines 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 AADAuthenticationSettings

type AADAuthenticationSettings struct {
	// The client Id of the Managed Identity to query Microsoft Graph API. An empty string must be used for the system assigned
	// Managed Identity
	ClientID *string
}

AADAuthenticationSettings - Enable AAD authentication for SQL VM.

func (AADAuthenticationSettings) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AADAuthenticationSettings.

func (*AADAuthenticationSettings) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AADAuthenticationSettings.

type AdditionalFeaturesServerConfigurations

type AdditionalFeaturesServerConfigurations struct {
	// Enable or disable R services (SQL 2016 onwards).
	IsRServicesEnabled *bool
}

AdditionalFeaturesServerConfigurations - Additional SQL Server feature settings.

func (AdditionalFeaturesServerConfigurations) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AdditionalFeaturesServerConfigurations.

func (*AdditionalFeaturesServerConfigurations) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalFeaturesServerConfigurations.

type AgConfiguration

type AgConfiguration struct {
	// Replica configurations.
	Replicas []*AgReplica
}

AgConfiguration - Availability group configuration.

func (AgConfiguration) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AgConfiguration.

func (*AgConfiguration) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AgConfiguration.

type AgReplica

type AgReplica struct {
	// Replica commit mode in availability group.
	Commit *Commit

	// Replica failover mode in availability group.
	Failover *Failover

	// Replica readable secondary mode in availability group.
	ReadableSecondary *ReadableSecondary

	// Replica Role in availability group.
	Role *Role

	// Sql VirtualMachine Instance Id.
	SQLVirtualMachineInstanceID *string
}

AgReplica - Availability group replica configuration.

func (AgReplica) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AgReplica.

func (*AgReplica) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AgReplica.

type AssessmentDayOfWeek

type AssessmentDayOfWeek string

AssessmentDayOfWeek - Day of the week to run assessment.

const (
	AssessmentDayOfWeekFriday    AssessmentDayOfWeek = "Friday"
	AssessmentDayOfWeekMonday    AssessmentDayOfWeek = "Monday"
	AssessmentDayOfWeekSaturday  AssessmentDayOfWeek = "Saturday"
	AssessmentDayOfWeekSunday    AssessmentDayOfWeek = "Sunday"
	AssessmentDayOfWeekThursday  AssessmentDayOfWeek = "Thursday"
	AssessmentDayOfWeekTuesday   AssessmentDayOfWeek = "Tuesday"
	AssessmentDayOfWeekWednesday AssessmentDayOfWeek = "Wednesday"
)

func PossibleAssessmentDayOfWeekValues

func PossibleAssessmentDayOfWeekValues() []AssessmentDayOfWeek

PossibleAssessmentDayOfWeekValues returns the possible values for the AssessmentDayOfWeek const type.

type AssessmentSettings

type AssessmentSettings struct {
	// Enable or disable SQL best practices Assessment feature on SQL virtual machine.
	Enable *bool

	// Run SQL best practices Assessment immediately on SQL virtual machine.
	RunImmediately *bool

	// Schedule for SQL best practices Assessment.
	Schedule *Schedule
}

AssessmentSettings - Configure SQL best practices Assessment for databases in your SQL virtual machine.

func (AssessmentSettings) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AssessmentSettings.

func (*AssessmentSettings) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AssessmentSettings.

type AutoBackupDaysOfWeek

type AutoBackupDaysOfWeek string
const (
	AutoBackupDaysOfWeekFriday    AutoBackupDaysOfWeek = "Friday"
	AutoBackupDaysOfWeekMonday    AutoBackupDaysOfWeek = "Monday"
	AutoBackupDaysOfWeekSaturday  AutoBackupDaysOfWeek = "Saturday"
	AutoBackupDaysOfWeekSunday    AutoBackupDaysOfWeek = "Sunday"
	AutoBackupDaysOfWeekThursday  AutoBackupDaysOfWeek = "Thursday"
	AutoBackupDaysOfWeekTuesday   AutoBackupDaysOfWeek = "Tuesday"
	AutoBackupDaysOfWeekWednesday AutoBackupDaysOfWeek = "Wednesday"
)

func PossibleAutoBackupDaysOfWeekValues

func PossibleAutoBackupDaysOfWeekValues() []AutoBackupDaysOfWeek

PossibleAutoBackupDaysOfWeekValues returns the possible values for the AutoBackupDaysOfWeek const type.

type AutoBackupSettings

type AutoBackupSettings struct {
	// Backup schedule type.
	BackupScheduleType *BackupScheduleType

	// Include or exclude system databases from auto backup.
	BackupSystemDbs *bool

	// Days of the week for the backups when FullBackupFrequency is set to Weekly.
	DaysOfWeek []*AutoBackupDaysOfWeek

	// Enable or disable autobackup on SQL virtual machine.
	Enable *bool

	// Enable or disable encryption for backup on SQL virtual machine.
	EnableEncryption *bool

	// Frequency of full backups. In both cases, full backups begin during the next scheduled time window.
	FullBackupFrequency *FullBackupFrequencyType

	// Start time of a given day during which full backups can take place. 0-23 hours.
	FullBackupStartTime *int32

	// Duration of the time window of a given day during which full backups can take place. 1-23 hours.
	FullBackupWindowHours *int32

	// Frequency of log backups. 5-60 minutes.
	LogBackupFrequency *int32

	// Password for encryption on backup.
	Password *string

	// Retention period of backup: 1-90 days.
	RetentionPeriod *int32

	// Storage account key where backup will be taken to.
	StorageAccessKey *string

	// Storage account url where backup will be taken to.
	StorageAccountURL *string

	// Storage container name where backup will be taken to.
	StorageContainerName *string
}

AutoBackupSettings - Configure backups for databases in your SQL virtual machine.

func (AutoBackupSettings) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AutoBackupSettings.

func (*AutoBackupSettings) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AutoBackupSettings.

type AutoPatchingSettings

type AutoPatchingSettings struct {
	// Day of week to apply the patch on.
	DayOfWeek *DayOfWeek

	// Enable or disable autopatching on SQL virtual machine.
	Enable *bool

	// Duration of patching.
	MaintenanceWindowDuration *int32

	// Hour of the day when patching is initiated. Local VM time.
	MaintenanceWindowStartingHour *int32
}

AutoPatchingSettings - Set a patching window during which Windows and SQL patches will be applied.

func (AutoPatchingSettings) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AutoPatchingSettings.

func (*AutoPatchingSettings) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AutoPatchingSettings.

type AvailabilityGroupListener

type AvailabilityGroupListener struct {
	// Resource properties.
	Properties *AvailabilityGroupListenerProperties

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

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

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

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

AvailabilityGroupListener - A SQL Server availability group listener.

func (AvailabilityGroupListener) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AvailabilityGroupListener.

func (*AvailabilityGroupListener) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilityGroupListener.

type AvailabilityGroupListenerListResult

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

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

AvailabilityGroupListenerListResult - A list of availability group listeners.

func (AvailabilityGroupListenerListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AvailabilityGroupListenerListResult.

func (*AvailabilityGroupListenerListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilityGroupListenerListResult.

type AvailabilityGroupListenerProperties

type AvailabilityGroupListenerProperties struct {
	// Availability Group configuration.
	AvailabilityGroupConfiguration *AgConfiguration

	// Name of the availability group.
	AvailabilityGroupName *string

	// Create a default availability group if it does not exist.
	CreateDefaultAvailabilityGroupIfNotExist *bool

	// List of load balancer configurations for an availability group listener.
	LoadBalancerConfigurations []*LoadBalancerConfiguration

	// List of multi subnet IP configurations for an AG listener.
	MultiSubnetIPConfigurations []*MultiSubnetIPConfiguration

	// Listener port.
	Port *int32

	// READ-ONLY; Provisioning state to track the async operation status.
	ProvisioningState *string
}

AvailabilityGroupListenerProperties - The properties of an availability group listener.

func (AvailabilityGroupListenerProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AvailabilityGroupListenerProperties.

func (*AvailabilityGroupListenerProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilityGroupListenerProperties.

type AvailabilityGroupListenersClient

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

AvailabilityGroupListenersClient contains the methods for the AvailabilityGroupListeners group. Don't use this type directly, use NewAvailabilityGroupListenersClient() instead.

func NewAvailabilityGroupListenersClient

func NewAvailabilityGroupListenersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailabilityGroupListenersClient, error)

NewAvailabilityGroupListenersClient creates a new instance of AvailabilityGroupListenersClient with the specified values.

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

func (*AvailabilityGroupListenersClient) BeginCreateOrUpdate

func (client *AvailabilityGroupListenersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, availabilityGroupListenerName string, parameters AvailabilityGroupListener, options *AvailabilityGroupListenersClientBeginCreateOrUpdateOptions) (*runtime.Poller[AvailabilityGroupListenersClientCreateOrUpdateResponse], error)

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

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineGroupName - Name of the SQL virtual machine group.
  • availabilityGroupListenerName - Name of the availability group listener.
  • parameters - The availability group listener.
  • options - AvailabilityGroupListenersClientBeginCreateOrUpdateOptions contains the optional parameters for the AvailabilityGroupListenersClient.BeginCreateOrUpdate method.
Example (CreatesOrUpdatesAnAvailabilityGroupListenerThisIsUsedForVMsPresentInMultiSubnet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateAvailabilityGroupListenerWithMultiSubnet.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/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAvailabilityGroupListenersClient().BeginCreateOrUpdate(ctx, "testrg", "testvmgroup", "agl-test", armsqlvirtualmachine.AvailabilityGroupListener{
		Properties: &armsqlvirtualmachine.AvailabilityGroupListenerProperties{
			AvailabilityGroupName: to.Ptr("ag-test"),
			MultiSubnetIPConfigurations: []*armsqlvirtualmachine.MultiSubnetIPConfiguration{
				{
					PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{
						IPAddress:        to.Ptr("10.0.0.112"),
						SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default"),
					},
					SQLVirtualMachineInstance: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"),
				},
				{
					PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{
						IPAddress:        to.Ptr("10.0.1.112"),
						SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/alternate"),
					},
					SQLVirtualMachineInstance: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm1"),
				}},
			Port: to.Ptr[int32](1433),
		},
	}, 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.AvailabilityGroupListener = armsqlvirtualmachine.AvailabilityGroupListener{
	// 	Name: to.Ptr("agl-test"),
	// 	Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup/availabilityGroupListeners/agl-test"),
	// 	Properties: &armsqlvirtualmachine.AvailabilityGroupListenerProperties{
	// 		MultiSubnetIPConfigurations: []*armsqlvirtualmachine.MultiSubnetIPConfiguration{
	// 			{
	// 				PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{
	// 					IPAddress: to.Ptr("10.0.0.112"),
	// 					SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default"),
	// 				},
	// 				SQLVirtualMachineInstance: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"),
	// 			},
	// 			{
	// 				PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{
	// 					IPAddress: to.Ptr("10.0.1.112"),
	// 					SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/alternate"),
	// 				},
	// 				SQLVirtualMachineInstance: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm1"),
	// 		}},
	// 		Port: to.Ptr[int32](1433),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 	},
	// }
}
Output:

Example (CreatesOrUpdatesAnAvailabilityGroupListenerUsingLoadBalancerThisIsUsedForVMsPresentInSingleSubnet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateAvailabilityGroupListener.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/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAvailabilityGroupListenersClient().BeginCreateOrUpdate(ctx, "testrg", "testvmgroup", "agl-test", armsqlvirtualmachine.AvailabilityGroupListener{
		Properties: &armsqlvirtualmachine.AvailabilityGroupListenerProperties{
			AvailabilityGroupName: to.Ptr("ag-test"),
			LoadBalancerConfigurations: []*armsqlvirtualmachine.LoadBalancerConfiguration{
				{
					LoadBalancerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb-test"),
					PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{
						IPAddress:        to.Ptr("10.1.0.112"),
						SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default"),
					},
					ProbePort: to.Ptr[int32](59983),
					SQLVirtualMachineInstances: []*string{
						to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"),
						to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm3")},
				}},
			Port: to.Ptr[int32](1433),
		},
	}, 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.AvailabilityGroupListener = armsqlvirtualmachine.AvailabilityGroupListener{
	// 	Name: to.Ptr("agl-test"),
	// 	Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup/availabilityGroupListeners/agl-test"),
	// 	Properties: &armsqlvirtualmachine.AvailabilityGroupListenerProperties{
	// 		LoadBalancerConfigurations: []*armsqlvirtualmachine.LoadBalancerConfiguration{
	// 			{
	// 				PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{
	// 					IPAddress: to.Ptr("10.1.0.113"),
	// 					SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default"),
	// 				},
	// 				SQLVirtualMachineInstances: []*string{
	// 					to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"),
	// 					to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm3")},
	// 			}},
	// 			Port: to.Ptr[int32](1433),
	// 			ProvisioningState: to.Ptr("Succeeded"),
	// 		},
	// 	}
}
Output:

func (*AvailabilityGroupListenersClient) BeginDelete

func (client *AvailabilityGroupListenersClient) BeginDelete(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, availabilityGroupListenerName string, options *AvailabilityGroupListenersClientBeginDeleteOptions) (*runtime.Poller[AvailabilityGroupListenersClientDeleteResponse], error)

BeginDelete - Deletes an availability group listener. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineGroupName - Name of the SQL virtual machine group.
  • availabilityGroupListenerName - Name of the availability group listener.
  • options - AvailabilityGroupListenersClientBeginDeleteOptions contains the optional parameters for the AvailabilityGroupListenersClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/DeleteAvailabilityGroupListener.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)

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

func (client *AvailabilityGroupListenersClient) Get(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, availabilityGroupListenerName string, options *AvailabilityGroupListenersClientGetOptions) (AvailabilityGroupListenersClientGetResponse, error)

Get - Gets an availability group listener. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineGroupName - Name of the SQL virtual machine group.
  • availabilityGroupListenerName - Name of the availability group listener.
  • options - AvailabilityGroupListenersClientGetOptions contains the optional parameters for the AvailabilityGroupListenersClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/GetAvailabilityGroupListener.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAvailabilityGroupListenersClient().Get(ctx, "testrg", "testvmgroup", "agl-test", &armsqlvirtualmachine.AvailabilityGroupListenersClientGetOptions{Expand: 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.AvailabilityGroupListener = armsqlvirtualmachine.AvailabilityGroupListener{
	// 	Name: to.Ptr("agl-test"),
	// 	Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup/availabilityGroupListeners/agl-test"),
	// 	Properties: &armsqlvirtualmachine.AvailabilityGroupListenerProperties{
	// 		AvailabilityGroupName: to.Ptr("ag-test"),
	// 		LoadBalancerConfigurations: []*armsqlvirtualmachine.LoadBalancerConfiguration{
	// 			{
	// 				LoadBalancerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb-test"),
	// 				PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{
	// 					IPAddress: to.Ptr("10.1.0.112"),
	// 					SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default"),
	// 				},
	// 				ProbePort: to.Ptr[int32](59983),
	// 				SQLVirtualMachineInstances: []*string{
	// 					to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm3"),
	// 					to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2")},
	// 			}},
	// 			Port: to.Ptr[int32](1433),
	// 			ProvisioningState: to.Ptr("Succeeded"),
	// 		},
	// 	}
}
Output:

func (*AvailabilityGroupListenersClient) NewListByGroupPager

NewListByGroupPager - Lists all availability group listeners in a SQL virtual machine group.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineGroupName - Name of the SQL virtual machine group.
  • options - AvailabilityGroupListenersClientListByGroupOptions contains the optional parameters for the AvailabilityGroupListenersClient.NewListByGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListByGroupAvailabilityGroupListener.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAvailabilityGroupListenersClient().NewListByGroupPager("testrg", "testvmgroup", 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.AvailabilityGroupListenerListResult = armsqlvirtualmachine.AvailabilityGroupListenerListResult{
		// 	Value: []*armsqlvirtualmachine.AvailabilityGroupListener{
		// 		{
		// 			Name: to.Ptr("agl-test"),
		// 			Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup/availabilityGroupListeners/agl-test"),
		// 			Properties: &armsqlvirtualmachine.AvailabilityGroupListenerProperties{
		// 				AvailabilityGroupName: to.Ptr("ag-test"),
		// 				LoadBalancerConfigurations: []*armsqlvirtualmachine.LoadBalancerConfiguration{
		// 					{
		// 						LoadBalancerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb-test"),
		// 						PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{
		// 							IPAddress: to.Ptr("10.1.0.112"),
		// 							SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default"),
		// 						},
		// 						ProbePort: to.Ptr[int32](59983),
		// 						SQLVirtualMachineInstances: []*string{
		// 							to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm3"),
		// 							to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2")},
		// 					}},
		// 					Port: to.Ptr[int32](1433),
		// 					ProvisioningState: to.Ptr("Succeeded"),
		// 				},
		// 		}},
		// 	}
	}
}
Output:

type AvailabilityGroupListenersClientBeginCreateOrUpdateOptions

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

AvailabilityGroupListenersClientBeginCreateOrUpdateOptions contains the optional parameters for the AvailabilityGroupListenersClient.BeginCreateOrUpdate method.

type AvailabilityGroupListenersClientBeginDeleteOptions

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

AvailabilityGroupListenersClientBeginDeleteOptions contains the optional parameters for the AvailabilityGroupListenersClient.BeginDelete method.

type AvailabilityGroupListenersClientCreateOrUpdateResponse

type AvailabilityGroupListenersClientCreateOrUpdateResponse struct {
	// A SQL Server availability group listener.
	AvailabilityGroupListener
}

AvailabilityGroupListenersClientCreateOrUpdateResponse contains the response from method AvailabilityGroupListenersClient.BeginCreateOrUpdate.

type AvailabilityGroupListenersClientDeleteResponse

type AvailabilityGroupListenersClientDeleteResponse struct {
}

AvailabilityGroupListenersClientDeleteResponse contains the response from method AvailabilityGroupListenersClient.BeginDelete.

type AvailabilityGroupListenersClientGetOptions

type AvailabilityGroupListenersClientGetOptions struct {
	// The child resources to include in the response.
	Expand *string
}

AvailabilityGroupListenersClientGetOptions contains the optional parameters for the AvailabilityGroupListenersClient.Get method.

type AvailabilityGroupListenersClientGetResponse

type AvailabilityGroupListenersClientGetResponse struct {
	// A SQL Server availability group listener.
	AvailabilityGroupListener
}

AvailabilityGroupListenersClientGetResponse contains the response from method AvailabilityGroupListenersClient.Get.

type AvailabilityGroupListenersClientListByGroupOptions

type AvailabilityGroupListenersClientListByGroupOptions struct {
}

AvailabilityGroupListenersClientListByGroupOptions contains the optional parameters for the AvailabilityGroupListenersClient.NewListByGroupPager method.

type AvailabilityGroupListenersClientListByGroupResponse

type AvailabilityGroupListenersClientListByGroupResponse struct {
	// A list of availability group listeners.
	AvailabilityGroupListenerListResult
}

AvailabilityGroupListenersClientListByGroupResponse contains the response from method AvailabilityGroupListenersClient.NewListByGroupPager.

type BackupScheduleType

type BackupScheduleType string

BackupScheduleType - Backup schedule type.

const (
	BackupScheduleTypeAutomated BackupScheduleType = "Automated"
	BackupScheduleTypeManual    BackupScheduleType = "Manual"
)

func PossibleBackupScheduleTypeValues

func PossibleBackupScheduleTypeValues() []BackupScheduleType

PossibleBackupScheduleTypeValues returns the possible values for the BackupScheduleType const type.

type ClientFactory

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

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 - Subscription ID that identifies an Azure subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewAvailabilityGroupListenersClient

func (c *ClientFactory) NewAvailabilityGroupListenersClient() *AvailabilityGroupListenersClient

NewAvailabilityGroupListenersClient creates a new instance of AvailabilityGroupListenersClient.

func (*ClientFactory) NewGroupsClient

func (c *ClientFactory) NewGroupsClient() *GroupsClient

NewGroupsClient creates a new instance of GroupsClient.

func (*ClientFactory) NewOperationsClient

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewSQLVirtualMachinesClient

func (c *ClientFactory) NewSQLVirtualMachinesClient() *SQLVirtualMachinesClient

NewSQLVirtualMachinesClient creates a new instance of SQLVirtualMachinesClient.

func (*ClientFactory) NewTroubleshootClient

func (c *ClientFactory) NewTroubleshootClient() *TroubleshootClient

NewTroubleshootClient creates a new instance of TroubleshootClient.

type ClusterConfiguration

type ClusterConfiguration string

ClusterConfiguration - Cluster type.

const (
	ClusterConfigurationDomainful ClusterConfiguration = "Domainful"
)

func PossibleClusterConfigurationValues

func PossibleClusterConfigurationValues() []ClusterConfiguration

PossibleClusterConfigurationValues returns the possible values for the ClusterConfiguration const type.

type ClusterManagerType

type ClusterManagerType string

ClusterManagerType - Type of cluster manager: Windows Server Failover Cluster (WSFC), implied by the scale type of the group and the OS type.

const (
	ClusterManagerTypeWSFC ClusterManagerType = "WSFC"
)

func PossibleClusterManagerTypeValues

func PossibleClusterManagerTypeValues() []ClusterManagerType

PossibleClusterManagerTypeValues returns the possible values for the ClusterManagerType const type.

type ClusterSubnetType

type ClusterSubnetType string

ClusterSubnetType - Cluster subnet type.

const (
	ClusterSubnetTypeMultiSubnet  ClusterSubnetType = "MultiSubnet"
	ClusterSubnetTypeSingleSubnet ClusterSubnetType = "SingleSubnet"
)

func PossibleClusterSubnetTypeValues

func PossibleClusterSubnetTypeValues() []ClusterSubnetType

PossibleClusterSubnetTypeValues returns the possible values for the ClusterSubnetType const type.

type Commit

type Commit string

Commit - Replica commit mode in availability group.

const (
	CommitASYNCHRONOUSCOMMIT Commit = "ASYNCHRONOUS_COMMIT"
	CommitSYNCHRONOUSCOMMIT  Commit = "SYNCHRONOUS_COMMIT"
)

func PossibleCommitValues

func PossibleCommitValues() []Commit

PossibleCommitValues returns the possible values for the Commit const type.

type ConnectivityType

type ConnectivityType string

ConnectivityType - SQL Server connectivity option.

const (
	ConnectivityTypeLOCAL   ConnectivityType = "LOCAL"
	ConnectivityTypePRIVATE ConnectivityType = "PRIVATE"
	ConnectivityTypePUBLIC  ConnectivityType = "PUBLIC"
)

func PossibleConnectivityTypeValues

func PossibleConnectivityTypeValues() []ConnectivityType

PossibleConnectivityTypeValues returns the possible values for the ConnectivityType const type.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

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

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type DayOfWeek

type DayOfWeek string

DayOfWeek - Day of week to apply the patch on.

const (
	DayOfWeekEveryday  DayOfWeek = "Everyday"
	DayOfWeekFriday    DayOfWeek = "Friday"
	DayOfWeekMonday    DayOfWeek = "Monday"
	DayOfWeekSaturday  DayOfWeek = "Saturday"
	DayOfWeekSunday    DayOfWeek = "Sunday"
	DayOfWeekThursday  DayOfWeek = "Thursday"
	DayOfWeekTuesday   DayOfWeek = "Tuesday"
	DayOfWeekWednesday DayOfWeek = "Wednesday"
)

func PossibleDayOfWeekValues

func PossibleDayOfWeekValues() []DayOfWeek

PossibleDayOfWeekValues returns the possible values for the DayOfWeek const type.

type DiskConfigurationType

type DiskConfigurationType string

DiskConfigurationType - Disk configuration to apply to SQL Server.

const (
	DiskConfigurationTypeADD    DiskConfigurationType = "ADD"
	DiskConfigurationTypeEXTEND DiskConfigurationType = "EXTEND"
	DiskConfigurationTypeNEW    DiskConfigurationType = "NEW"
)

func PossibleDiskConfigurationTypeValues

func PossibleDiskConfigurationTypeValues() []DiskConfigurationType

PossibleDiskConfigurationTypeValues returns the possible values for the DiskConfigurationType const type.

type Failover

type Failover string

Failover - Replica failover mode in availability group.

const (
	FailoverAUTOMATIC Failover = "AUTOMATIC"
	FailoverMANUAL    Failover = "MANUAL"
)

func PossibleFailoverValues

func PossibleFailoverValues() []Failover

PossibleFailoverValues returns the possible values for the Failover const type.

type FullBackupFrequencyType

type FullBackupFrequencyType string

FullBackupFrequencyType - Frequency of full backups. In both cases, full backups begin during the next scheduled time window.

const (
	FullBackupFrequencyTypeDaily  FullBackupFrequencyType = "Daily"
	FullBackupFrequencyTypeWeekly FullBackupFrequencyType = "Weekly"
)

func PossibleFullBackupFrequencyTypeValues

func PossibleFullBackupFrequencyTypeValues() []FullBackupFrequencyType

PossibleFullBackupFrequencyTypeValues returns the possible values for the FullBackupFrequencyType const type.

type Group

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

	// Resource properties.
	Properties *GroupProperties

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

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

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

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

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

Group - A SQL virtual machine group.

func (Group) MarshalJSON

func (g Group) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Group.

func (*Group) UnmarshalJSON

func (g *Group) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Group.

type GroupListResult

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

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

GroupListResult - A list of SQL virtual machine groups.

func (GroupListResult) MarshalJSON

func (g GroupListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GroupListResult.

func (*GroupListResult) UnmarshalJSON

func (g *GroupListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GroupListResult.

type GroupProperties

type GroupProperties struct {
	// SQL image offer. Examples may include SQL2016-WS2016, SQL2017-WS2016.
	SQLImageOffer *string

	// SQL image sku.
	SQLImageSKU *SQLVMGroupImageSKU

	// Cluster Active Directory domain profile.
	WsfcDomainProfile *WsfcDomainProfile

	// READ-ONLY; Cluster type.
	ClusterConfiguration *ClusterConfiguration

	// READ-ONLY; Type of cluster manager: Windows Server Failover Cluster (WSFC), implied by the scale type of the group and
	// the OS type.
	ClusterManagerType *ClusterManagerType

	// READ-ONLY; Provisioning state to track the async operation status.
	ProvisioningState *string

	// READ-ONLY; Scale type.
	ScaleType *ScaleType
}

GroupProperties - The properties of a SQL virtual machine group.

func (GroupProperties) MarshalJSON

func (g GroupProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GroupProperties.

func (*GroupProperties) UnmarshalJSON

func (g *GroupProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GroupProperties.

type GroupUpdate

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

GroupUpdate - An update to a SQL virtual machine group.

func (GroupUpdate) MarshalJSON

func (g GroupUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GroupUpdate.

func (*GroupUpdate) UnmarshalJSON

func (g *GroupUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GroupUpdate.

type GroupsClient

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

GroupsClient contains the methods for the SQLVirtualMachineGroups group. Don't use this type directly, use NewGroupsClient() instead.

func NewGroupsClient

func NewGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupsClient, error)

NewGroupsClient creates a new instance of GroupsClient with the specified values.

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

func (*GroupsClient) BeginCreateOrUpdate

func (client *GroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, parameters Group, options *GroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GroupsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates a SQL virtual machine group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineGroupName - Name of the SQL virtual machine group.
  • parameters - The SQL virtual machine group.
  • options - GroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the GroupsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineGroup.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/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewGroupsClient().BeginCreateOrUpdate(ctx, "testrg", "testvmgroup", armsqlvirtualmachine.Group{
		Location: to.Ptr("northeurope"),
		Tags: map[string]*string{
			"mytag": to.Ptr("myval"),
		},
		Properties: &armsqlvirtualmachine.GroupProperties{
			SQLImageOffer: to.Ptr("SQL2016-WS2016"),
			SQLImageSKU:   to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise),
			WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{
				ClusterBootstrapAccount:  to.Ptr("testrpadmin"),
				ClusterOperatorAccount:   to.Ptr("testrp@testdomain.com"),
				ClusterSubnetType:        to.Ptr(armsqlvirtualmachine.ClusterSubnetTypeMultiSubnet),
				DomainFqdn:               to.Ptr("testdomain.com"),
				OuPath:                   to.Ptr("OU=WSCluster,DC=testdomain,DC=com"),
				SQLServiceAccount:        to.Ptr("sqlservice@testdomain.com"),
				StorageAccountPrimaryKey: to.Ptr("<primary storage access key>"),
				StorageAccountURL:        to.Ptr("https://storgact.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.Group = armsqlvirtualmachine.Group{
	// 	Name: to.Ptr("testvmgroup"),
	// 	Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup"),
	// 	Location: to.Ptr("northeurope"),
	// 	Tags: map[string]*string{
	// 		"mytag": to.Ptr("myval"),
	// 	},
	// 	Properties: &armsqlvirtualmachine.GroupProperties{
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SQLImageOffer: to.Ptr("SQL2016-WS2016"),
	// 		SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise),
	// 		WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{
	// 			ClusterBootstrapAccount: to.Ptr("testrpadmin"),
	// 			ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"),
	// 			ClusterSubnetType: to.Ptr(armsqlvirtualmachine.ClusterSubnetTypeMultiSubnet),
	// 			DomainFqdn: to.Ptr("testdomain.com"),
	// 			OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"),
	// 			SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"),
	// 			StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"),
	// 		},
	// 	},
	// }
}
Output:

func (*GroupsClient) BeginDelete

func (client *GroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, options *GroupsClientBeginDeleteOptions) (*runtime.Poller[GroupsClientDeleteResponse], error)

BeginDelete - Deletes a SQL virtual machine group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineGroupName - Name of the SQL virtual machine group.
  • options - GroupsClientBeginDeleteOptions contains the optional parameters for the GroupsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/DeleteSqlVirtualMachineGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)

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

func (client *GroupsClient) BeginUpdate(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, parameters GroupUpdate, options *GroupsClientBeginUpdateOptions) (*runtime.Poller[GroupsClientUpdateResponse], error)

BeginUpdate - Updates SQL virtual machine group tags. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineGroupName - Name of the SQL virtual machine group.
  • parameters - The SQL virtual machine group.
  • options - GroupsClientBeginUpdateOptions contains the optional parameters for the GroupsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/UpdateSqlVirtualMachineGroup.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/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewGroupsClient().BeginUpdate(ctx, "testrg", "testvmgroup", armsqlvirtualmachine.GroupUpdate{
		Tags: map[string]*string{
			"mytag": to.Ptr("myval"),
		},
	}, 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.Group = armsqlvirtualmachine.Group{
	// 	Name: to.Ptr("testvmgroup"),
	// 	Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
	// 	Location: to.Ptr("northeurope"),
	// 	Tags: map[string]*string{
	// 		"mytag": to.Ptr("myval"),
	// 	},
	// 	Properties: &armsqlvirtualmachine.GroupProperties{
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SQLImageOffer: to.Ptr("SQL2017-WS2016"),
	// 		SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise),
	// 		WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{
	// 			StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"),
	// 		},
	// 	},
	// }
}
Output:

func (*GroupsClient) Get

func (client *GroupsClient) Get(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, options *GroupsClientGetOptions) (GroupsClientGetResponse, error)

Get - Gets a SQL virtual machine group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineGroupName - Name of the SQL virtual machine group.
  • options - GroupsClientGetOptions contains the optional parameters for the GroupsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/GetSqlVirtualMachineGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGroupsClient().Get(ctx, "testrg", "testvmgroup", 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.Group = armsqlvirtualmachine.Group{
	// 	Name: to.Ptr("testvmgroup"),
	// 	Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup"),
	// 	Location: to.Ptr("northeurope"),
	// 	Tags: map[string]*string{
	// 		"mytag": to.Ptr("myval"),
	// 	},
	// 	Properties: &armsqlvirtualmachine.GroupProperties{
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SQLImageOffer: to.Ptr("SQL2016-WS2016"),
	// 		SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise),
	// 		WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{
	// 			ClusterBootstrapAccount: to.Ptr("testrpadmin"),
	// 			ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"),
	// 			DomainFqdn: to.Ptr("testdomain.com"),
	// 			OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"),
	// 			SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"),
	// 			StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"),
	// 		},
	// 	},
	// }
}
Output:

func (*GroupsClient) NewListByResourceGroupPager

func (client *GroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *GroupsClientListByResourceGroupOptions) *runtime.Pager[GroupsClientListByResourceGroupResponse]

NewListByResourceGroupPager - Gets all SQL virtual machine groups in a resource group.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • options - GroupsClientListByResourceGroupOptions contains the optional parameters for the GroupsClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListByResourceGroupSqlVirtualMachineGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGroupsClient().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.GroupListResult = armsqlvirtualmachine.GroupListResult{
		// 	Value: []*armsqlvirtualmachine.Group{
		// 		{
		// 			Name: to.Ptr("testvmgroup"),
		// 			Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup"),
		// 			Location: to.Ptr("northeurope"),
		// 			Tags: map[string]*string{
		// 				"mytag": to.Ptr("myval"),
		// 			},
		// 			Properties: &armsqlvirtualmachine.GroupProperties{
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				SQLImageOffer: to.Ptr("SQL2017-WS2016"),
		// 				SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise),
		// 				WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{
		// 					ClusterBootstrapAccount: to.Ptr("testrpadmin"),
		// 					ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"),
		// 					DomainFqdn: to.Ptr("testdomain.com"),
		// 					OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"),
		// 					SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"),
		// 					StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"),
		// 				},
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testvmgroup1"),
		// 			Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup1"),
		// 			Location: to.Ptr("northeurope"),
		// 			Tags: map[string]*string{
		// 				"mytag": to.Ptr("myval"),
		// 			},
		// 			Properties: &armsqlvirtualmachine.GroupProperties{
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				SQLImageOffer: to.Ptr("SQL2016-WS2016"),
		// 				SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise),
		// 				WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{
		// 					ClusterBootstrapAccount: to.Ptr("testrpadmin"),
		// 					ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"),
		// 					DomainFqdn: to.Ptr("testdomain.com"),
		// 					OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"),
		// 					SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"),
		// 					StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"),
		// 				},
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testvmgroup2"),
		// 			Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup2"),
		// 			Location: to.Ptr("northeurope"),
		// 			Tags: map[string]*string{
		// 				"mytag": to.Ptr("myval"),
		// 			},
		// 			Properties: &armsqlvirtualmachine.GroupProperties{
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				SQLImageOffer: to.Ptr("SQL2016-WS2016"),
		// 				SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise),
		// 				WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{
		// 					ClusterBootstrapAccount: to.Ptr("testrpadmin"),
		// 					ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"),
		// 					DomainFqdn: to.Ptr("testdomain.com"),
		// 					OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"),
		// 					SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"),
		// 					StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*GroupsClient) NewListPager

NewListPager - Gets all SQL virtual machine groups in a subscription.

Generated from API version 2022-08-01-preview

  • options - GroupsClientListOptions contains the optional parameters for the GroupsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListSubscriptionSqlVirtualMachineGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGroupsClient().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.GroupListResult = armsqlvirtualmachine.GroupListResult{
		// 	Value: []*armsqlvirtualmachine.Group{
		// 		{
		// 			Name: to.Ptr("testvmgroup"),
		// 			Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/"),
		// 			Location: to.Ptr("northeurope"),
		// 			Tags: map[string]*string{
		// 				"mytag": to.Ptr("myval"),
		// 			},
		// 			Properties: &armsqlvirtualmachine.GroupProperties{
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				SQLImageOffer: to.Ptr("SQL2017-WS2016"),
		// 				SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise),
		// 				WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{
		// 					ClusterBootstrapAccount: to.Ptr("testrpadmin"),
		// 					ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"),
		// 					ClusterSubnetType: to.Ptr(armsqlvirtualmachine.ClusterSubnetTypeMultiSubnet),
		// 					DomainFqdn: to.Ptr("testdomain.com"),
		// 					OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"),
		// 					SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"),
		// 					StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"),
		// 				},
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testvmgroup1"),
		// 			Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg1/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/"),
		// 			Location: to.Ptr("northeurope"),
		// 			Tags: map[string]*string{
		// 				"mytag": to.Ptr("myval"),
		// 			},
		// 			Properties: &armsqlvirtualmachine.GroupProperties{
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				SQLImageOffer: to.Ptr("SQL2016-WS2016"),
		// 				SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise),
		// 				WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{
		// 					ClusterBootstrapAccount: to.Ptr("testrpadmin"),
		// 					ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"),
		// 					ClusterSubnetType: to.Ptr(armsqlvirtualmachine.ClusterSubnetTypeMultiSubnet),
		// 					DomainFqdn: to.Ptr("testdomain.com"),
		// 					OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"),
		// 					SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"),
		// 					StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"),
		// 				},
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testvmgroup2"),
		// 			Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg2/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/"),
		// 			Location: to.Ptr("northeurope"),
		// 			Tags: map[string]*string{
		// 				"mytag": to.Ptr("myval"),
		// 			},
		// 			Properties: &armsqlvirtualmachine.GroupProperties{
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				SQLImageOffer: to.Ptr("SQL2016-WS2016"),
		// 				SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise),
		// 				WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{
		// 					ClusterBootstrapAccount: to.Ptr("testrpadmin"),
		// 					ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"),
		// 					ClusterSubnetType: to.Ptr(armsqlvirtualmachine.ClusterSubnetTypeMultiSubnet),
		// 					DomainFqdn: to.Ptr("testdomain.com"),
		// 					OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"),
		// 					SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"),
		// 					StorageAccountURL: to.Ptr("https://storgact.blob.core.windows.net/"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

type GroupsClientBeginCreateOrUpdateOptions

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

GroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the GroupsClient.BeginCreateOrUpdate method.

type GroupsClientBeginDeleteOptions

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

GroupsClientBeginDeleteOptions contains the optional parameters for the GroupsClient.BeginDelete method.

type GroupsClientBeginUpdateOptions

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

GroupsClientBeginUpdateOptions contains the optional parameters for the GroupsClient.BeginUpdate method.

type GroupsClientCreateOrUpdateResponse

type GroupsClientCreateOrUpdateResponse struct {
	// A SQL virtual machine group.
	Group
}

GroupsClientCreateOrUpdateResponse contains the response from method GroupsClient.BeginCreateOrUpdate.

type GroupsClientDeleteResponse

type GroupsClientDeleteResponse struct {
}

GroupsClientDeleteResponse contains the response from method GroupsClient.BeginDelete.

type GroupsClientGetOptions

type GroupsClientGetOptions struct {
}

GroupsClientGetOptions contains the optional parameters for the GroupsClient.Get method.

type GroupsClientGetResponse

type GroupsClientGetResponse struct {
	// A SQL virtual machine group.
	Group
}

GroupsClientGetResponse contains the response from method GroupsClient.Get.

type GroupsClientListByResourceGroupOptions

type GroupsClientListByResourceGroupOptions struct {
}

GroupsClientListByResourceGroupOptions contains the optional parameters for the GroupsClient.NewListByResourceGroupPager method.

type GroupsClientListByResourceGroupResponse

type GroupsClientListByResourceGroupResponse struct {
	// A list of SQL virtual machine groups.
	GroupListResult
}

GroupsClientListByResourceGroupResponse contains the response from method GroupsClient.NewListByResourceGroupPager.

type GroupsClientListOptions

type GroupsClientListOptions struct {
}

GroupsClientListOptions contains the optional parameters for the GroupsClient.NewListPager method.

type GroupsClientListResponse

type GroupsClientListResponse struct {
	// A list of SQL virtual machine groups.
	GroupListResult
}

GroupsClientListResponse contains the response from method GroupsClient.NewListPager.

type GroupsClientUpdateResponse

type GroupsClientUpdateResponse struct {
	// A SQL virtual machine group.
	Group
}

GroupsClientUpdateResponse contains the response from method GroupsClient.BeginUpdate.

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 (
	IdentityTypeNone           IdentityType = "None"
	IdentityTypeSystemAssigned IdentityType = "SystemAssigned"
)

func PossibleIdentityTypeValues

func PossibleIdentityTypeValues() []IdentityType

PossibleIdentityTypeValues returns the possible values for the IdentityType const type.

type KeyVaultCredentialSettings

type KeyVaultCredentialSettings struct {
	// Azure Key Vault url.
	AzureKeyVaultURL *string

	// Credential name.
	CredentialName *string

	// Enable or disable key vault credential setting.
	Enable *bool

	// Service principal name to access key vault.
	ServicePrincipalName *string

	// Service principal name secret to access key vault.
	ServicePrincipalSecret *string
}

KeyVaultCredentialSettings - Configure your SQL virtual machine to be able to connect to the Azure Key Vault service.

func (KeyVaultCredentialSettings) MarshalJSON

func (k KeyVaultCredentialSettings) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type KeyVaultCredentialSettings.

func (*KeyVaultCredentialSettings) UnmarshalJSON

func (k *KeyVaultCredentialSettings) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultCredentialSettings.

type LeastPrivilegeMode

type LeastPrivilegeMode string

LeastPrivilegeMode - SQL IaaS Agent least privilege mode.

const (
	LeastPrivilegeModeEnabled LeastPrivilegeMode = "Enabled"
	LeastPrivilegeModeNotSet  LeastPrivilegeMode = "NotSet"
)

func PossibleLeastPrivilegeModeValues

func PossibleLeastPrivilegeModeValues() []LeastPrivilegeMode

PossibleLeastPrivilegeModeValues returns the possible values for the LeastPrivilegeMode const type.

type ListResult

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

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

ListResult - A list of SQL virtual machines.

func (ListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ListResult.

func (*ListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ListResult.

type LoadBalancerConfiguration

type LoadBalancerConfiguration struct {
	// Resource id of the load balancer.
	LoadBalancerResourceID *string

	// Private IP address.
	PrivateIPAddress *PrivateIPAddress

	// Probe port.
	ProbePort *int32

	// Resource id of the public IP.
	PublicIPAddressResourceID *string

	// List of the SQL virtual machine instance resource id's that are enrolled into the availability group listener.
	SQLVirtualMachineInstances []*string
}

LoadBalancerConfiguration - A load balancer configuration for an availability group listener.

func (LoadBalancerConfiguration) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LoadBalancerConfiguration.

func (*LoadBalancerConfiguration) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerConfiguration.

type MultiSubnetIPConfiguration

type MultiSubnetIPConfiguration struct {
	// REQUIRED; Private IP address.
	PrivateIPAddress *PrivateIPAddress

	// REQUIRED; SQL virtual machine instance resource id that are enrolled into the availability group listener.
	SQLVirtualMachineInstance *string
}

MultiSubnetIPConfiguration - Multi subnet ip configuration for an availability group listener.

func (MultiSubnetIPConfiguration) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MultiSubnetIPConfiguration.

func (*MultiSubnetIPConfiguration) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MultiSubnetIPConfiguration.

type Operation

type Operation struct {
	// READ-ONLY; The localized display information for this particular operation / 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 - SQL REST API operation definition.

func (Operation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// READ-ONLY; The localized friendly description for the operation.
	Description *string

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

	// READ-ONLY; The localized friendly form of the resource provider name.
	Provider *string

	// READ-ONLY; The localized friendly form of the resource type related to this action/operation.
	Resource *string
}

OperationDisplay - Display metadata associated with the operation.

func (OperationDisplay) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

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

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

OperationListResult - Result of the request to list SQL operations.

func (OperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationOrigin

type OperationOrigin string

OperationOrigin - The intended executor of the operation.

const (
	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) NewListPager

NewListPager - Lists all of the available SQL Virtual Machine Rest API operations.

Generated from API version 2022-08-01-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListOperation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.OperationListResult = armsqlvirtualmachine.OperationListResult{
		// 	Value: []*armsqlvirtualmachine.Operation{
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/read"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Retrive details of SQL virtual machine group"),
		// 				Operation: to.Ptr("Get SQL virtual machine group details"),
		// 				Resource: to.Ptr("SQL virtual machine group"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/write"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Create a new or change properties of existing SQL virtual machine group"),
		// 				Operation: to.Ptr("Create a new or update existing SQL virtual machine group"),
		// 				Resource: to.Ptr("SQL virtual machine group"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/delete"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Delete existing SQL virtual machine group"),
		// 				Operation: to.Ptr("Delete existing SQL virtual machine group"),
		// 				Resource: to.Ptr("SQL virtual machine group"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners/read"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Retrieve details of SQL availability group listener on a given SQL virtual machine group"),
		// 				Operation: to.Ptr("Get availability group listener details"),
		// 				Resource: to.Ptr("SQL availability group listener"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners/write"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Create a new or changes properties of existing SQL availability group listener"),
		// 				Operation: to.Ptr("Create new or update existing availability group listener"),
		// 				Resource: to.Ptr("SQL availability group listener"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners/delete"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Delete existing availability group listener"),
		// 				Operation: to.Ptr("Delete existing availability group listener"),
		// 				Resource: to.Ptr("SQL availability group listener"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/sqlVirtualMachines/read"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("List Sql virtual machines by a particular sql virtual virtual machine group"),
		// 				Operation: to.Ptr("List Sql virtual machines by a particular sql virtual virtual machine group"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines/startAssessment/action"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines/redeploy/action"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Redeploy existing SQL virtual machine"),
		// 				Operation: to.Ptr("Redeploy existing SQL virtual machine"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines/read"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Retrieve details of SQL virtual machine"),
		// 				Operation: to.Ptr("Get SQL virtual machine instance details"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines/write"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Create a new or change properties of existing SQL virtual machine"),
		// 				Operation: to.Ptr("Create new or update existing SQL virtual machine"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines/delete"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Delete existing SQL virtual machine"),
		// 				Operation: to.Ptr("Delete existing SQL virtual machine"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/locations/registerSqlVmCandidate/action"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Register SQL Vm Candidate"),
		// 				Operation: to.Ptr("Register SQL Vm Candidate"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/locations/availabilityGroupListenerOperationResults/read"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Get result of an availability group listener operation"),
		// 				Operation: to.Ptr("Get availability group listener operation result"),
		// 				Resource: to.Ptr("SQL availability group listener"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/register/action"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Register subscription with Microsoft.SqlVirtualMachine resource provider"),
		// 				Operation: to.Ptr("Register subscription for SQL Virtual Machine"),
		// 				Resource: to.Ptr("Microsoft SQL Virtual Machine"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/unregister/action"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Unregister subscription with Microsoft.SqlVirtualMachine resource provider"),
		// 				Operation: to.Ptr("Unregister subscription for SQL Virtual Machine"),
		// 				Resource: to.Ptr("Microsoft SQL Virtual Machine"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/operations/read"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Resource: to.Ptr("Available REST operations"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/locations/sqlVirtualMachineGroupOperationResults/read"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Get result of a SQL virtual machine group operation"),
		// 				Operation: to.Ptr("Get SQL virtual machine group operation result"),
		// 				Resource: to.Ptr("SQL virtual machine group"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.SqlVirtualMachine/locations/sqlVirtualMachineOperationResults/read"),
		// 			Display: &armsqlvirtualmachine.OperationDisplay{
		// 				Description: to.Ptr("Get result of SQL virtual machine operation"),
		// 				Operation: to.Ptr("Get SQL virtual machine operation result"),
		// 				Resource: to.Ptr("SQL virtual machine"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse

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

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type PrivateIPAddress

type PrivateIPAddress struct {
	// Private IP address bound to the availability group listener.
	IPAddress *string

	// Subnet used to include private IP.
	SubnetResourceID *string
}

PrivateIPAddress - A private IP address bound to the availability group listener.

func (PrivateIPAddress) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateIPAddress.

func (*PrivateIPAddress) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateIPAddress.

type Properties

type Properties struct {
	// SQL best practices Assessment Settings.
	AssessmentSettings *AssessmentSettings

	// Auto backup settings for SQL Server.
	AutoBackupSettings *AutoBackupSettings

	// Auto patching settings for applying critical security updates to SQL virtual machine.
	AutoPatchingSettings *AutoPatchingSettings

	// Enable automatic upgrade of Sql IaaS extension Agent.
	EnableAutomaticUpgrade *bool

	// Key vault credential settings.
	KeyVaultCredentialSettings *KeyVaultCredentialSettings

	// SQL IaaS Agent least privilege mode.
	LeastPrivilegeMode *LeastPrivilegeMode

	// SQL image offer. Examples include SQL2016-WS2016, SQL2017-WS2016.
	SQLImageOffer *string

	// SQL Server edition type.
	SQLImageSKU *SQLImageSKU

	// SQL Server Management type.
	SQLManagement *SQLManagementMode

	// SQL Server license type.
	SQLServerLicenseType *SQLServerLicenseType

	// ARM resource id of the SQL virtual machine group this SQL virtual machine is or will be part of.
	SQLVirtualMachineGroupResourceID *string

	// SQL Server configuration management settings.
	ServerConfigurationsManagementSettings *ServerConfigurationsManagementSettings

	// Storage Configuration Settings.
	StorageConfigurationSettings *StorageConfigurationSettings

	// ARM Resource id of underlying virtual machine created from SQL marketplace image.
	VirtualMachineResourceID *string

	// Domain credentials for setting up Windows Server Failover Cluster for SQL availability group.
	WsfcDomainCredentials *WsfcDomainCredentials

	// Domain credentials for setting up Windows Server Failover Cluster for SQL availability group.
	WsfcStaticIP *string

	// READ-ONLY; Provisioning state to track the async operation status.
	ProvisioningState *string

	// READ-ONLY; Troubleshooting status
	TroubleshootingStatus *TroubleshootingStatus
}

Properties - The SQL virtual machine properties.

func (Properties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Properties.

func (*Properties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Properties.

type ReadableSecondary

type ReadableSecondary string

ReadableSecondary - Replica readable secondary mode in availability group.

const (
	ReadableSecondaryALL      ReadableSecondary = "ALL"
	ReadableSecondaryNO       ReadableSecondary = "NO"
	ReadableSecondaryREADONLY ReadableSecondary = "READ_ONLY"
)

func PossibleReadableSecondaryValues

func PossibleReadableSecondaryValues() []ReadableSecondary

PossibleReadableSecondaryValues returns the possible values for the ReadableSecondary const type.

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

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

MarshalJSON implements the json.Marshaller interface for type ResourceIdentity.

func (*ResourceIdentity) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceIdentity.

type Role

type Role string

Role - Replica Role in availability group.

const (
	RolePRIMARY   Role = "PRIMARY"
	RoleSECONDARY Role = "SECONDARY"
)

func PossibleRoleValues

func PossibleRoleValues() []Role

PossibleRoleValues returns the possible values for the Role const type.

type SQLConnectivityUpdateSettings

type SQLConnectivityUpdateSettings struct {
	// SQL Server connectivity option.
	ConnectivityType *ConnectivityType

	// SQL Server port.
	Port *int32

	// SQL Server sysadmin login password.
	SQLAuthUpdatePassword *string

	// SQL Server sysadmin login to create.
	SQLAuthUpdateUserName *string
}

SQLConnectivityUpdateSettings - Set the access level and network port settings for SQL Server.

func (SQLConnectivityUpdateSettings) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLConnectivityUpdateSettings.

func (*SQLConnectivityUpdateSettings) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLConnectivityUpdateSettings.

type SQLImageSKU

type SQLImageSKU string

SQLImageSKU - SQL Server edition type.

const (
	SQLImageSKUDeveloper  SQLImageSKU = "Developer"
	SQLImageSKUEnterprise SQLImageSKU = "Enterprise"
	SQLImageSKUExpress    SQLImageSKU = "Express"
	SQLImageSKUStandard   SQLImageSKU = "Standard"
	SQLImageSKUWeb        SQLImageSKU = "Web"
)

func PossibleSQLImageSKUValues

func PossibleSQLImageSKUValues() []SQLImageSKU

PossibleSQLImageSKUValues returns the possible values for the SQLImageSKU const type.

type SQLInstanceSettings

type SQLInstanceSettings struct {
	// SQL Server Collation.
	Collation *string

	// SQL Server IFI.
	IsIfiEnabled *bool

	// SQL Server LPIM.
	IsLpimEnabled *bool

	// SQL Server Optimize for Adhoc workloads.
	IsOptimizeForAdHocWorkloadsEnabled *bool

	// SQL Server MAXDOP.
	MaxDop *int32

	// SQL Server maximum memory.
	MaxServerMemoryMB *int32

	// SQL Server minimum memory.
	MinServerMemoryMB *int32
}

SQLInstanceSettings - Set the server/instance-level settings for SQL Server.

func (SQLInstanceSettings) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLInstanceSettings.

func (*SQLInstanceSettings) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLInstanceSettings.

type SQLManagementMode

type SQLManagementMode string

SQLManagementMode - SQL Server Management type.

const (
	SQLManagementModeFull        SQLManagementMode = "Full"
	SQLManagementModeLightWeight SQLManagementMode = "LightWeight"
	SQLManagementModeNoAgent     SQLManagementMode = "NoAgent"
)

func PossibleSQLManagementModeValues

func PossibleSQLManagementModeValues() []SQLManagementMode

PossibleSQLManagementModeValues returns the possible values for the SQLManagementMode const type.

type SQLServerLicenseType

type SQLServerLicenseType string

SQLServerLicenseType - SQL Server license type.

const (
	SQLServerLicenseTypeAHUB SQLServerLicenseType = "AHUB"
	SQLServerLicenseTypeDR   SQLServerLicenseType = "DR"
	SQLServerLicenseTypePAYG SQLServerLicenseType = "PAYG"
)

func PossibleSQLServerLicenseTypeValues

func PossibleSQLServerLicenseTypeValues() []SQLServerLicenseType

PossibleSQLServerLicenseTypeValues returns the possible values for the SQLServerLicenseType const type.

type SQLStorageSettings

type SQLStorageSettings struct {
	// SQL Server default file path
	DefaultFilePath *string

	// Logical Unit Numbers for the disks.
	Luns []*int32
}

SQLStorageSettings - Set disk storage settings for SQL Server.

func (SQLStorageSettings) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLStorageSettings.

func (*SQLStorageSettings) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLStorageSettings.

type SQLStorageUpdateSettings

type SQLStorageUpdateSettings struct {
	// Disk configuration to apply to SQL Server.
	DiskConfigurationType *DiskConfigurationType

	// Virtual machine disk count.
	DiskCount *int32

	// Device id of the first disk to be updated.
	StartingDeviceID *int32
}

SQLStorageUpdateSettings - Set disk storage settings for SQL Server.

func (SQLStorageUpdateSettings) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLStorageUpdateSettings.

func (*SQLStorageUpdateSettings) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLStorageUpdateSettings.

type SQLTempDbSettings

type SQLTempDbSettings struct {
	// SQL Server tempdb data file count
	DataFileCount *int32

	// SQL Server tempdb data file size
	DataFileSize *int32

	// SQL Server tempdb data file autoGrowth size
	DataGrowth *int32

	// SQL Server default file path
	DefaultFilePath *string

	// SQL Server tempdb log file size
	LogFileSize *int32

	// SQL Server tempdb log file autoGrowth size
	LogGrowth *int32

	// Logical Unit Numbers for the disks.
	Luns []*int32

	// SQL Server tempdb persist folder choice
	PersistFolder *bool

	// SQL Server tempdb persist folder location
	PersistFolderPath *string
}

SQLTempDbSettings - Set tempDb storage settings for SQL Server.

func (SQLTempDbSettings) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLTempDbSettings.

func (*SQLTempDbSettings) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLTempDbSettings.

type SQLVMGroupImageSKU

type SQLVMGroupImageSKU string

SQLVMGroupImageSKU - SQL image sku.

const (
	SQLVMGroupImageSKUDeveloper  SQLVMGroupImageSKU = "Developer"
	SQLVMGroupImageSKUEnterprise SQLVMGroupImageSKU = "Enterprise"
)

func PossibleSQLVMGroupImageSKUValues

func PossibleSQLVMGroupImageSKUValues() []SQLVMGroupImageSKU

PossibleSQLVMGroupImageSKUValues returns the possible values for the SQLVMGroupImageSKU const type.

type SQLVMTroubleshooting

type SQLVMTroubleshooting struct {
	// End time in UTC timezone.
	EndTimeUTC *time.Time

	// Troubleshooting properties
	Properties *TroubleshootingAdditionalProperties

	// Start time in UTC timezone.
	StartTimeUTC *time.Time

	// SQL VM troubleshooting scenario.
	TroubleshootingScenario *TroubleshootingScenario

	// READ-ONLY; Virtual machine resource id for response.
	VirtualMachineResourceID *string
}

SQLVMTroubleshooting - Details required for SQL VM troubleshooting

func (SQLVMTroubleshooting) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLVMTroubleshooting.

func (*SQLVMTroubleshooting) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLVMTroubleshooting.

type SQLVirtualMachine

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

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

	// Resource properties.
	Properties *Properties

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

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

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

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

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

SQLVirtualMachine - A SQL virtual machine.

func (SQLVirtualMachine) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLVirtualMachine.

func (*SQLVirtualMachine) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLVirtualMachine.

type SQLVirtualMachinesClient

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

SQLVirtualMachinesClient contains the methods for the SQLVirtualMachines group. Don't use this type directly, use NewSQLVirtualMachinesClient() instead.

func NewSQLVirtualMachinesClient

func NewSQLVirtualMachinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SQLVirtualMachinesClient, error)

NewSQLVirtualMachinesClient creates a new instance of SQLVirtualMachinesClient with the specified values.

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

func (*SQLVirtualMachinesClient) BeginCreateOrUpdate

func (client *SQLVirtualMachinesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, parameters SQLVirtualMachine, options *SQLVirtualMachinesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SQLVirtualMachinesClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates a SQL virtual machine. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineName - Name of the SQL virtual machine.
  • parameters - The SQL virtual machine.
  • options - SQLVirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the SQLVirtualMachinesClient.BeginCreateOrUpdate method.
Example (CreatesOrUpdatesASqlVirtualMachineAndJoinsItToASqlVirtualMachineGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateVirtualMachineWithVMGroup.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/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{
		Location: to.Ptr("northeurope"),
		Properties: &armsqlvirtualmachine.Properties{
			SQLVirtualMachineGroupResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup"),
			VirtualMachineResourceID:         to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2"),
			WsfcDomainCredentials: &armsqlvirtualmachine.WsfcDomainCredentials{
				ClusterBootstrapAccountPassword: to.Ptr("<Password>"),
				ClusterOperatorAccountPassword:  to.Ptr("<Password>"),
				SQLServiceAccountPassword:       to.Ptr("<Password>"),
			},
			WsfcStaticIP: to.Ptr("10.0.0.7"),
		},
	}, 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{
	// 	Name: to.Ptr("testvm2"),
	// 	Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"),
	// 	Location: to.Ptr("northeurope"),
	// 	Properties: &armsqlvirtualmachine.Properties{
	// 		EnableAutomaticUpgrade: to.Ptr(false),
	// 		LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
	// 		SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
	// 		SQLVirtualMachineGroupResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup"),
	// 		VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2"),
	// 		WsfcStaticIP: to.Ptr("10.0.0.7"),
	// 	},
	// }
}
Output:

Example (CreatesOrUpdatesASqlVirtualMachineForAutomatedBackUpSettingsWithWeeklyAndDaysOfTheWeekToRunTheBackUp)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineAutomatedBackupWeekly.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/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{
		Location: to.Ptr("northeurope"),
		Properties: &armsqlvirtualmachine.Properties{
			AutoBackupSettings: &armsqlvirtualmachine.AutoBackupSettings{
				BackupScheduleType: to.Ptr(armsqlvirtualmachine.BackupScheduleTypeManual),
				BackupSystemDbs:    to.Ptr(true),
				DaysOfWeek: []*armsqlvirtualmachine.AutoBackupDaysOfWeek{
					to.Ptr(armsqlvirtualmachine.AutoBackupDaysOfWeekMonday),
					to.Ptr(armsqlvirtualmachine.AutoBackupDaysOfWeekFriday)},
				Enable:                to.Ptr(true),
				EnableEncryption:      to.Ptr(true),
				FullBackupFrequency:   to.Ptr(armsqlvirtualmachine.FullBackupFrequencyTypeWeekly),
				FullBackupStartTime:   to.Ptr[int32](6),
				FullBackupWindowHours: to.Ptr[int32](11),
				LogBackupFrequency:    to.Ptr[int32](10),
				Password:              to.Ptr("<Password>"),
				RetentionPeriod:       to.Ptr[int32](17),
				StorageAccessKey:      to.Ptr("<primary storage access key>"),
				StorageAccountURL:     to.Ptr("https://teststorage.blob.core.windows.net/"),
				StorageContainerName:  to.Ptr("testcontainer"),
			},
			AutoPatchingSettings: &armsqlvirtualmachine.AutoPatchingSettings{
				DayOfWeek:                     to.Ptr(armsqlvirtualmachine.DayOfWeekSunday),
				Enable:                        to.Ptr(true),
				MaintenanceWindowDuration:     to.Ptr[int32](60),
				MaintenanceWindowStartingHour: to.Ptr[int32](2),
			},
			KeyVaultCredentialSettings: &armsqlvirtualmachine.KeyVaultCredentialSettings{
				Enable: to.Ptr(false),
			},
			ServerConfigurationsManagementSettings: &armsqlvirtualmachine.ServerConfigurationsManagementSettings{
				AdditionalFeaturesServerConfigurations: &armsqlvirtualmachine.AdditionalFeaturesServerConfigurations{
					IsRServicesEnabled: to.Ptr(false),
				},
				SQLConnectivityUpdateSettings: &armsqlvirtualmachine.SQLConnectivityUpdateSettings{
					ConnectivityType:      to.Ptr(armsqlvirtualmachine.ConnectivityTypePRIVATE),
					Port:                  to.Ptr[int32](1433),
					SQLAuthUpdatePassword: to.Ptr("<password>"),
					SQLAuthUpdateUserName: to.Ptr("sqllogin"),
				},
				SQLStorageUpdateSettings: &armsqlvirtualmachine.SQLStorageUpdateSettings{
					DiskConfigurationType: to.Ptr(armsqlvirtualmachine.DiskConfigurationTypeNEW),
					DiskCount:             to.Ptr[int32](1),
					StartingDeviceID:      to.Ptr[int32](2),
				},
				SQLWorkloadTypeUpdateSettings: &armsqlvirtualmachine.SQLWorkloadTypeUpdateSettings{
					SQLWorkloadType: to.Ptr(armsqlvirtualmachine.SQLWorkloadTypeOLTP),
				},
			},
			SQLImageSKU:              to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
			SQLManagement:            to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
			SQLServerLicenseType:     to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
			VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
		},
	}, 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{
	// 	Name: to.Ptr("testvm"),
	// 	Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
	// 	Location: to.Ptr("northeurope"),
	// 	Properties: &armsqlvirtualmachine.Properties{
	// 		EnableAutomaticUpgrade: to.Ptr(false),
	// 		LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
	// 		SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
	// 		SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
	// 		VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
	// 	},
	// }
}
Output:

Example (CreatesOrUpdatesASqlVirtualMachineForStorageConfigurationSettingsToExtendDataLogOrTempDbStoragePool)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineStorageConfigurationEXTEND.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/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{
		Location: to.Ptr("northeurope"),
		Properties: &armsqlvirtualmachine.Properties{
			StorageConfigurationSettings: &armsqlvirtualmachine.StorageConfigurationSettings{
				DiskConfigurationType: to.Ptr(armsqlvirtualmachine.DiskConfigurationTypeEXTEND),
				SQLDataSettings: &armsqlvirtualmachine.SQLStorageSettings{
					Luns: []*int32{
						to.Ptr[int32](2)},
				},
			},
			VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
		},
	}, 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{
	// 	Name: to.Ptr("testvm"),
	// 	Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
	// 	Location: to.Ptr("northeurope"),
	// 	Properties: &armsqlvirtualmachine.Properties{
	// 		EnableAutomaticUpgrade: to.Ptr(false),
	// 		LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
	// 		SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
	// 		VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
	// 	},
	// }
}
Output:

Example (CreatesOrUpdatesASqlVirtualMachineForStorageConfigurationSettingsToNewDataLogAndTempDbStoragePool)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineStorageConfigurationNEW.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/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{
		Location: to.Ptr("northeurope"),
		Properties: &armsqlvirtualmachine.Properties{
			StorageConfigurationSettings: &armsqlvirtualmachine.StorageConfigurationSettings{
				DiskConfigurationType: to.Ptr(armsqlvirtualmachine.DiskConfigurationTypeNEW),
				SQLDataSettings: &armsqlvirtualmachine.SQLStorageSettings{
					DefaultFilePath: to.Ptr("F:\\folderpath\\"),
					Luns: []*int32{
						to.Ptr[int32](0)},
				},
				SQLLogSettings: &armsqlvirtualmachine.SQLStorageSettings{
					DefaultFilePath: to.Ptr("G:\\folderpath\\"),
					Luns: []*int32{
						to.Ptr[int32](1)},
				},
				SQLSystemDbOnDataDisk: to.Ptr(true),
				SQLTempDbSettings: &armsqlvirtualmachine.SQLTempDbSettings{
					DataFileCount:   to.Ptr[int32](8),
					DataFileSize:    to.Ptr[int32](256),
					DataGrowth:      to.Ptr[int32](512),
					DefaultFilePath: to.Ptr("D:\\TEMP"),
					LogFileSize:     to.Ptr[int32](256),
					LogGrowth:       to.Ptr[int32](512),
				},
				StorageWorkloadType: to.Ptr(armsqlvirtualmachine.StorageWorkloadTypeOLTP),
			},
			VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
		},
	}, 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{
	// 	Name: to.Ptr("testvm"),
	// 	Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
	// 	Location: to.Ptr("northeurope"),
	// 	Properties: &armsqlvirtualmachine.Properties{
	// 		EnableAutomaticUpgrade: to.Ptr(false),
	// 		LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
	// 		SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
	// 		VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
	// 	},
	// }
}
Output:

Example (CreatesOrUpdatesASqlVirtualMachineWithMaxParameters)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineMAX.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/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{
		Location: to.Ptr("northeurope"),
		Properties: &armsqlvirtualmachine.Properties{
			AssessmentSettings: &armsqlvirtualmachine.AssessmentSettings{
				Enable:         to.Ptr(true),
				RunImmediately: to.Ptr(true),
				Schedule: &armsqlvirtualmachine.Schedule{
					DayOfWeek:      to.Ptr(armsqlvirtualmachine.AssessmentDayOfWeekSunday),
					Enable:         to.Ptr(true),
					StartTime:      to.Ptr("23:17"),
					WeeklyInterval: to.Ptr[int32](1),
				},
			},
			AutoBackupSettings: &armsqlvirtualmachine.AutoBackupSettings{
				BackupScheduleType:    to.Ptr(armsqlvirtualmachine.BackupScheduleTypeManual),
				BackupSystemDbs:       to.Ptr(true),
				Enable:                to.Ptr(true),
				EnableEncryption:      to.Ptr(true),
				FullBackupFrequency:   to.Ptr(armsqlvirtualmachine.FullBackupFrequencyTypeDaily),
				FullBackupStartTime:   to.Ptr[int32](6),
				FullBackupWindowHours: to.Ptr[int32](11),
				LogBackupFrequency:    to.Ptr[int32](10),
				Password:              to.Ptr("<Password>"),
				RetentionPeriod:       to.Ptr[int32](17),
				StorageAccessKey:      to.Ptr("<primary storage access key>"),
				StorageAccountURL:     to.Ptr("https://teststorage.blob.core.windows.net/"),
				StorageContainerName:  to.Ptr("testcontainer"),
			},
			AutoPatchingSettings: &armsqlvirtualmachine.AutoPatchingSettings{
				DayOfWeek:                     to.Ptr(armsqlvirtualmachine.DayOfWeekSunday),
				Enable:                        to.Ptr(true),
				MaintenanceWindowDuration:     to.Ptr[int32](60),
				MaintenanceWindowStartingHour: to.Ptr[int32](2),
			},
			EnableAutomaticUpgrade: to.Ptr(true),
			KeyVaultCredentialSettings: &armsqlvirtualmachine.KeyVaultCredentialSettings{
				Enable: to.Ptr(false),
			},
			LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled),
			ServerConfigurationsManagementSettings: &armsqlvirtualmachine.ServerConfigurationsManagementSettings{
				AdditionalFeaturesServerConfigurations: &armsqlvirtualmachine.AdditionalFeaturesServerConfigurations{
					IsRServicesEnabled: to.Ptr(false),
				},
				AzureAdAuthenticationSettings: &armsqlvirtualmachine.AADAuthenticationSettings{
					ClientID: to.Ptr("11111111-2222-3333-4444-555555555555"),
				},
				SQLConnectivityUpdateSettings: &armsqlvirtualmachine.SQLConnectivityUpdateSettings{
					ConnectivityType:      to.Ptr(armsqlvirtualmachine.ConnectivityTypePRIVATE),
					Port:                  to.Ptr[int32](1433),
					SQLAuthUpdatePassword: to.Ptr("<password>"),
					SQLAuthUpdateUserName: to.Ptr("sqllogin"),
				},
				SQLInstanceSettings: &armsqlvirtualmachine.SQLInstanceSettings{
					Collation:                          to.Ptr("SQL_Latin1_General_CP1_CI_AS"),
					IsIfiEnabled:                       to.Ptr(true),
					IsLpimEnabled:                      to.Ptr(true),
					IsOptimizeForAdHocWorkloadsEnabled: to.Ptr(true),
					MaxDop:                             to.Ptr[int32](8),
					MaxServerMemoryMB:                  to.Ptr[int32](128),
					MinServerMemoryMB:                  to.Ptr[int32](0),
				},
				SQLStorageUpdateSettings: &armsqlvirtualmachine.SQLStorageUpdateSettings{
					DiskConfigurationType: to.Ptr(armsqlvirtualmachine.DiskConfigurationTypeNEW),
					DiskCount:             to.Ptr[int32](1),
					StartingDeviceID:      to.Ptr[int32](2),
				},
				SQLWorkloadTypeUpdateSettings: &armsqlvirtualmachine.SQLWorkloadTypeUpdateSettings{
					SQLWorkloadType: to.Ptr(armsqlvirtualmachine.SQLWorkloadTypeOLTP),
				},
			},
			SQLImageSKU:              to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
			SQLManagement:            to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
			SQLServerLicenseType:     to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
			VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
		},
	}, 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{
	// 	Name: to.Ptr("testvm"),
	// 	Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
	// 	Location: to.Ptr("northeurope"),
	// 	Properties: &armsqlvirtualmachine.Properties{
	// 		EnableAutomaticUpgrade: to.Ptr(true),
	// 		LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
	// 		SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
	// 		SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
	// 		VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
	// 	},
	// }
}
Output:

Example (CreatesOrUpdatesASqlVirtualMachineWithMinParameters)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/CreateOrUpdateSqlVirtualMachineMIN.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/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVirtualMachine{
		Location: to.Ptr("northeurope"),
		Properties: &armsqlvirtualmachine.Properties{
			VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
		},
	}, 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{
	// 	Name: to.Ptr("testvm"),
	// 	Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
	// 	Location: to.Ptr("northeurope"),
	// 	Properties: &armsqlvirtualmachine.Properties{
	// 		EnableAutomaticUpgrade: to.Ptr(false),
	// 		LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
	// 		SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
	// 		VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
	// 	},
	// }
}
Output:

func (*SQLVirtualMachinesClient) BeginDelete

func (client *SQLVirtualMachinesClient) BeginDelete(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, options *SQLVirtualMachinesClientBeginDeleteOptions) (*runtime.Poller[SQLVirtualMachinesClientDeleteResponse], error)

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

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineName - Name of the SQL virtual machine.
  • options - SQLVirtualMachinesClientBeginDeleteOptions contains the optional parameters for the SQLVirtualMachinesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/DeleteSqlVirtualMachine.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)

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

func (client *SQLVirtualMachinesClient) BeginRedeploy(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, options *SQLVirtualMachinesClientBeginRedeployOptions) (*runtime.Poller[SQLVirtualMachinesClientRedeployResponse], error)

BeginRedeploy - Uninstalls and reinstalls the SQL IaaS Extension. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineName - Name of the SQL virtual machine.
  • options - SQLVirtualMachinesClientBeginRedeployOptions contains the optional parameters for the SQLVirtualMachinesClient.BeginRedeploy method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/RedeploySqlVirtualMachine.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginRedeploy(ctx, "testrg", "testvm", 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 (*SQLVirtualMachinesClient) BeginStartAssessment

BeginStartAssessment - Starts SQL best practices Assessment on SQL virtual machine. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineName - Name of the SQL virtual machine.
  • options - SQLVirtualMachinesClientBeginStartAssessmentOptions contains the optional parameters for the SQLVirtualMachinesClient.BeginStartAssessment method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/StartAssessmentOnSqlVirtualMachine.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginStartAssessment(ctx, "testrg", "testvm", 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 (*SQLVirtualMachinesClient) BeginUpdate

func (client *SQLVirtualMachinesClient) BeginUpdate(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, parameters Update, options *SQLVirtualMachinesClientBeginUpdateOptions) (*runtime.Poller[SQLVirtualMachinesClientUpdateResponse], error)

BeginUpdate - Updates a SQL virtual machine. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineName - Name of the SQL virtual machine.
  • parameters - The SQL virtual machine.
  • options - SQLVirtualMachinesClientBeginUpdateOptions contains the optional parameters for the SQLVirtualMachinesClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/UpdateSqlVirtualMachine.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/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSQLVirtualMachinesClient().BeginUpdate(ctx, "testrg", "testvm", armsqlvirtualmachine.Update{
		Tags: map[string]*string{
			"mytag": to.Ptr("myval"),
		},
	}, 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{
	// 	Name: to.Ptr("testvm"),
	// 	Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
	// 	Location: to.Ptr("northeurope"),
	// 	Tags: map[string]*string{
	// 		"mytag": to.Ptr("myval"),
	// 	},
	// 	Properties: &armsqlvirtualmachine.Properties{
	// 		EnableAutomaticUpgrade: to.Ptr(false),
	// 		LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
	// 		SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
	// 		SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
	// 		VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
	// 	},
	// }
}
Output:

func (*SQLVirtualMachinesClient) Get

func (client *SQLVirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, options *SQLVirtualMachinesClientGetOptions) (SQLVirtualMachinesClientGetResponse, error)

Get - Gets a SQL virtual machine. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineName - Name of the SQL virtual machine.
  • options - SQLVirtualMachinesClientGetOptions contains the optional parameters for the SQLVirtualMachinesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/GetSqlVirtualMachine.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSQLVirtualMachinesClient().Get(ctx, "testrg", "testvm", &armsqlvirtualmachine.SQLVirtualMachinesClientGetOptions{Expand: 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.SQLVirtualMachine = armsqlvirtualmachine.SQLVirtualMachine{
	// 	Name: to.Ptr("testvm"),
	// 	Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
	// 	ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
	// 	Location: to.Ptr("northeurope"),
	// 	Properties: &armsqlvirtualmachine.Properties{
	// 		EnableAutomaticUpgrade: to.Ptr(true),
	// 		LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SQLImageOffer: to.Ptr("SQL2017-WS2016"),
	// 		SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
	// 		SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
	// 		SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
	// 		VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
	// 	},
	// }
}
Output:

func (*SQLVirtualMachinesClient) NewListByResourceGroupPager

NewListByResourceGroupPager - Gets all SQL virtual machines in a resource group.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • options - SQLVirtualMachinesClientListByResourceGroupOptions contains the optional parameters for the SQLVirtualMachinesClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListByResourceGroupSqlVirtualMachine.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewSQLVirtualMachinesClient().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.ListResult = armsqlvirtualmachine.ListResult{
		// 	Value: []*armsqlvirtualmachine.SQLVirtualMachine{
		// 		{
		// 			Name: to.Ptr("testvm"),
		// 			Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
		// 			Location: to.Ptr("northeurope"),
		// 			Properties: &armsqlvirtualmachine.Properties{
		// 				EnableAutomaticUpgrade: to.Ptr(false),
		// 				LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				SQLImageOffer: to.Ptr("SQL2016-WS2016"),
		// 				SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
		// 				SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
		// 				SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
		// 				VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testvm1"),
		// 			Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm1"),
		// 			Location: to.Ptr("northeurope"),
		// 			Properties: &armsqlvirtualmachine.Properties{
		// 				EnableAutomaticUpgrade: to.Ptr(false),
		// 				LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				SQLImageOffer: to.Ptr("SQL2017-WS2016"),
		// 				SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
		// 				SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeLightWeight),
		// 				SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
		// 				VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm1"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*SQLVirtualMachinesClient) NewListBySQLVMGroupPager

func (client *SQLVirtualMachinesClient) NewListBySQLVMGroupPager(resourceGroupName string, sqlVirtualMachineGroupName string, options *SQLVirtualMachinesClientListBySQLVMGroupOptions) *runtime.Pager[SQLVirtualMachinesClientListBySQLVMGroupResponse]

NewListBySQLVMGroupPager - Gets the list of sql virtual machines in a SQL virtual machine group.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineGroupName - Name of the SQL virtual machine group.
  • options - SQLVirtualMachinesClientListBySQLVMGroupOptions contains the optional parameters for the SQLVirtualMachinesClient.NewListBySQLVMGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListBySqlVirtualMachineGroupSqlVirtualMachine.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewSQLVirtualMachinesClient().NewListBySQLVMGroupPager("testrg", "testvm", 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.ListResult = armsqlvirtualmachine.ListResult{
		// 	Value: []*armsqlvirtualmachine.SQLVirtualMachine{
		// 		{
		// 			Name: to.Ptr("testvm2"),
		// 			Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"),
		// 			Location: to.Ptr("northeurope"),
		// 			Properties: &armsqlvirtualmachine.Properties{
		// 				EnableAutomaticUpgrade: to.Ptr(false),
		// 				LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				SQLImageOffer: to.Ptr("SQL2014-WS2012R2"),
		// 				SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
		// 				SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
		// 				SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
		// 				SQLVirtualMachineGroupResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup"),
		// 				VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*SQLVirtualMachinesClient) NewListPager

NewListPager - Gets all SQL virtual machines in a subscription.

Generated from API version 2022-08-01-preview

  • options - SQLVirtualMachinesClientListOptions contains the optional parameters for the SQLVirtualMachinesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/ListSubscriptionSqlVirtualMachine.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewSQLVirtualMachinesClient().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.ListResult = armsqlvirtualmachine.ListResult{
		// 	Value: []*armsqlvirtualmachine.SQLVirtualMachine{
		// 		{
		// 			Name: to.Ptr("testvm"),
		// 			Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm"),
		// 			Location: to.Ptr("northeurope"),
		// 			Properties: &armsqlvirtualmachine.Properties{
		// 				EnableAutomaticUpgrade: to.Ptr(false),
		// 				LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				SQLImageOffer: to.Ptr("SQL2016-WS2016"),
		// 				SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
		// 				SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
		// 				SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypeAHUB),
		// 				VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testvm1"),
		// 			Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm1"),
		// 			Location: to.Ptr("northeurope"),
		// 			Properties: &armsqlvirtualmachine.Properties{
		// 				EnableAutomaticUpgrade: to.Ptr(false),
		// 				LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeEnabled),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				SQLImageOffer: to.Ptr("SQL2017-WS2016"),
		// 				SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
		// 				SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeFull),
		// 				SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
		// 				VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm1"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testvm2"),
		// 			Type: to.Ptr("Microsoft.SqlVirtualMachine/sqlVirtualMachines"),
		// 			ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg1/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"),
		// 			Location: to.Ptr("northeurope"),
		// 			Properties: &armsqlvirtualmachine.Properties{
		// 				EnableAutomaticUpgrade: to.Ptr(false),
		// 				LeastPrivilegeMode: to.Ptr(armsqlvirtualmachine.LeastPrivilegeModeNotSet),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				SQLImageOffer: to.Ptr("SQL2016-WS2016"),
		// 				SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLImageSKUEnterprise),
		// 				SQLManagement: to.Ptr(armsqlvirtualmachine.SQLManagementModeLightWeight),
		// 				SQLServerLicenseType: to.Ptr(armsqlvirtualmachine.SQLServerLicenseTypePAYG),
		// 				VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg1/providers/Microsoft.Compute/virtualMachines/testvm2"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type SQLVirtualMachinesClientBeginCreateOrUpdateOptions

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

SQLVirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the SQLVirtualMachinesClient.BeginCreateOrUpdate method.

type SQLVirtualMachinesClientBeginDeleteOptions

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

SQLVirtualMachinesClientBeginDeleteOptions contains the optional parameters for the SQLVirtualMachinesClient.BeginDelete method.

type SQLVirtualMachinesClientBeginRedeployOptions

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

SQLVirtualMachinesClientBeginRedeployOptions contains the optional parameters for the SQLVirtualMachinesClient.BeginRedeploy method.

type SQLVirtualMachinesClientBeginStartAssessmentOptions

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

SQLVirtualMachinesClientBeginStartAssessmentOptions contains the optional parameters for the SQLVirtualMachinesClient.BeginStartAssessment method.

type SQLVirtualMachinesClientBeginUpdateOptions

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

SQLVirtualMachinesClientBeginUpdateOptions contains the optional parameters for the SQLVirtualMachinesClient.BeginUpdate method.

type SQLVirtualMachinesClientCreateOrUpdateResponse

type SQLVirtualMachinesClientCreateOrUpdateResponse struct {
	// A SQL virtual machine.
	SQLVirtualMachine
}

SQLVirtualMachinesClientCreateOrUpdateResponse contains the response from method SQLVirtualMachinesClient.BeginCreateOrUpdate.

type SQLVirtualMachinesClientDeleteResponse

type SQLVirtualMachinesClientDeleteResponse struct {
}

SQLVirtualMachinesClientDeleteResponse contains the response from method SQLVirtualMachinesClient.BeginDelete.

type SQLVirtualMachinesClientGetOptions

type SQLVirtualMachinesClientGetOptions struct {
	// The child resources to include in the response.
	Expand *string
}

SQLVirtualMachinesClientGetOptions contains the optional parameters for the SQLVirtualMachinesClient.Get method.

type SQLVirtualMachinesClientGetResponse

type SQLVirtualMachinesClientGetResponse struct {
	// A SQL virtual machine.
	SQLVirtualMachine
}

SQLVirtualMachinesClientGetResponse contains the response from method SQLVirtualMachinesClient.Get.

type SQLVirtualMachinesClientListByResourceGroupOptions

type SQLVirtualMachinesClientListByResourceGroupOptions struct {
}

SQLVirtualMachinesClientListByResourceGroupOptions contains the optional parameters for the SQLVirtualMachinesClient.NewListByResourceGroupPager method.

type SQLVirtualMachinesClientListByResourceGroupResponse

type SQLVirtualMachinesClientListByResourceGroupResponse struct {
	// A list of SQL virtual machines.
	ListResult
}

SQLVirtualMachinesClientListByResourceGroupResponse contains the response from method SQLVirtualMachinesClient.NewListByResourceGroupPager.

type SQLVirtualMachinesClientListBySQLVMGroupOptions

type SQLVirtualMachinesClientListBySQLVMGroupOptions struct {
}

SQLVirtualMachinesClientListBySQLVMGroupOptions contains the optional parameters for the SQLVirtualMachinesClient.NewListBySQLVMGroupPager method.

type SQLVirtualMachinesClientListBySQLVMGroupResponse

type SQLVirtualMachinesClientListBySQLVMGroupResponse struct {
	// A list of SQL virtual machines.
	ListResult
}

SQLVirtualMachinesClientListBySQLVMGroupResponse contains the response from method SQLVirtualMachinesClient.NewListBySQLVMGroupPager.

type SQLVirtualMachinesClientListOptions

type SQLVirtualMachinesClientListOptions struct {
}

SQLVirtualMachinesClientListOptions contains the optional parameters for the SQLVirtualMachinesClient.NewListPager method.

type SQLVirtualMachinesClientListResponse

type SQLVirtualMachinesClientListResponse struct {
	// A list of SQL virtual machines.
	ListResult
}

SQLVirtualMachinesClientListResponse contains the response from method SQLVirtualMachinesClient.NewListPager.

type SQLVirtualMachinesClientRedeployResponse

type SQLVirtualMachinesClientRedeployResponse struct {
}

SQLVirtualMachinesClientRedeployResponse contains the response from method SQLVirtualMachinesClient.BeginRedeploy.

type SQLVirtualMachinesClientStartAssessmentResponse

type SQLVirtualMachinesClientStartAssessmentResponse struct {
}

SQLVirtualMachinesClientStartAssessmentResponse contains the response from method SQLVirtualMachinesClient.BeginStartAssessment.

type SQLVirtualMachinesClientUpdateResponse

type SQLVirtualMachinesClientUpdateResponse struct {
	// A SQL virtual machine.
	SQLVirtualMachine
}

SQLVirtualMachinesClientUpdateResponse contains the response from method SQLVirtualMachinesClient.BeginUpdate.

type SQLWorkloadType

type SQLWorkloadType string

SQLWorkloadType - SQL Server workload type.

const (
	SQLWorkloadTypeDW      SQLWorkloadType = "DW"
	SQLWorkloadTypeGENERAL SQLWorkloadType = "GENERAL"
	SQLWorkloadTypeOLTP    SQLWorkloadType = "OLTP"
)

func PossibleSQLWorkloadTypeValues

func PossibleSQLWorkloadTypeValues() []SQLWorkloadType

PossibleSQLWorkloadTypeValues returns the possible values for the SQLWorkloadType const type.

type SQLWorkloadTypeUpdateSettings

type SQLWorkloadTypeUpdateSettings struct {
	// SQL Server workload type.
	SQLWorkloadType *SQLWorkloadType
}

SQLWorkloadTypeUpdateSettings - Set workload type to optimize storage for SQL Server.

func (SQLWorkloadTypeUpdateSettings) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SQLWorkloadTypeUpdateSettings.

func (*SQLWorkloadTypeUpdateSettings) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SQLWorkloadTypeUpdateSettings.

type ScaleType

type ScaleType string

ScaleType - Scale type.

const (
	ScaleTypeHA ScaleType = "HA"
)

func PossibleScaleTypeValues

func PossibleScaleTypeValues() []ScaleType

PossibleScaleTypeValues returns the possible values for the ScaleType const type.

type Schedule

type Schedule struct {
	// Day of the week to run assessment.
	DayOfWeek *AssessmentDayOfWeek

	// Enable or disable assessment schedule on SQL virtual machine.
	Enable *bool

	// Occurrence of the DayOfWeek day within a month to schedule assessment. Takes values: 1,2,3,4 and -1. Use -1 for last DayOfWeek
	// day of the month
	MonthlyOccurrence *int32

	// Time of the day in HH:mm format. Eg. 17:30
	StartTime *string

	// Number of weeks to schedule between 2 assessment runs. Takes value from 1-6
	WeeklyInterval *int32
}

Schedule - Set assessment schedule for SQL Server.

func (Schedule) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Schedule.

func (*Schedule) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Schedule.

type ServerConfigurationsManagementSettings

type ServerConfigurationsManagementSettings struct {
	// Additional SQL feature settings.
	AdditionalFeaturesServerConfigurations *AdditionalFeaturesServerConfigurations

	// Azure AD authentication Settings.
	AzureAdAuthenticationSettings *AADAuthenticationSettings

	// SQL connectivity type settings.
	SQLConnectivityUpdateSettings *SQLConnectivityUpdateSettings

	// SQL Instance settings.
	SQLInstanceSettings *SQLInstanceSettings

	// SQL storage update settings.
	SQLStorageUpdateSettings *SQLStorageUpdateSettings

	// SQL workload type settings.
	SQLWorkloadTypeUpdateSettings *SQLWorkloadTypeUpdateSettings
}

ServerConfigurationsManagementSettings - Set the connectivity, storage and workload settings.

func (ServerConfigurationsManagementSettings) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerConfigurationsManagementSettings.

func (*ServerConfigurationsManagementSettings) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerConfigurationsManagementSettings.

type StorageConfigurationSettings

type StorageConfigurationSettings struct {
	// Disk configuration to apply to SQL Server.
	DiskConfigurationType *DiskConfigurationType

	// SQL Server Data Storage Settings.
	SQLDataSettings *SQLStorageSettings

	// SQL Server Log Storage Settings.
	SQLLogSettings *SQLStorageSettings

	// SQL Server SystemDb Storage on DataPool if true.
	SQLSystemDbOnDataDisk *bool

	// SQL Server TempDb Storage Settings.
	SQLTempDbSettings *SQLTempDbSettings

	// Storage workload type.
	StorageWorkloadType *StorageWorkloadType
}

StorageConfigurationSettings - Storage Configurations for SQL Data, Log and TempDb.

func (StorageConfigurationSettings) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type StorageConfigurationSettings.

func (*StorageConfigurationSettings) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type StorageConfigurationSettings.

type StorageWorkloadType

type StorageWorkloadType string

StorageWorkloadType - Storage workload type.

const (
	StorageWorkloadTypeDW      StorageWorkloadType = "DW"
	StorageWorkloadTypeGENERAL StorageWorkloadType = "GENERAL"
	StorageWorkloadTypeOLTP    StorageWorkloadType = "OLTP"
)

func PossibleStorageWorkloadTypeValues

func PossibleStorageWorkloadTypeValues() []StorageWorkloadType

PossibleStorageWorkloadTypeValues returns the possible values for the StorageWorkloadType const type.

type SystemData

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

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

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

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

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

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

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

func (SystemData) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type TroubleshootClient

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

TroubleshootClient contains the methods for the SQLVirtualMachineTroubleshoot group. Don't use this type directly, use NewTroubleshootClient() instead.

func NewTroubleshootClient

func NewTroubleshootClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TroubleshootClient, error)

NewTroubleshootClient creates a new instance of TroubleshootClient with the specified values.

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

func (*TroubleshootClient) BeginTroubleshoot

func (client *TroubleshootClient) BeginTroubleshoot(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, parameters SQLVMTroubleshooting, options *TroubleshootClientBeginTroubleshootOptions) (*runtime.Poller[TroubleshootClientTroubleshootResponse], error)

BeginTroubleshoot - Starts SQL virtual machine troubleshooting. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-08-01-preview

  • resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
  • sqlVirtualMachineName - Name of the SQL virtual machine.
  • parameters - The SQL virtual machine troubleshooting entity.
  • options - TroubleshootClientBeginTroubleshootOptions contains the optional parameters for the TroubleshootClient.BeginTroubleshoot method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79a5aa63c0551c1b5af1d2853cceb495283d334/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2022-08-01-preview/examples/TroubleshootSqlVirtualMachine.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/sqlvirtualmachine/armsqlvirtualmachine"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsqlvirtualmachine.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTroubleshootClient().BeginTroubleshoot(ctx, "testrg", "testvm", armsqlvirtualmachine.SQLVMTroubleshooting{
		EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-09T22:10:00.000Z"); return t }()),
		Properties: &armsqlvirtualmachine.TroubleshootingAdditionalProperties{
			UnhealthyReplicaInfo: &armsqlvirtualmachine.UnhealthyReplicaInfo{
				AvailabilityGroupName: to.Ptr("AG1"),
			},
		},
		StartTimeUTC:            to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-09T17:10:00.000Z"); return t }()),
		TroubleshootingScenario: to.Ptr(armsqlvirtualmachine.TroubleshootingScenarioUnhealthyReplica),
	}, 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.SQLVMTroubleshooting = armsqlvirtualmachine.SQLVMTroubleshooting{
	// 	EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-09T22:10:00.000Z"); return t}()),
	// 	Properties: &armsqlvirtualmachine.TroubleshootingAdditionalProperties{
	// 		UnhealthyReplicaInfo: &armsqlvirtualmachine.UnhealthyReplicaInfo{
	// 			AvailabilityGroupName: to.Ptr("AG1"),
	// 		},
	// 	},
	// 	StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-09T17:10:00.000Z"); return t}()),
	// 	TroubleshootingScenario: to.Ptr(armsqlvirtualmachine.TroubleshootingScenarioUnhealthyReplica),
	// }
}
Output:

type TroubleshootClientBeginTroubleshootOptions

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

TroubleshootClientBeginTroubleshootOptions contains the optional parameters for the TroubleshootClient.BeginTroubleshoot method.

type TroubleshootClientTroubleshootResponse

type TroubleshootClientTroubleshootResponse struct {
	// Details required for SQL VM troubleshooting
	SQLVMTroubleshooting
}

TroubleshootClientTroubleshootResponse contains the response from method TroubleshootClient.BeginTroubleshoot.

type TroubleshootingAdditionalProperties

type TroubleshootingAdditionalProperties struct {
	// The unhealthy replica information
	UnhealthyReplicaInfo *UnhealthyReplicaInfo
}

TroubleshootingAdditionalProperties - SQL VM Troubleshooting additional properties.

func (TroubleshootingAdditionalProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TroubleshootingAdditionalProperties.

func (*TroubleshootingAdditionalProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type TroubleshootingAdditionalProperties.

type TroubleshootingScenario

type TroubleshootingScenario string

TroubleshootingScenario - SQL VM troubleshooting scenario.

const (
	TroubleshootingScenarioUnhealthyReplica TroubleshootingScenario = "UnhealthyReplica"
)

func PossibleTroubleshootingScenarioValues

func PossibleTroubleshootingScenarioValues() []TroubleshootingScenario

PossibleTroubleshootingScenarioValues returns the possible values for the TroubleshootingScenario const type.

type TroubleshootingStatus

type TroubleshootingStatus struct {
	// READ-ONLY; End time in UTC timezone.
	EndTimeUTC *time.Time

	// READ-ONLY; Last troubleshooting trigger time in UTC timezone
	LastTriggerTimeUTC *time.Time

	// READ-ONLY; Troubleshooting properties
	Properties *TroubleshootingAdditionalProperties

	// READ-ONLY; Root cause of the issue
	RootCause *string

	// READ-ONLY; Start time in UTC timezone.
	StartTimeUTC *time.Time

	// READ-ONLY; SQL VM troubleshooting scenario.
	TroubleshootingScenario *TroubleshootingScenario
}

TroubleshootingStatus - Status of last troubleshooting operation on this SQL VM

func (TroubleshootingStatus) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TroubleshootingStatus.

func (*TroubleshootingStatus) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type TroubleshootingStatus.

type UnhealthyReplicaInfo

type UnhealthyReplicaInfo struct {
	// The name of the availability group
	AvailabilityGroupName *string
}

UnhealthyReplicaInfo - SQL VM Troubleshoot UnhealthyReplica scenario information.

func (UnhealthyReplicaInfo) MarshalJSON

func (u UnhealthyReplicaInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UnhealthyReplicaInfo.

func (*UnhealthyReplicaInfo) UnmarshalJSON

func (u *UnhealthyReplicaInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UnhealthyReplicaInfo.

type Update

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

Update - An update to a SQL virtual machine.

func (Update) MarshalJSON

func (u Update) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Update.

func (*Update) UnmarshalJSON

func (u *Update) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Update.

type WsfcDomainCredentials

type WsfcDomainCredentials struct {
	// Cluster bootstrap account password.
	ClusterBootstrapAccountPassword *string

	// Cluster operator account password.
	ClusterOperatorAccountPassword *string

	// SQL service account password.
	SQLServiceAccountPassword *string
}

WsfcDomainCredentials - Domain credentials for setting up Windows Server Failover Cluster for SQL availability group.

func (WsfcDomainCredentials) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type WsfcDomainCredentials.

func (*WsfcDomainCredentials) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type WsfcDomainCredentials.

type WsfcDomainProfile

type WsfcDomainProfile struct {
	// Account name used for creating cluster (at minimum needs permissions to 'Create Computer Objects' in domain).
	ClusterBootstrapAccount *string

	// Account name used for operating cluster i.e. will be part of administrators group on all the participating virtual machines
	// in the cluster.
	ClusterOperatorAccount *string

	// Cluster subnet type.
	ClusterSubnetType *ClusterSubnetType

	// Fully qualified name of the domain.
	DomainFqdn *string

	// Optional path for fileshare witness.
	FileShareWitnessPath *string

	// Organizational Unit path in which the nodes and cluster will be present.
	OuPath *string

	// Account name under which SQL service will run on all participating SQL virtual machines in the cluster.
	SQLServiceAccount *string

	// Primary key of the witness storage account.
	StorageAccountPrimaryKey *string

	// Fully qualified ARM resource id of the witness storage account.
	StorageAccountURL *string
}

WsfcDomainProfile - Active Directory account details to operate Windows Server Failover Cluster.

func (WsfcDomainProfile) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type WsfcDomainProfile.

func (*WsfcDomainProfile) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type WsfcDomainProfile.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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